diff --git a/README.md b/README.md index dcee3b4..2e0c1dc 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/restatedev/sdk-go.svg)](https://pkg.go.dev/github.com/restatedev/sdk-go) [![Go](https://github.com/restatedev/sdk-go/actions/workflows/test.yaml/badge.svg)](https://github.com/restatedev/sdk-go/actions/workflows/test.yaml) -> This only works with Restate version 0.8 - # Restate Go SDK [Restate](https://restate.dev/) is a system for easily building resilient applications using *distributed durable async/await*. This repository contains the Restate SDK for writing services in **Golang**. diff --git a/proto/buf.yaml b/buf.yaml similarity index 64% rename from proto/buf.yaml rename to buf.yaml index 9f6773a..1a51945 100644 --- a/proto/buf.yaml +++ b/buf.yaml @@ -1,6 +1,4 @@ version: v1 -deps: - - buf.build/restatedev/proto breaking: use: - FILE diff --git a/example/user_session.go b/example/user_session.go index b20a002..a6e465f 100644 --- a/example/user_session.go +++ b/example/user_session.go @@ -5,14 +5,14 @@ import ( "slices" "time" - "github.com/restatedev/sdk-go" + restate "github.com/restatedev/sdk-go" "github.com/rs/zerolog/log" ) func addTicket(ctx restate.Context, userId, ticketId string) (bool, error) { var success bool - if err := ctx.Service(TicketServiceName).Method("reserve").Do(ticketId, userId, &success); err != nil { + if err := ctx.Object(TicketServiceName, ticketId).Method("reserve").Do(userId, &success); err != nil { return false, err } @@ -33,7 +33,7 @@ func addTicket(ctx restate.Context, userId, ticketId string) (bool, error) { return false, err } - if err := ctx.Service(UserSessionServiceName).Method("expireTicket").Send(userId, ticketId, 15*time.Minute); err != nil { + if err := ctx.Object(UserSessionServiceName, ticketId).Method("expireTicket").Send(ticketId, 15*time.Minute); err != nil { return false, err } @@ -62,7 +62,7 @@ func expireTicket(ctx restate.Context, _, ticketId string) (void restate.Void, e return void, err } - return void, ctx.Service(TicketServiceName).Method("unreserve").Send(ticketId, nil, 0) + return void, ctx.Object(TicketServiceName, ticketId).Method("unreserve").Send(nil, 0) } func checkout(ctx restate.Context, userId string, _ restate.Void) (bool, error) { @@ -78,17 +78,17 @@ func checkout(ctx restate.Context, userId string, _ restate.Void) (bool, error) } var response PaymentResponse - if err := ctx.Service(CheckoutServiceName). + if err := ctx.Object(CheckoutServiceName, ""). Method("checkout"). - Do("", PaymentRequest{UserID: userId, Tickets: tickets}, &response); err != nil { + Do(PaymentRequest{UserID: userId, Tickets: tickets}, &response); err != nil { return false, err } log.Info().Str("id", response.ID).Int("price", response.Price).Msg("payment details") - call := ctx.Service(TicketServiceName).Method("markAsSold") for _, ticket := range tickets { - if err := call.Send(ticket, nil, 0); err != nil { + call := ctx.Object(ticket, TicketServiceName).Method("markAsSold") + if err := call.Send(nil, 0); err != nil { return false, err } } diff --git a/generated/proto/discovery/discovery.pb.go b/generated/proto/discovery/discovery.pb.go index 78c496a..ffcf939 100644 --- a/generated/proto/discovery/discovery.pb.go +++ b/generated/proto/discovery/discovery.pb.go @@ -1,16 +1,15 @@ +// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH // -// Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH -// -// This file is part of the Restate SDK for Node.js/TypeScript, -// which is released under the MIT license. +// This file is part of the Restate service protocol, which is +// released under the MIT license. // // You can find a copy of the license in file LICENSE in the root // directory of this repository or package, or at -// https://github.com/restatedev/sdk-typescript/blob/main/LICENSE +// https://github.com/restatedev/service-protocol/blob/main/LICENSE // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.26.0 // protoc (unknown) // source: proto/discovery/discovery.proto @@ -19,7 +18,6 @@ package discovery import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" reflect "reflect" sync "sync" ) @@ -31,176 +29,54 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type ProtocolMode int32 +// Service discovery protocol version. +type ServiceDiscoveryProtocolVersion int32 const ( - // protolint:disable:next ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - ProtocolMode_BIDI_STREAM ProtocolMode = 0 - ProtocolMode_REQUEST_RESPONSE ProtocolMode = 1 + ServiceDiscoveryProtocolVersion_SERVICE_DISCOVERY_PROTOCOL_VERSION_UNSPECIFIED ServiceDiscoveryProtocolVersion = 0 + // initial service discovery protocol version using endpoint_manifest_schema.json + ServiceDiscoveryProtocolVersion_V1 ServiceDiscoveryProtocolVersion = 1 ) -// Enum value maps for ProtocolMode. +// Enum value maps for ServiceDiscoveryProtocolVersion. var ( - ProtocolMode_name = map[int32]string{ - 0: "BIDI_STREAM", - 1: "REQUEST_RESPONSE", + ServiceDiscoveryProtocolVersion_name = map[int32]string{ + 0: "SERVICE_DISCOVERY_PROTOCOL_VERSION_UNSPECIFIED", + 1: "V1", } - ProtocolMode_value = map[string]int32{ - "BIDI_STREAM": 0, - "REQUEST_RESPONSE": 1, + ServiceDiscoveryProtocolVersion_value = map[string]int32{ + "SERVICE_DISCOVERY_PROTOCOL_VERSION_UNSPECIFIED": 0, + "V1": 1, } ) -func (x ProtocolMode) Enum() *ProtocolMode { - p := new(ProtocolMode) +func (x ServiceDiscoveryProtocolVersion) Enum() *ServiceDiscoveryProtocolVersion { + p := new(ServiceDiscoveryProtocolVersion) *p = x return p } -func (x ProtocolMode) String() string { +func (x ServiceDiscoveryProtocolVersion) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (ProtocolMode) Descriptor() protoreflect.EnumDescriptor { +func (ServiceDiscoveryProtocolVersion) Descriptor() protoreflect.EnumDescriptor { return file_proto_discovery_discovery_proto_enumTypes[0].Descriptor() } -func (ProtocolMode) Type() protoreflect.EnumType { +func (ServiceDiscoveryProtocolVersion) Type() protoreflect.EnumType { return &file_proto_discovery_discovery_proto_enumTypes[0] } -func (x ProtocolMode) Number() protoreflect.EnumNumber { +func (x ServiceDiscoveryProtocolVersion) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use ProtocolMode.Descriptor instead. -func (ProtocolMode) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use ServiceDiscoveryProtocolVersion.Descriptor instead. +func (ServiceDiscoveryProtocolVersion) EnumDescriptor() ([]byte, []int) { return file_proto_discovery_discovery_proto_rawDescGZIP(), []int{0} } -type ServiceDiscoveryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ServiceDiscoveryRequest) Reset() { - *x = ServiceDiscoveryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_discovery_discovery_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceDiscoveryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceDiscoveryRequest) ProtoMessage() {} - -func (x *ServiceDiscoveryRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_discovery_discovery_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServiceDiscoveryRequest.ProtoReflect.Descriptor instead. -func (*ServiceDiscoveryRequest) Descriptor() ([]byte, []int) { - return file_proto_discovery_discovery_proto_rawDescGZIP(), []int{0} -} - -type ServiceDiscoveryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of all proto files used to define the services, including the - // dependencies. - Files *descriptorpb.FileDescriptorSet `protobuf:"bytes,1,opt,name=files,proto3" json:"files,omitempty"` - // List of services to register. This might be a subset of services defined in - // files. - Services []string `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"` - // Service-protocol version negotiation - MinProtocolVersion uint32 `protobuf:"varint,3,opt,name=min_protocol_version,json=minProtocolVersion,proto3" json:"min_protocol_version,omitempty"` - MaxProtocolVersion uint32 `protobuf:"varint,4,opt,name=max_protocol_version,json=maxProtocolVersion,proto3" json:"max_protocol_version,omitempty"` - // Protocol mode negotiation - ProtocolMode ProtocolMode `protobuf:"varint,5,opt,name=protocol_mode,json=protocolMode,proto3,enum=dev.restate.service.discovery.ProtocolMode" json:"protocol_mode,omitempty"` -} - -func (x *ServiceDiscoveryResponse) Reset() { - *x = ServiceDiscoveryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_discovery_discovery_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceDiscoveryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceDiscoveryResponse) ProtoMessage() {} - -func (x *ServiceDiscoveryResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_discovery_discovery_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServiceDiscoveryResponse.ProtoReflect.Descriptor instead. -func (*ServiceDiscoveryResponse) Descriptor() ([]byte, []int) { - return file_proto_discovery_discovery_proto_rawDescGZIP(), []int{1} -} - -func (x *ServiceDiscoveryResponse) GetFiles() *descriptorpb.FileDescriptorSet { - if x != nil { - return x.Files - } - return nil -} - -func (x *ServiceDiscoveryResponse) GetServices() []string { - if x != nil { - return x.Services - } - return nil -} - -func (x *ServiceDiscoveryResponse) GetMinProtocolVersion() uint32 { - if x != nil { - return x.MinProtocolVersion - } - return 0 -} - -func (x *ServiceDiscoveryResponse) GetMaxProtocolVersion() uint32 { - if x != nil { - return x.MaxProtocolVersion - } - return 0 -} - -func (x *ServiceDiscoveryResponse) GetProtocolMode() ProtocolMode { - if x != nil { - return x.ProtocolMode - } - return ProtocolMode_BIDI_STREAM -} - var File_proto_discovery_discovery_proto protoreflect.FileDescriptor var file_proto_discovery_discovery_proto_rawDesc = []byte{ @@ -208,50 +84,29 @@ var file_proto_discovery_discovery_proto_rawDesc = []byte{ 0x79, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, - 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x19, 0x0a, 0x17, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa6, 0x02, - 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x66, 0x69, - 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x52, 0x05, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, - 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x12, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x64, 0x65, - 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x2a, 0x35, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x42, 0x49, 0x44, 0x49, 0x5f, 0x53, - 0x54, 0x52, 0x45, 0x41, 0x4d, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, 0x51, 0x55, 0x45, - 0x53, 0x54, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x10, 0x01, 0x42, 0x8c, 0x02, - 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, - 0x65, 0x72, 0x79, 0x42, 0x0e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6d, 0x75, 0x68, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x7a, 0x6d, 0x79, 0x2f, 0x72, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x69, 0x73, - 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0xa2, 0x02, 0x04, 0x44, 0x52, 0x53, 0x44, 0xaa, 0x02, 0x1d, - 0x44, 0x65, 0x76, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0xca, 0x02, 0x1d, - 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5c, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0xe2, 0x02, 0x29, - 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5c, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x20, 0x44, 0x65, 0x76, 0x3a, - 0x3a, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2a, 0x5d, 0x0a, 0x1f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x2e, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x44, + 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, + 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x56, 0x31, 0x10, 0x01, 0x42, + 0x83, 0x02, 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x42, 0x0e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x64, 0x65, 0x76, 0x2f, 0x73, + 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0xa2, + 0x02, 0x04, 0x44, 0x52, 0x53, 0x44, 0xaa, 0x02, 0x1d, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0xca, 0x02, 0x1d, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x44, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0xe2, 0x02, 0x29, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x44, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x20, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -267,21 +122,15 @@ func file_proto_discovery_discovery_proto_rawDescGZIP() []byte { } var file_proto_discovery_discovery_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_discovery_discovery_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_proto_discovery_discovery_proto_goTypes = []interface{}{ - (ProtocolMode)(0), // 0: dev.restate.service.discovery.ProtocolMode - (*ServiceDiscoveryRequest)(nil), // 1: dev.restate.service.discovery.ServiceDiscoveryRequest - (*ServiceDiscoveryResponse)(nil), // 2: dev.restate.service.discovery.ServiceDiscoveryResponse - (*descriptorpb.FileDescriptorSet)(nil), // 3: google.protobuf.FileDescriptorSet + (ServiceDiscoveryProtocolVersion)(0), // 0: dev.restate.service.discovery.ServiceDiscoveryProtocolVersion } var file_proto_discovery_discovery_proto_depIdxs = []int32{ - 3, // 0: dev.restate.service.discovery.ServiceDiscoveryResponse.files:type_name -> google.protobuf.FileDescriptorSet - 0, // 1: dev.restate.service.discovery.ServiceDiscoveryResponse.protocol_mode:type_name -> dev.restate.service.discovery.ProtocolMode - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_proto_discovery_discovery_proto_init() } @@ -289,46 +138,19 @@ func file_proto_discovery_discovery_proto_init() { if File_proto_discovery_discovery_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_proto_discovery_discovery_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceDiscoveryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_discovery_discovery_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceDiscoveryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_discovery_discovery_proto_rawDesc, NumEnums: 1, - NumMessages: 2, + NumMessages: 0, NumExtensions: 0, NumServices: 0, }, GoTypes: file_proto_discovery_discovery_proto_goTypes, DependencyIndexes: file_proto_discovery_discovery_proto_depIdxs, EnumInfos: file_proto_discovery_discovery_proto_enumTypes, - MessageInfos: file_proto_discovery_discovery_proto_msgTypes, }.Build() File_proto_discovery_discovery_proto = out.File file_proto_discovery_discovery_proto_rawDesc = nil diff --git a/generated/proto/dynrpc/dynrpc.pb.go b/generated/proto/dynrpc/dynrpc.pb.go deleted file mode 100644 index 5c4a4f6..0000000 --- a/generated/proto/dynrpc/dynrpc.pb.go +++ /dev/null @@ -1,362 +0,0 @@ -// -// Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH -// -// This file is part of the Restate SDK for Node.js/TypeScript, -// which is released under the MIT license. -// -// You can find a copy of the license in file LICENSE in the root -// directory of this repository or package, or at -// https://github.com/restatedev/sdk-typescript/blob/main/LICENSE - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: proto/dynrpc/dynrpc.proto - -package dynrpc - -import ( - _ "github.com/restatedev/sdk-go/generated/dev/restate" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - structpb "google.golang.org/protobuf/types/known/structpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type KeyedEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - Attributes map[string]string `protobuf:"bytes,15,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *KeyedEvent) Reset() { - *x = KeyedEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_dynrpc_dynrpc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyedEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyedEvent) ProtoMessage() {} - -func (x *KeyedEvent) ProtoReflect() protoreflect.Message { - mi := &file_proto_dynrpc_dynrpc_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KeyedEvent.ProtoReflect.Descriptor instead. -func (*KeyedEvent) Descriptor() ([]byte, []int) { - return file_proto_dynrpc_dynrpc_proto_rawDescGZIP(), []int{0} -} - -func (x *KeyedEvent) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *KeyedEvent) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -func (x *KeyedEvent) GetAttributes() map[string]string { - if x != nil { - return x.Attributes - } - return nil -} - -type RpcRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Request *structpb.Value `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"` - // internal: see src/utils/assumptions.ts - SenderAssumes int32 `protobuf:"varint,101,opt,name=sender_assumes,json=senderAssumes,proto3" json:"sender_assumes,omitempty"` -} - -func (x *RpcRequest) Reset() { - *x = RpcRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_dynrpc_dynrpc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RpcRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RpcRequest) ProtoMessage() {} - -func (x *RpcRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_dynrpc_dynrpc_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RpcRequest.ProtoReflect.Descriptor instead. -func (*RpcRequest) Descriptor() ([]byte, []int) { - return file_proto_dynrpc_dynrpc_proto_rawDescGZIP(), []int{1} -} - -func (x *RpcRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *RpcRequest) GetRequest() *structpb.Value { - if x != nil { - return x.Request - } - return nil -} - -func (x *RpcRequest) GetSenderAssumes() int32 { - if x != nil { - return x.SenderAssumes - } - return 0 -} - -type RpcResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Response *structpb.Value `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` -} - -func (x *RpcResponse) Reset() { - *x = RpcResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_dynrpc_dynrpc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RpcResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RpcResponse) ProtoMessage() {} - -func (x *RpcResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_dynrpc_dynrpc_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RpcResponse.ProtoReflect.Descriptor instead. -func (*RpcResponse) Descriptor() ([]byte, []int) { - return file_proto_dynrpc_dynrpc_proto_rawDescGZIP(), []int{2} -} - -func (x *RpcResponse) GetResponse() *structpb.Value { - if x != nil { - return x.Response - } - return nil -} - -var File_proto_dynrpc_dynrpc_proto protoreflect.FileDescriptor - -var file_proto_dynrpc_dynrpc_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x79, 0x6e, 0x72, 0x70, 0x63, 0x2f, 0x64, - 0x79, 0x6e, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x64, 0x65, 0x76, - 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, - 0x0a, 0x0a, 0x4b, 0x65, 0x79, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x90, 0x82, 0x19, 0x00, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x04, 0x90, 0x82, 0x19, 0x01, 0x52, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x41, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x4b, 0x65, 0x79, 0x65, 0x64, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, 0x90, 0x82, 0x19, 0x02, 0x52, 0x0a, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7d, 0x0a, 0x0a, 0x52, 0x70, 0x63, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x04, 0x90, 0x82, 0x19, 0x00, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, - 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x73, - 0x18, 0x65, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x73, - 0x73, 0x75, 0x6d, 0x65, 0x73, 0x22, 0x41, 0x0a, 0x0b, 0x52, 0x70, 0x63, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x69, 0x0a, 0x0b, 0x52, 0x70, 0x63, 0x45, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x12, - 0x0b, 0x2e, 0x52, 0x70, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x52, - 0x70, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x06, - 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x0b, 0x2e, 0x4b, 0x65, 0x79, 0x65, 0x64, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x1a, 0x04, 0x90, - 0x82, 0x19, 0x01, 0x32, 0x3f, 0x0a, 0x12, 0x55, 0x6e, 0x6b, 0x65, 0x79, 0x65, 0x64, 0x52, 0x70, - 0x63, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x63, 0x61, 0x6c, - 0x6c, 0x12, 0x0b, 0x2e, 0x52, 0x70, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, - 0x2e, 0x52, 0x70, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x1a, 0x04, - 0x90, 0x82, 0x19, 0x00, 0x42, 0x4d, 0x42, 0x0b, 0x44, 0x79, 0x6e, 0x72, 0x70, 0x63, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6d, 0x75, 0x68, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x7a, 0x6d, 0x79, 0x2f, 0x72, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x64, 0x79, 0x6e, - 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_dynrpc_dynrpc_proto_rawDescOnce sync.Once - file_proto_dynrpc_dynrpc_proto_rawDescData = file_proto_dynrpc_dynrpc_proto_rawDesc -) - -func file_proto_dynrpc_dynrpc_proto_rawDescGZIP() []byte { - file_proto_dynrpc_dynrpc_proto_rawDescOnce.Do(func() { - file_proto_dynrpc_dynrpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_dynrpc_dynrpc_proto_rawDescData) - }) - return file_proto_dynrpc_dynrpc_proto_rawDescData -} - -var file_proto_dynrpc_dynrpc_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_proto_dynrpc_dynrpc_proto_goTypes = []interface{}{ - (*KeyedEvent)(nil), // 0: KeyedEvent - (*RpcRequest)(nil), // 1: RpcRequest - (*RpcResponse)(nil), // 2: RpcResponse - nil, // 3: KeyedEvent.AttributesEntry - (*structpb.Value)(nil), // 4: google.protobuf.Value - (*emptypb.Empty)(nil), // 5: google.protobuf.Empty -} -var file_proto_dynrpc_dynrpc_proto_depIdxs = []int32{ - 3, // 0: KeyedEvent.attributes:type_name -> KeyedEvent.AttributesEntry - 4, // 1: RpcRequest.request:type_name -> google.protobuf.Value - 4, // 2: RpcResponse.response:type_name -> google.protobuf.Value - 1, // 3: RpcEndpoint.call:input_type -> RpcRequest - 0, // 4: RpcEndpoint.handle:input_type -> KeyedEvent - 1, // 5: UnkeyedRpcEndpoint.call:input_type -> RpcRequest - 2, // 6: RpcEndpoint.call:output_type -> RpcResponse - 5, // 7: RpcEndpoint.handle:output_type -> google.protobuf.Empty - 2, // 8: UnkeyedRpcEndpoint.call:output_type -> RpcResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_proto_dynrpc_dynrpc_proto_init() } -func file_proto_dynrpc_dynrpc_proto_init() { - if File_proto_dynrpc_dynrpc_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_dynrpc_dynrpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyedEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_dynrpc_dynrpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RpcRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_dynrpc_dynrpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RpcResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_dynrpc_dynrpc_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_proto_dynrpc_dynrpc_proto_goTypes, - DependencyIndexes: file_proto_dynrpc_dynrpc_proto_depIdxs, - MessageInfos: file_proto_dynrpc_dynrpc_proto_msgTypes, - }.Build() - File_proto_dynrpc_dynrpc_proto = out.File - file_proto_dynrpc_dynrpc_proto_rawDesc = nil - file_proto_dynrpc_dynrpc_proto_goTypes = nil - file_proto_dynrpc_dynrpc_proto_depIdxs = nil -} diff --git a/generated/proto/javascript/javascript.pb.go b/generated/proto/javascript/javascript.pb.go index 1cb551c..114ee38 100644 --- a/generated/proto/javascript/javascript.pb.go +++ b/generated/proto/javascript/javascript.pb.go @@ -10,14 +10,14 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.26.0 // protoc (unknown) // source: proto/javascript/javascript.proto package javascript import ( - protocol "github.com/restatedev/sdk-go/generated/proto/protocol" + _ "github.com/restatedev/sdk-go/generated/proto/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -31,144 +31,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type FailureWithTerminal struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Failure *protocol.Failure `protobuf:"bytes,1,opt,name=failure,proto3" json:"failure,omitempty"` - Terminal bool `protobuf:"varint,2,opt,name=terminal,proto3" json:"terminal,omitempty"` -} - -func (x *FailureWithTerminal) Reset() { - *x = FailureWithTerminal{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_javascript_javascript_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FailureWithTerminal) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FailureWithTerminal) ProtoMessage() {} - -func (x *FailureWithTerminal) ProtoReflect() protoreflect.Message { - mi := &file_proto_javascript_javascript_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FailureWithTerminal.ProtoReflect.Descriptor instead. -func (*FailureWithTerminal) Descriptor() ([]byte, []int) { - return file_proto_javascript_javascript_proto_rawDescGZIP(), []int{0} -} - -func (x *FailureWithTerminal) GetFailure() *protocol.Failure { - if x != nil { - return x.Failure - } - return nil -} - -func (x *FailureWithTerminal) GetTerminal() bool { - if x != nil { - return x.Terminal - } - return false -} - -// Type: 0xFC00 + 1 -// Flag: RequiresRuntimeAck -type SideEffectEntryMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Result: - // - // *SideEffectEntryMessage_Value - // *SideEffectEntryMessage_Failure - Result isSideEffectEntryMessage_Result `protobuf_oneof:"result"` -} - -func (x *SideEffectEntryMessage) Reset() { - *x = SideEffectEntryMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_javascript_javascript_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SideEffectEntryMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SideEffectEntryMessage) ProtoMessage() {} - -func (x *SideEffectEntryMessage) ProtoReflect() protoreflect.Message { - mi := &file_proto_javascript_javascript_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SideEffectEntryMessage.ProtoReflect.Descriptor instead. -func (*SideEffectEntryMessage) Descriptor() ([]byte, []int) { - return file_proto_javascript_javascript_proto_rawDescGZIP(), []int{1} -} - -func (m *SideEffectEntryMessage) GetResult() isSideEffectEntryMessage_Result { - if m != nil { - return m.Result - } - return nil -} - -func (x *SideEffectEntryMessage) GetValue() []byte { - if x, ok := x.GetResult().(*SideEffectEntryMessage_Value); ok { - return x.Value - } - return nil -} - -func (x *SideEffectEntryMessage) GetFailure() *FailureWithTerminal { - if x, ok := x.GetResult().(*SideEffectEntryMessage_Failure); ok { - return x.Failure - } - return nil -} - -type isSideEffectEntryMessage_Result interface { - isSideEffectEntryMessage_Result() -} - -type SideEffectEntryMessage_Value struct { - Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` -} - -type SideEffectEntryMessage_Failure struct { - Failure *FailureWithTerminal `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` -} - -func (*SideEffectEntryMessage_Value) isSideEffectEntryMessage_Result() {} - -func (*SideEffectEntryMessage_Failure) isSideEffectEntryMessage_Result() {} - // Type: 0xFC00 + 2 type CombinatorEntryMessage struct { state protoimpl.MessageState @@ -182,7 +44,7 @@ type CombinatorEntryMessage struct { func (x *CombinatorEntryMessage) Reset() { *x = CombinatorEntryMessage{} if protoimpl.UnsafeEnabled { - mi := &file_proto_javascript_javascript_proto_msgTypes[2] + mi := &file_proto_javascript_javascript_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -195,7 +57,7 @@ func (x *CombinatorEntryMessage) String() string { func (*CombinatorEntryMessage) ProtoMessage() {} func (x *CombinatorEntryMessage) ProtoReflect() protoreflect.Message { - mi := &file_proto_javascript_javascript_proto_msgTypes[2] + mi := &file_proto_javascript_javascript_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -208,7 +70,7 @@ func (x *CombinatorEntryMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use CombinatorEntryMessage.ProtoReflect.Descriptor instead. func (*CombinatorEntryMessage) Descriptor() ([]byte, []int) { - return file_proto_javascript_javascript_proto_rawDescGZIP(), []int{2} + return file_proto_javascript_javascript_proto_rawDescGZIP(), []int{0} } func (x *CombinatorEntryMessage) GetCombinatorId() int32 { @@ -233,47 +95,31 @@ var file_proto_javascript_javascript_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x1a, 0x1d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x72, - 0x0a, 0x13, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x57, 0x69, 0x74, 0x68, 0x54, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x3f, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x07, 0x66, - 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x61, 0x6c, 0x22, 0x87, 0x01, 0x0a, 0x16, 0x53, 0x69, 0x64, 0x65, 0x45, 0x66, 0x66, 0x65, 0x63, - 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4b, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x57, 0x69, 0x74, 0x68, 0x54, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, - 0x72, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x71, 0x0a, 0x16, - 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x63, - 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x6a, - 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x5f, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x13, 0x6a, 0x6f, 0x75, 0x72, - 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, - 0xff, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x42, 0x0f, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6d, 0x75, 0x68, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x7a, 0x6d, 0x79, 0x2f, 0x72, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6a, 0x61, 0x76, - 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0xa2, 0x02, 0x04, 0x44, 0x52, 0x53, 0x4a, 0xaa, 0x02, - 0x1a, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x64, 0x6b, - 0x2e, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0xca, 0x02, 0x1a, 0x44, 0x65, - 0x76, 0x5c, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x64, 0x6b, 0x5c, 0x4a, 0x61, - 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0xe2, 0x02, 0x26, 0x44, 0x65, 0x76, 0x5c, 0x52, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x64, 0x6b, 0x5c, 0x4a, 0x61, 0x76, 0x61, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x1d, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x3a, 0x3a, 0x53, 0x64, 0x6b, 0x3a, 0x3a, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x71, + 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x62, + 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0c, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x32, 0x0a, + 0x15, 0x6a, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x13, 0x6a, 0x6f, + 0x75, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x42, 0xf6, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x42, 0x0f, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x64, 0x65, 0x76, 0x2f, 0x73, + 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0xa2, 0x02, 0x04, 0x44, 0x52, 0x53, 0x4a, 0xaa, 0x02, 0x1a, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x64, 0x6b, 0x2e, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0xca, 0x02, 0x1a, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x5c, 0x53, 0x64, 0x6b, 0x5c, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0xe2, 0x02, 0x26, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, + 0x53, 0x64, 0x6b, 0x5c, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x44, 0x65, 0x76, + 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x53, 0x64, 0x6b, 0x3a, 0x3a, + 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -288,21 +134,16 @@ func file_proto_javascript_javascript_proto_rawDescGZIP() []byte { return file_proto_javascript_javascript_proto_rawDescData } -var file_proto_javascript_javascript_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_proto_javascript_javascript_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_proto_javascript_javascript_proto_goTypes = []interface{}{ - (*FailureWithTerminal)(nil), // 0: dev.restate.sdk.javascript.FailureWithTerminal - (*SideEffectEntryMessage)(nil), // 1: dev.restate.sdk.javascript.SideEffectEntryMessage - (*CombinatorEntryMessage)(nil), // 2: dev.restate.sdk.javascript.CombinatorEntryMessage - (*protocol.Failure)(nil), // 3: dev.restate.service.protocol.Failure + (*CombinatorEntryMessage)(nil), // 0: dev.restate.sdk.javascript.CombinatorEntryMessage } var file_proto_javascript_javascript_proto_depIdxs = []int32{ - 3, // 0: dev.restate.sdk.javascript.FailureWithTerminal.failure:type_name -> dev.restate.service.protocol.Failure - 0, // 1: dev.restate.sdk.javascript.SideEffectEntryMessage.failure:type_name -> dev.restate.sdk.javascript.FailureWithTerminal - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_proto_javascript_javascript_proto_init() } @@ -312,30 +153,6 @@ func file_proto_javascript_javascript_proto_init() { } if !protoimpl.UnsafeEnabled { file_proto_javascript_javascript_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FailureWithTerminal); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_javascript_javascript_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SideEffectEntryMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_javascript_javascript_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CombinatorEntryMessage); i { case 0: return &v.state @@ -348,17 +165,13 @@ func file_proto_javascript_javascript_proto_init() { } } } - file_proto_javascript_javascript_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*SideEffectEntryMessage_Value)(nil), - (*SideEffectEntryMessage_Failure)(nil), - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_javascript_javascript_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 1, NumExtensions: 0, NumServices: 0, }, diff --git a/generated/proto/protocol/protocol.pb.go b/generated/proto/protocol/protocol.pb.go index da54474..ea25628 100644 --- a/generated/proto/protocol/protocol.pb.go +++ b/generated/proto/protocol/protocol.pb.go @@ -9,7 +9,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.26.0 // protoc (unknown) // source: proto/protocol/protocol.proto @@ -18,7 +18,6 @@ package protocol import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) @@ -30,23 +29,71 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Service protocol version. +type ServiceProtocolVersion int32 + +const ( + ServiceProtocolVersion_SERVICE_PROTOCOL_VERSION_UNSPECIFIED ServiceProtocolVersion = 0 + // initial service protocol version + ServiceProtocolVersion_V1 ServiceProtocolVersion = 1 +) + +// Enum value maps for ServiceProtocolVersion. +var ( + ServiceProtocolVersion_name = map[int32]string{ + 0: "SERVICE_PROTOCOL_VERSION_UNSPECIFIED", + 1: "V1", + } + ServiceProtocolVersion_value = map[string]int32{ + "SERVICE_PROTOCOL_VERSION_UNSPECIFIED": 0, + "V1": 1, + } +) + +func (x ServiceProtocolVersion) Enum() *ServiceProtocolVersion { + p := new(ServiceProtocolVersion) + *p = x + return p +} + +func (x ServiceProtocolVersion) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ServiceProtocolVersion) Descriptor() protoreflect.EnumDescriptor { + return file_proto_protocol_protocol_proto_enumTypes[0].Descriptor() +} + +func (ServiceProtocolVersion) Type() protoreflect.EnumType { + return &file_proto_protocol_protocol_proto_enumTypes[0] +} + +func (x ServiceProtocolVersion) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ServiceProtocolVersion.Descriptor instead. +func (ServiceProtocolVersion) EnumDescriptor() ([]byte, []int) { + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{0} +} + // Type: 0x0000 + 0 type StartMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Unique id of the invocation. This id is unique across invocations and won't - // change when replaying the journal. + // Unique id of the invocation. This id is unique across invocations and won't change when replaying the journal. Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Invocation id that can be used for logging. - // The user can use this id to address this invocation in admin and status - // introspection apis. + // The user can use this id to address this invocation in admin and status introspection apis. DebugId string `protobuf:"bytes,2,opt,name=debug_id,json=debugId,proto3" json:"debug_id,omitempty"` KnownEntries uint32 `protobuf:"varint,3,opt,name=known_entries,json=knownEntries,proto3" json:"known_entries,omitempty"` // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED StateMap []*StartMessage_StateEntry `protobuf:"bytes,4,rep,name=state_map,json=stateMap,proto3" json:"state_map,omitempty"` PartialState bool `protobuf:"varint,5,opt,name=partial_state,json=partialState,proto3" json:"partial_state,omitempty"` + // If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise. + Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` } func (x *StartMessage) Reset() { @@ -116,6 +163,13 @@ func (x *StartMessage) GetPartialState() bool { return false } +func (x *StartMessage) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + // Type: 0x0000 + 1 type CompletionMessage struct { state protoimpl.MessageState @@ -177,7 +231,7 @@ func (m *CompletionMessage) GetResult() isCompletionMessage_Result { return nil } -func (x *CompletionMessage) GetEmpty() *emptypb.Empty { +func (x *CompletionMessage) GetEmpty() *Empty { if x, ok := x.GetResult().(*CompletionMessage_Empty); ok { return x.Empty } @@ -203,7 +257,7 @@ type isCompletionMessage_Result interface { } type CompletionMessage_Empty struct { - Empty *emptypb.Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` + Empty *Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` } type CompletionMessage_Value struct { @@ -227,10 +281,10 @@ type SuspensionMessage struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // This list represents any of the entry_index the invocation is waiting on to - // progress. The runtime will resume the invocation as soon as one of the - // given entry_index is completed. This list MUST not be empty. False - // positive, entry_indexes is a valid plural of entry_indices. + // This list represents any of the entry_index the invocation is waiting on to progress. + // The runtime will resume the invocation as soon as one of the given entry_index is completed. + // This list MUST not be empty. + // False positive, entry_indexes is a valid plural of entry_indices. // https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/i/index-indexes-indices EntryIndexes []uint32 `protobuf:"varint,1,rep,packed,name=entry_indexes,json=entryIndexes,proto3" json:"entry_indexes,omitempty"` // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED } @@ -280,21 +334,22 @@ type ErrorMessage struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The code can be: - // * Any of the error codes defined by OutputStreamEntry.failure (see Failure - // message) - // * JOURNAL_MISMATCH = 32, that is when the SDK cannot replay a journal due - // to the mismatch between the journal and the actual code. - // * PROTOCOL_VIOLATION = 33, that is when the SDK receives an unexpected - // message or an expected message variant, given its state. - // - // If 16 < code < 32, or code > 33, the runtime will interpret it as code 2 - // (UNKNOWN). + // The code can be any HTTP status code, as described https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml. + // In addition, we define the following error codes that MAY be used by the SDK for better error reporting: + // * JOURNAL_MISMATCH = 570, that is when the SDK cannot replay a journal due to the mismatch between the journal and the actual code. + // * PROTOCOL_VIOLATION = 571, that is when the SDK receives an unexpected message or an expected message variant, given its state. Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // Contains a concise error message, e.g. Throwable#getMessage() in Java. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // Contains a verbose error description, e.g. the exception stacktrace. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Entry that caused the failure. This may be outside the current stored journal size. + // If no specific entry caused the failure, the current replayed/processed entry can be used. + RelatedEntryIndex *uint32 `protobuf:"varint,4,opt,name=related_entry_index,json=relatedEntryIndex,proto3,oneof" json:"related_entry_index,omitempty"` + // Name of the entry that caused the failure. + RelatedEntryName *string `protobuf:"bytes,5,opt,name=related_entry_name,json=relatedEntryName,proto3,oneof" json:"related_entry_name,omitempty"` + // Entry type. + RelatedEntryType *uint32 `protobuf:"varint,6,opt,name=related_entry_type,json=relatedEntryType,proto3,oneof" json:"related_entry_type,omitempty"` } func (x *ErrorMessage) Reset() { @@ -350,6 +405,27 @@ func (x *ErrorMessage) GetDescription() string { return "" } +func (x *ErrorMessage) GetRelatedEntryIndex() uint32 { + if x != nil && x.RelatedEntryIndex != nil { + return *x.RelatedEntryIndex + } + return 0 +} + +func (x *ErrorMessage) GetRelatedEntryName() string { + if x != nil && x.RelatedEntryName != nil { + return *x.RelatedEntryName + } + return "" +} + +func (x *ErrorMessage) GetRelatedEntryType() uint32 { + if x != nil && x.RelatedEntryType != nil { + return *x.RelatedEntryType + } + return 0 +} + // Type: 0x0000 + 4 type EntryAckMessage struct { state protoimpl.MessageState @@ -438,23 +514,22 @@ func (*EndMessage) Descriptor() ([]byte, []int) { return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{5} } -// Completable: Yes +// Completable: No // Fallible: No // Type: 0x0400 + 0 -type PollInputStreamEntryMessage struct { +type InputEntryMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Types that are assignable to Result: - // - // *PollInputStreamEntryMessage_Value - // *PollInputStreamEntryMessage_Failure - Result isPollInputStreamEntryMessage_Result `protobuf_oneof:"result"` + Headers []*Header `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"` + Value []byte `protobuf:"bytes,14,opt,name=value,proto3" json:"value,omitempty"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } -func (x *PollInputStreamEntryMessage) Reset() { - *x = PollInputStreamEntryMessage{} +func (x *InputEntryMessage) Reset() { + *x = InputEntryMessage{} if protoimpl.UnsafeEnabled { mi := &file_proto_protocol_protocol_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -462,13 +537,13 @@ func (x *PollInputStreamEntryMessage) Reset() { } } -func (x *PollInputStreamEntryMessage) String() string { +func (x *InputEntryMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PollInputStreamEntryMessage) ProtoMessage() {} +func (*InputEntryMessage) ProtoMessage() {} -func (x *PollInputStreamEntryMessage) ProtoReflect() protoreflect.Message { +func (x *InputEntryMessage) ProtoReflect() protoreflect.Message { mi := &file_proto_protocol_protocol_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -480,65 +555,51 @@ func (x *PollInputStreamEntryMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PollInputStreamEntryMessage.ProtoReflect.Descriptor instead. -func (*PollInputStreamEntryMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use InputEntryMessage.ProtoReflect.Descriptor instead. +func (*InputEntryMessage) Descriptor() ([]byte, []int) { return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{6} } -func (m *PollInputStreamEntryMessage) GetResult() isPollInputStreamEntryMessage_Result { - if m != nil { - return m.Result +func (x *InputEntryMessage) GetHeaders() []*Header { + if x != nil { + return x.Headers } return nil } -func (x *PollInputStreamEntryMessage) GetValue() []byte { - if x, ok := x.GetResult().(*PollInputStreamEntryMessage_Value); ok { +func (x *InputEntryMessage) GetValue() []byte { + if x != nil { return x.Value } return nil } -func (x *PollInputStreamEntryMessage) GetFailure() *Failure { - if x, ok := x.GetResult().(*PollInputStreamEntryMessage_Failure); ok { - return x.Failure +func (x *InputEntryMessage) GetName() string { + if x != nil { + return x.Name } - return nil -} - -type isPollInputStreamEntryMessage_Result interface { - isPollInputStreamEntryMessage_Result() -} - -type PollInputStreamEntryMessage_Value struct { - Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` -} - -type PollInputStreamEntryMessage_Failure struct { - Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` + return "" } -func (*PollInputStreamEntryMessage_Value) isPollInputStreamEntryMessage_Result() {} - -func (*PollInputStreamEntryMessage_Failure) isPollInputStreamEntryMessage_Result() {} - // Completable: No // Fallible: No // Type: 0x0400 + 1 -type OutputStreamEntryMessage struct { +type OutputEntryMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Result: // - // *OutputStreamEntryMessage_Value - // *OutputStreamEntryMessage_Failure - Result isOutputStreamEntryMessage_Result `protobuf_oneof:"result"` + // *OutputEntryMessage_Value + // *OutputEntryMessage_Failure + Result isOutputEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } -func (x *OutputStreamEntryMessage) Reset() { - *x = OutputStreamEntryMessage{} +func (x *OutputEntryMessage) Reset() { + *x = OutputEntryMessage{} if protoimpl.UnsafeEnabled { mi := &file_proto_protocol_protocol_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -546,13 +607,13 @@ func (x *OutputStreamEntryMessage) Reset() { } } -func (x *OutputStreamEntryMessage) String() string { +func (x *OutputEntryMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*OutputStreamEntryMessage) ProtoMessage() {} +func (*OutputEntryMessage) ProtoMessage() {} -func (x *OutputStreamEntryMessage) ProtoReflect() protoreflect.Message { +func (x *OutputEntryMessage) ProtoReflect() protoreflect.Message { mi := &file_proto_protocol_protocol_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -564,47 +625,54 @@ func (x *OutputStreamEntryMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use OutputStreamEntryMessage.ProtoReflect.Descriptor instead. -func (*OutputStreamEntryMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use OutputEntryMessage.ProtoReflect.Descriptor instead. +func (*OutputEntryMessage) Descriptor() ([]byte, []int) { return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{7} } -func (m *OutputStreamEntryMessage) GetResult() isOutputStreamEntryMessage_Result { +func (m *OutputEntryMessage) GetResult() isOutputEntryMessage_Result { if m != nil { return m.Result } return nil } -func (x *OutputStreamEntryMessage) GetValue() []byte { - if x, ok := x.GetResult().(*OutputStreamEntryMessage_Value); ok { +func (x *OutputEntryMessage) GetValue() []byte { + if x, ok := x.GetResult().(*OutputEntryMessage_Value); ok { return x.Value } return nil } -func (x *OutputStreamEntryMessage) GetFailure() *Failure { - if x, ok := x.GetResult().(*OutputStreamEntryMessage_Failure); ok { +func (x *OutputEntryMessage) GetFailure() *Failure { + if x, ok := x.GetResult().(*OutputEntryMessage_Failure); ok { return x.Failure } return nil } -type isOutputStreamEntryMessage_Result interface { - isOutputStreamEntryMessage_Result() +func (x *OutputEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type isOutputEntryMessage_Result interface { + isOutputEntryMessage_Result() } -type OutputStreamEntryMessage_Value struct { +type OutputEntryMessage_Value struct { Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` } -type OutputStreamEntryMessage_Failure struct { +type OutputEntryMessage_Failure struct { Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` } -func (*OutputStreamEntryMessage_Value) isOutputStreamEntryMessage_Result() {} +func (*OutputEntryMessage_Value) isOutputEntryMessage_Result() {} -func (*OutputStreamEntryMessage_Failure) isOutputStreamEntryMessage_Result() {} +func (*OutputEntryMessage_Failure) isOutputEntryMessage_Result() {} // Completable: Yes // Fallible: No @@ -621,6 +689,8 @@ type GetStateEntryMessage struct { // *GetStateEntryMessage_Value // *GetStateEntryMessage_Failure Result isGetStateEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } func (x *GetStateEntryMessage) Reset() { @@ -669,7 +739,7 @@ func (m *GetStateEntryMessage) GetResult() isGetStateEntryMessage_Result { return nil } -func (x *GetStateEntryMessage) GetEmpty() *emptypb.Empty { +func (x *GetStateEntryMessage) GetEmpty() *Empty { if x, ok := x.GetResult().(*GetStateEntryMessage_Empty); ok { return x.Empty } @@ -690,12 +760,19 @@ func (x *GetStateEntryMessage) GetFailure() *Failure { return nil } +func (x *GetStateEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + type isGetStateEntryMessage_Result interface { isGetStateEntryMessage_Result() } type GetStateEntryMessage_Empty struct { - Empty *emptypb.Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` + Empty *Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` } type GetStateEntryMessage_Value struct { @@ -722,6 +799,8 @@ type SetStateEntryMessage struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } func (x *SetStateEntryMessage) Reset() { @@ -770,6 +849,13 @@ func (x *SetStateEntryMessage) GetValue() []byte { return nil } +func (x *SetStateEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + // Completable: No // Fallible: No // Type: 0x0800 + 2 @@ -779,6 +865,8 @@ type ClearStateEntryMessage struct { unknownFields protoimpl.UnknownFields Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } func (x *ClearStateEntryMessage) Reset() { @@ -820,6 +908,13 @@ func (x *ClearStateEntryMessage) GetKey() []byte { return nil } +func (x *ClearStateEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + // Completable: No // Fallible: No // Type: 0x0800 + 3 @@ -827,6 +922,9 @@ type ClearAllStateEntryMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } func (x *ClearAllStateEntryMessage) Reset() { @@ -861,6 +959,13 @@ func (*ClearAllStateEntryMessage) Descriptor() ([]byte, []int) { return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{11} } +func (x *ClearAllStateEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + // Completable: Yes // Fallible: No // Type: 0x0800 + 4 @@ -874,6 +979,8 @@ type GetStateKeysEntryMessage struct { // *GetStateKeysEntryMessage_Value // *GetStateKeysEntryMessage_Failure Result isGetStateKeysEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } func (x *GetStateKeysEntryMessage) Reset() { @@ -929,6 +1036,13 @@ func (x *GetStateKeysEntryMessage) GetFailure() *Failure { return nil } +func (x *GetStateKeysEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + type isGetStateKeysEntryMessage_Result interface { isGetStateKeysEntryMessage_Result() } @@ -947,24 +1061,24 @@ func (*GetStateKeysEntryMessage_Failure) isGetStateKeysEntryMessage_Result() {} // Completable: Yes // Fallible: No -// Type: 0x0C00 + 0 -type SleepEntryMessage struct { +// Type: 0x0800 + 8 +type GetPromiseEntryMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Wake up time. - // The time is set as duration since UNIX Epoch. - WakeUpTime uint64 `protobuf:"varint,1,opt,name=wake_up_time,json=wakeUpTime,proto3" json:"wake_up_time,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // Types that are assignable to Result: // - // *SleepEntryMessage_Empty - // *SleepEntryMessage_Failure - Result isSleepEntryMessage_Result `protobuf_oneof:"result"` + // *GetPromiseEntryMessage_Value + // *GetPromiseEntryMessage_Failure + Result isGetPromiseEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } -func (x *SleepEntryMessage) Reset() { - *x = SleepEntryMessage{} +func (x *GetPromiseEntryMessage) Reset() { + *x = GetPromiseEntryMessage{} if protoimpl.UnsafeEnabled { mi := &file_proto_protocol_protocol_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -972,13 +1086,13 @@ func (x *SleepEntryMessage) Reset() { } } -func (x *SleepEntryMessage) String() string { +func (x *GetPromiseEntryMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SleepEntryMessage) ProtoMessage() {} +func (*GetPromiseEntryMessage) ProtoMessage() {} -func (x *SleepEntryMessage) ProtoReflect() protoreflect.Message { +func (x *GetPromiseEntryMessage) ProtoReflect() protoreflect.Message { mi := &file_proto_protocol_protocol_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -990,75 +1104,83 @@ func (x *SleepEntryMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SleepEntryMessage.ProtoReflect.Descriptor instead. -func (*SleepEntryMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use GetPromiseEntryMessage.ProtoReflect.Descriptor instead. +func (*GetPromiseEntryMessage) Descriptor() ([]byte, []int) { return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{13} } -func (x *SleepEntryMessage) GetWakeUpTime() uint64 { +func (x *GetPromiseEntryMessage) GetKey() string { if x != nil { - return x.WakeUpTime + return x.Key } - return 0 + return "" } -func (m *SleepEntryMessage) GetResult() isSleepEntryMessage_Result { +func (m *GetPromiseEntryMessage) GetResult() isGetPromiseEntryMessage_Result { if m != nil { return m.Result } return nil } -func (x *SleepEntryMessage) GetEmpty() *emptypb.Empty { - if x, ok := x.GetResult().(*SleepEntryMessage_Empty); ok { - return x.Empty +func (x *GetPromiseEntryMessage) GetValue() []byte { + if x, ok := x.GetResult().(*GetPromiseEntryMessage_Value); ok { + return x.Value } return nil } -func (x *SleepEntryMessage) GetFailure() *Failure { - if x, ok := x.GetResult().(*SleepEntryMessage_Failure); ok { +func (x *GetPromiseEntryMessage) GetFailure() *Failure { + if x, ok := x.GetResult().(*GetPromiseEntryMessage_Failure); ok { return x.Failure } return nil } -type isSleepEntryMessage_Result interface { - isSleepEntryMessage_Result() +func (x *GetPromiseEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" } -type SleepEntryMessage_Empty struct { - Empty *emptypb.Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` +type isGetPromiseEntryMessage_Result interface { + isGetPromiseEntryMessage_Result() } -type SleepEntryMessage_Failure struct { +type GetPromiseEntryMessage_Value struct { + Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` +} + +type GetPromiseEntryMessage_Failure struct { Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` } -func (*SleepEntryMessage_Empty) isSleepEntryMessage_Result() {} +func (*GetPromiseEntryMessage_Value) isGetPromiseEntryMessage_Result() {} -func (*SleepEntryMessage_Failure) isSleepEntryMessage_Result() {} +func (*GetPromiseEntryMessage_Failure) isGetPromiseEntryMessage_Result() {} // Completable: Yes -// Fallible: Yes -// Type: 0x0C00 + 1 -type InvokeEntryMessage struct { +// Fallible: No +// Type: 0x0800 + 9 +type PeekPromiseEntryMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - MethodName string `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` - Parameter []byte `protobuf:"bytes,3,opt,name=parameter,proto3" json:"parameter,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // Types that are assignable to Result: // - // *InvokeEntryMessage_Value - // *InvokeEntryMessage_Failure - Result isInvokeEntryMessage_Result `protobuf_oneof:"result"` + // *PeekPromiseEntryMessage_Empty + // *PeekPromiseEntryMessage_Value + // *PeekPromiseEntryMessage_Failure + Result isPeekPromiseEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } -func (x *InvokeEntryMessage) Reset() { - *x = InvokeEntryMessage{} +func (x *PeekPromiseEntryMessage) Reset() { + *x = PeekPromiseEntryMessage{} if protoimpl.UnsafeEnabled { mi := &file_proto_protocol_protocol_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1066,13 +1188,13 @@ func (x *InvokeEntryMessage) Reset() { } } -func (x *InvokeEntryMessage) String() string { +func (x *PeekPromiseEntryMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*InvokeEntryMessage) ProtoMessage() {} +func (*PeekPromiseEntryMessage) ProtoMessage() {} -func (x *InvokeEntryMessage) ProtoReflect() protoreflect.Message { +func (x *PeekPromiseEntryMessage) ProtoReflect() protoreflect.Message { mi := &file_proto_protocol_protocol_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1084,89 +1206,102 @@ func (x *InvokeEntryMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use InvokeEntryMessage.ProtoReflect.Descriptor instead. -func (*InvokeEntryMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use PeekPromiseEntryMessage.ProtoReflect.Descriptor instead. +func (*PeekPromiseEntryMessage) Descriptor() ([]byte, []int) { return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{14} } -func (x *InvokeEntryMessage) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *InvokeEntryMessage) GetMethodName() string { +func (x *PeekPromiseEntryMessage) GetKey() string { if x != nil { - return x.MethodName + return x.Key } return "" } -func (x *InvokeEntryMessage) GetParameter() []byte { - if x != nil { - return x.Parameter +func (m *PeekPromiseEntryMessage) GetResult() isPeekPromiseEntryMessage_Result { + if m != nil { + return m.Result } return nil } -func (m *InvokeEntryMessage) GetResult() isInvokeEntryMessage_Result { - if m != nil { - return m.Result +func (x *PeekPromiseEntryMessage) GetEmpty() *Empty { + if x, ok := x.GetResult().(*PeekPromiseEntryMessage_Empty); ok { + return x.Empty } return nil } -func (x *InvokeEntryMessage) GetValue() []byte { - if x, ok := x.GetResult().(*InvokeEntryMessage_Value); ok { +func (x *PeekPromiseEntryMessage) GetValue() []byte { + if x, ok := x.GetResult().(*PeekPromiseEntryMessage_Value); ok { return x.Value } return nil } -func (x *InvokeEntryMessage) GetFailure() *Failure { - if x, ok := x.GetResult().(*InvokeEntryMessage_Failure); ok { +func (x *PeekPromiseEntryMessage) GetFailure() *Failure { + if x, ok := x.GetResult().(*PeekPromiseEntryMessage_Failure); ok { return x.Failure } return nil } -type isInvokeEntryMessage_Result interface { - isInvokeEntryMessage_Result() +func (x *PeekPromiseEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type isPeekPromiseEntryMessage_Result interface { + isPeekPromiseEntryMessage_Result() } -type InvokeEntryMessage_Value struct { +type PeekPromiseEntryMessage_Empty struct { + Empty *Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` +} + +type PeekPromiseEntryMessage_Value struct { Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` } -type InvokeEntryMessage_Failure struct { +type PeekPromiseEntryMessage_Failure struct { Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` } -func (*InvokeEntryMessage_Value) isInvokeEntryMessage_Result() {} +func (*PeekPromiseEntryMessage_Empty) isPeekPromiseEntryMessage_Result() {} -func (*InvokeEntryMessage_Failure) isInvokeEntryMessage_Result() {} +func (*PeekPromiseEntryMessage_Value) isPeekPromiseEntryMessage_Result() {} -// Completable: No -// Fallible: Yes -// Type: 0x0C00 + 2 -type BackgroundInvokeEntryMessage struct { +func (*PeekPromiseEntryMessage_Failure) isPeekPromiseEntryMessage_Result() {} + +// Completable: Yes +// Fallible: No +// Type: 0x0800 + A +type CompletePromiseEntryMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - MethodName string `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` - Parameter []byte `protobuf:"bytes,3,opt,name=parameter,proto3" json:"parameter,omitempty"` - // Time when this BackgroundInvoke should be executed. - // The time is set as duration since UNIX Epoch. - // If this value is not set, equal to 0, or past in time, - // the runtime will execute this BackgroundInvoke as soon as possible. - InvokeTime uint64 `protobuf:"varint,4,opt,name=invoke_time,json=invokeTime,proto3" json:"invoke_time,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // The value to use to complete the promise + // + // Types that are assignable to Completion: + // + // *CompletePromiseEntryMessage_CompletionValue + // *CompletePromiseEntryMessage_CompletionFailure + Completion isCompletePromiseEntryMessage_Completion `protobuf_oneof:"completion"` + // Types that are assignable to Result: + // + // *CompletePromiseEntryMessage_Empty + // *CompletePromiseEntryMessage_Failure + Result isCompletePromiseEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } -func (x *BackgroundInvokeEntryMessage) Reset() { - *x = BackgroundInvokeEntryMessage{} +func (x *CompletePromiseEntryMessage) Reset() { + *x = CompletePromiseEntryMessage{} if protoimpl.UnsafeEnabled { mi := &file_proto_protocol_protocol_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1174,13 +1309,13 @@ func (x *BackgroundInvokeEntryMessage) Reset() { } } -func (x *BackgroundInvokeEntryMessage) String() string { +func (x *CompletePromiseEntryMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BackgroundInvokeEntryMessage) ProtoMessage() {} +func (*CompletePromiseEntryMessage) ProtoMessage() {} -func (x *BackgroundInvokeEntryMessage) ProtoReflect() protoreflect.Message { +func (x *CompletePromiseEntryMessage) ProtoReflect() protoreflect.Message { mi := &file_proto_protocol_protocol_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1192,58 +1327,123 @@ func (x *BackgroundInvokeEntryMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BackgroundInvokeEntryMessage.ProtoReflect.Descriptor instead. -func (*BackgroundInvokeEntryMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use CompletePromiseEntryMessage.ProtoReflect.Descriptor instead. +func (*CompletePromiseEntryMessage) Descriptor() ([]byte, []int) { return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{15} } -func (x *BackgroundInvokeEntryMessage) GetServiceName() string { +func (x *CompletePromiseEntryMessage) GetKey() string { if x != nil { - return x.ServiceName + return x.Key } return "" } -func (x *BackgroundInvokeEntryMessage) GetMethodName() string { - if x != nil { - return x.MethodName +func (m *CompletePromiseEntryMessage) GetCompletion() isCompletePromiseEntryMessage_Completion { + if m != nil { + return m.Completion } - return "" + return nil } -func (x *BackgroundInvokeEntryMessage) GetParameter() []byte { - if x != nil { - return x.Parameter +func (x *CompletePromiseEntryMessage) GetCompletionValue() []byte { + if x, ok := x.GetCompletion().(*CompletePromiseEntryMessage_CompletionValue); ok { + return x.CompletionValue + } + return nil +} + +func (x *CompletePromiseEntryMessage) GetCompletionFailure() *Failure { + if x, ok := x.GetCompletion().(*CompletePromiseEntryMessage_CompletionFailure); ok { + return x.CompletionFailure + } + return nil +} + +func (m *CompletePromiseEntryMessage) GetResult() isCompletePromiseEntryMessage_Result { + if m != nil { + return m.Result } return nil } -func (x *BackgroundInvokeEntryMessage) GetInvokeTime() uint64 { +func (x *CompletePromiseEntryMessage) GetEmpty() *Empty { + if x, ok := x.GetResult().(*CompletePromiseEntryMessage_Empty); ok { + return x.Empty + } + return nil +} + +func (x *CompletePromiseEntryMessage) GetFailure() *Failure { + if x, ok := x.GetResult().(*CompletePromiseEntryMessage_Failure); ok { + return x.Failure + } + return nil +} + +func (x *CompletePromiseEntryMessage) GetName() string { if x != nil { - return x.InvokeTime + return x.Name } - return 0 + return "" +} + +type isCompletePromiseEntryMessage_Completion interface { + isCompletePromiseEntryMessage_Completion() +} + +type CompletePromiseEntryMessage_CompletionValue struct { + CompletionValue []byte `protobuf:"bytes,2,opt,name=completion_value,json=completionValue,proto3,oneof"` +} + +type CompletePromiseEntryMessage_CompletionFailure struct { + CompletionFailure *Failure `protobuf:"bytes,3,opt,name=completion_failure,json=completionFailure,proto3,oneof"` +} + +func (*CompletePromiseEntryMessage_CompletionValue) isCompletePromiseEntryMessage_Completion() {} + +func (*CompletePromiseEntryMessage_CompletionFailure) isCompletePromiseEntryMessage_Completion() {} + +type isCompletePromiseEntryMessage_Result interface { + isCompletePromiseEntryMessage_Result() +} + +type CompletePromiseEntryMessage_Empty struct { + // Returns empty if value was set successfully + Empty *Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` +} + +type CompletePromiseEntryMessage_Failure struct { + // Returns a failure if the promise was already completed + Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` } +func (*CompletePromiseEntryMessage_Empty) isCompletePromiseEntryMessage_Result() {} + +func (*CompletePromiseEntryMessage_Failure) isCompletePromiseEntryMessage_Result() {} + // Completable: Yes // Fallible: No -// Type: 0x0C00 + 3 -// Awakeables are addressed by an identifier exposed to the user. See the spec -// for more details. -type AwakeableEntryMessage struct { +// Type: 0x0C00 + 0 +type SleepEntryMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Wake up time. + // The time is set as duration since UNIX Epoch. + WakeUpTime uint64 `protobuf:"varint,1,opt,name=wake_up_time,json=wakeUpTime,proto3" json:"wake_up_time,omitempty"` // Types that are assignable to Result: // - // *AwakeableEntryMessage_Value - // *AwakeableEntryMessage_Failure - Result isAwakeableEntryMessage_Result `protobuf_oneof:"result"` + // *SleepEntryMessage_Empty + // *SleepEntryMessage_Failure + Result isSleepEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } -func (x *AwakeableEntryMessage) Reset() { - *x = AwakeableEntryMessage{} +func (x *SleepEntryMessage) Reset() { + *x = SleepEntryMessage{} if protoimpl.UnsafeEnabled { mi := &file_proto_protocol_protocol_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1251,13 +1451,13 @@ func (x *AwakeableEntryMessage) Reset() { } } -func (x *AwakeableEntryMessage) String() string { +func (x *SleepEntryMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AwakeableEntryMessage) ProtoMessage() {} +func (*SleepEntryMessage) ProtoMessage() {} -func (x *AwakeableEntryMessage) ProtoReflect() protoreflect.Message { +func (x *SleepEntryMessage) ProtoReflect() protoreflect.Message { mi := &file_proto_protocol_protocol_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1269,16 +1469,355 @@ func (x *AwakeableEntryMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AwakeableEntryMessage.ProtoReflect.Descriptor instead. -func (*AwakeableEntryMessage) Descriptor() ([]byte, []int) { +// Deprecated: Use SleepEntryMessage.ProtoReflect.Descriptor instead. +func (*SleepEntryMessage) Descriptor() ([]byte, []int) { return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{16} } -func (m *AwakeableEntryMessage) GetResult() isAwakeableEntryMessage_Result { - if m != nil { - return m.Result +func (x *SleepEntryMessage) GetWakeUpTime() uint64 { + if x != nil { + return x.WakeUpTime } - return nil + return 0 +} + +func (m *SleepEntryMessage) GetResult() isSleepEntryMessage_Result { + if m != nil { + return m.Result + } + return nil +} + +func (x *SleepEntryMessage) GetEmpty() *Empty { + if x, ok := x.GetResult().(*SleepEntryMessage_Empty); ok { + return x.Empty + } + return nil +} + +func (x *SleepEntryMessage) GetFailure() *Failure { + if x, ok := x.GetResult().(*SleepEntryMessage_Failure); ok { + return x.Failure + } + return nil +} + +func (x *SleepEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type isSleepEntryMessage_Result interface { + isSleepEntryMessage_Result() +} + +type SleepEntryMessage_Empty struct { + Empty *Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` +} + +type SleepEntryMessage_Failure struct { + Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` +} + +func (*SleepEntryMessage_Empty) isSleepEntryMessage_Result() {} + +func (*SleepEntryMessage_Failure) isSleepEntryMessage_Result() {} + +// Completable: Yes +// Fallible: Yes +// Type: 0x0C00 + 1 +type CallEntryMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + HandlerName string `protobuf:"bytes,2,opt,name=handler_name,json=handlerName,proto3" json:"handler_name,omitempty"` + Parameter []byte `protobuf:"bytes,3,opt,name=parameter,proto3" json:"parameter,omitempty"` + Headers []*Header `protobuf:"bytes,4,rep,name=headers,proto3" json:"headers,omitempty"` + // If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise. + Key string `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"` + // Types that are assignable to Result: + // + // *CallEntryMessage_Value + // *CallEntryMessage_Failure + Result isCallEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CallEntryMessage) Reset() { + *x = CallEntryMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_protocol_protocol_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallEntryMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallEntryMessage) ProtoMessage() {} + +func (x *CallEntryMessage) ProtoReflect() protoreflect.Message { + mi := &file_proto_protocol_protocol_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallEntryMessage.ProtoReflect.Descriptor instead. +func (*CallEntryMessage) Descriptor() ([]byte, []int) { + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{17} +} + +func (x *CallEntryMessage) GetServiceName() string { + if x != nil { + return x.ServiceName + } + return "" +} + +func (x *CallEntryMessage) GetHandlerName() string { + if x != nil { + return x.HandlerName + } + return "" +} + +func (x *CallEntryMessage) GetParameter() []byte { + if x != nil { + return x.Parameter + } + return nil +} + +func (x *CallEntryMessage) GetHeaders() []*Header { + if x != nil { + return x.Headers + } + return nil +} + +func (x *CallEntryMessage) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (m *CallEntryMessage) GetResult() isCallEntryMessage_Result { + if m != nil { + return m.Result + } + return nil +} + +func (x *CallEntryMessage) GetValue() []byte { + if x, ok := x.GetResult().(*CallEntryMessage_Value); ok { + return x.Value + } + return nil +} + +func (x *CallEntryMessage) GetFailure() *Failure { + if x, ok := x.GetResult().(*CallEntryMessage_Failure); ok { + return x.Failure + } + return nil +} + +func (x *CallEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type isCallEntryMessage_Result interface { + isCallEntryMessage_Result() +} + +type CallEntryMessage_Value struct { + Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` +} + +type CallEntryMessage_Failure struct { + Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` +} + +func (*CallEntryMessage_Value) isCallEntryMessage_Result() {} + +func (*CallEntryMessage_Failure) isCallEntryMessage_Result() {} + +// Completable: No +// Fallible: Yes +// Type: 0x0C00 + 2 +type OneWayCallEntryMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + HandlerName string `protobuf:"bytes,2,opt,name=handler_name,json=handlerName,proto3" json:"handler_name,omitempty"` + Parameter []byte `protobuf:"bytes,3,opt,name=parameter,proto3" json:"parameter,omitempty"` + // Time when this BackgroundInvoke should be executed. + // The time is set as duration since UNIX Epoch. + // If this value is not set, equal to 0, or past in time, + // the runtime will execute this BackgroundInvoke as soon as possible. + InvokeTime uint64 `protobuf:"varint,4,opt,name=invoke_time,json=invokeTime,proto3" json:"invoke_time,omitempty"` + Headers []*Header `protobuf:"bytes,5,rep,name=headers,proto3" json:"headers,omitempty"` + // If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise. + Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *OneWayCallEntryMessage) Reset() { + *x = OneWayCallEntryMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_protocol_protocol_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OneWayCallEntryMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OneWayCallEntryMessage) ProtoMessage() {} + +func (x *OneWayCallEntryMessage) ProtoReflect() protoreflect.Message { + mi := &file_proto_protocol_protocol_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OneWayCallEntryMessage.ProtoReflect.Descriptor instead. +func (*OneWayCallEntryMessage) Descriptor() ([]byte, []int) { + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{18} +} + +func (x *OneWayCallEntryMessage) GetServiceName() string { + if x != nil { + return x.ServiceName + } + return "" +} + +func (x *OneWayCallEntryMessage) GetHandlerName() string { + if x != nil { + return x.HandlerName + } + return "" +} + +func (x *OneWayCallEntryMessage) GetParameter() []byte { + if x != nil { + return x.Parameter + } + return nil +} + +func (x *OneWayCallEntryMessage) GetInvokeTime() uint64 { + if x != nil { + return x.InvokeTime + } + return 0 +} + +func (x *OneWayCallEntryMessage) GetHeaders() []*Header { + if x != nil { + return x.Headers + } + return nil +} + +func (x *OneWayCallEntryMessage) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *OneWayCallEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Completable: Yes +// Fallible: No +// Type: 0x0C00 + 3 +// Awakeables are addressed by an identifier exposed to the user. See the spec for more details. +type AwakeableEntryMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Result: + // + // *AwakeableEntryMessage_Value + // *AwakeableEntryMessage_Failure + Result isAwakeableEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *AwakeableEntryMessage) Reset() { + *x = AwakeableEntryMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_protocol_protocol_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AwakeableEntryMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AwakeableEntryMessage) ProtoMessage() {} + +func (x *AwakeableEntryMessage) ProtoReflect() protoreflect.Message { + mi := &file_proto_protocol_protocol_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AwakeableEntryMessage.ProtoReflect.Descriptor instead. +func (*AwakeableEntryMessage) Descriptor() ([]byte, []int) { + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{19} +} + +func (m *AwakeableEntryMessage) GetResult() isAwakeableEntryMessage_Result { + if m != nil { + return m.Result + } + return nil } func (x *AwakeableEntryMessage) GetValue() []byte { @@ -1292,59 +1831,169 @@ func (x *AwakeableEntryMessage) GetFailure() *Failure { if x, ok := x.GetResult().(*AwakeableEntryMessage_Failure); ok { return x.Failure } - return nil + return nil +} + +func (x *AwakeableEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type isAwakeableEntryMessage_Result interface { + isAwakeableEntryMessage_Result() +} + +type AwakeableEntryMessage_Value struct { + Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` +} + +type AwakeableEntryMessage_Failure struct { + Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` +} + +func (*AwakeableEntryMessage_Value) isAwakeableEntryMessage_Result() {} + +func (*AwakeableEntryMessage_Failure) isAwakeableEntryMessage_Result() {} + +// Completable: No +// Fallible: Yes +// Type: 0x0C00 + 4 +type CompleteAwakeableEntryMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the awakeable. See the spec for more details. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Types that are assignable to Result: + // + // *CompleteAwakeableEntryMessage_Value + // *CompleteAwakeableEntryMessage_Failure + Result isCompleteAwakeableEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CompleteAwakeableEntryMessage) Reset() { + *x = CompleteAwakeableEntryMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_protocol_protocol_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompleteAwakeableEntryMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompleteAwakeableEntryMessage) ProtoMessage() {} + +func (x *CompleteAwakeableEntryMessage) ProtoReflect() protoreflect.Message { + mi := &file_proto_protocol_protocol_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompleteAwakeableEntryMessage.ProtoReflect.Descriptor instead. +func (*CompleteAwakeableEntryMessage) Descriptor() ([]byte, []int) { + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{20} +} + +func (x *CompleteAwakeableEntryMessage) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (m *CompleteAwakeableEntryMessage) GetResult() isCompleteAwakeableEntryMessage_Result { + if m != nil { + return m.Result + } + return nil +} + +func (x *CompleteAwakeableEntryMessage) GetValue() []byte { + if x, ok := x.GetResult().(*CompleteAwakeableEntryMessage_Value); ok { + return x.Value + } + return nil +} + +func (x *CompleteAwakeableEntryMessage) GetFailure() *Failure { + if x, ok := x.GetResult().(*CompleteAwakeableEntryMessage_Failure); ok { + return x.Failure + } + return nil +} + +func (x *CompleteAwakeableEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" } -type isAwakeableEntryMessage_Result interface { - isAwakeableEntryMessage_Result() +type isCompleteAwakeableEntryMessage_Result interface { + isCompleteAwakeableEntryMessage_Result() } -type AwakeableEntryMessage_Value struct { +type CompleteAwakeableEntryMessage_Value struct { Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` } -type AwakeableEntryMessage_Failure struct { +type CompleteAwakeableEntryMessage_Failure struct { Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` } -func (*AwakeableEntryMessage_Value) isAwakeableEntryMessage_Result() {} +func (*CompleteAwakeableEntryMessage_Value) isCompleteAwakeableEntryMessage_Result() {} -func (*AwakeableEntryMessage_Failure) isAwakeableEntryMessage_Result() {} +func (*CompleteAwakeableEntryMessage_Failure) isCompleteAwakeableEntryMessage_Result() {} // Completable: No -// Fallible: Yes -// Type: 0x0C00 + 4 -type CompleteAwakeableEntryMessage struct { +// Fallible: No +// Type: 0x0C00 + 5 +// Flag: RequiresRuntimeAck +type RunEntryMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Identifier of the awakeable. See the spec for more details. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Result: // - // *CompleteAwakeableEntryMessage_Value - // *CompleteAwakeableEntryMessage_Failure - Result isCompleteAwakeableEntryMessage_Result `protobuf_oneof:"result"` + // *RunEntryMessage_Value + // *RunEntryMessage_Failure + Result isRunEntryMessage_Result `protobuf_oneof:"result"` + // Entry name + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` } -func (x *CompleteAwakeableEntryMessage) Reset() { - *x = CompleteAwakeableEntryMessage{} +func (x *RunEntryMessage) Reset() { + *x = RunEntryMessage{} if protoimpl.UnsafeEnabled { - mi := &file_proto_protocol_protocol_proto_msgTypes[17] + mi := &file_proto_protocol_protocol_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CompleteAwakeableEntryMessage) String() string { +func (x *RunEntryMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CompleteAwakeableEntryMessage) ProtoMessage() {} +func (*RunEntryMessage) ProtoMessage() {} -func (x *CompleteAwakeableEntryMessage) ProtoReflect() protoreflect.Message { - mi := &file_proto_protocol_protocol_proto_msgTypes[17] +func (x *RunEntryMessage) ProtoReflect() protoreflect.Message { + mi := &file_proto_protocol_protocol_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1355,68 +2004,63 @@ func (x *CompleteAwakeableEntryMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CompleteAwakeableEntryMessage.ProtoReflect.Descriptor instead. -func (*CompleteAwakeableEntryMessage) Descriptor() ([]byte, []int) { - return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{17} -} - -func (x *CompleteAwakeableEntryMessage) GetId() string { - if x != nil { - return x.Id - } - return "" +// Deprecated: Use RunEntryMessage.ProtoReflect.Descriptor instead. +func (*RunEntryMessage) Descriptor() ([]byte, []int) { + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{21} } -func (m *CompleteAwakeableEntryMessage) GetResult() isCompleteAwakeableEntryMessage_Result { +func (m *RunEntryMessage) GetResult() isRunEntryMessage_Result { if m != nil { return m.Result } return nil } -func (x *CompleteAwakeableEntryMessage) GetValue() []byte { - if x, ok := x.GetResult().(*CompleteAwakeableEntryMessage_Value); ok { +func (x *RunEntryMessage) GetValue() []byte { + if x, ok := x.GetResult().(*RunEntryMessage_Value); ok { return x.Value } return nil } -func (x *CompleteAwakeableEntryMessage) GetFailure() *Failure { - if x, ok := x.GetResult().(*CompleteAwakeableEntryMessage_Failure); ok { +func (x *RunEntryMessage) GetFailure() *Failure { + if x, ok := x.GetResult().(*RunEntryMessage_Failure); ok { return x.Failure } return nil } -type isCompleteAwakeableEntryMessage_Result interface { - isCompleteAwakeableEntryMessage_Result() +func (x *RunEntryMessage) GetName() string { + if x != nil { + return x.Name + } + return "" } -type CompleteAwakeableEntryMessage_Value struct { - Value []byte `protobuf:"bytes,5,opt,name=value,proto3,oneof"` +type isRunEntryMessage_Result interface { + isRunEntryMessage_Result() } -type CompleteAwakeableEntryMessage_Failure struct { - Failure *Failure `protobuf:"bytes,6,opt,name=failure,proto3,oneof"` +type RunEntryMessage_Value struct { + Value []byte `protobuf:"bytes,14,opt,name=value,proto3,oneof"` } -func (*CompleteAwakeableEntryMessage_Value) isCompleteAwakeableEntryMessage_Result() {} +type RunEntryMessage_Failure struct { + Failure *Failure `protobuf:"bytes,15,opt,name=failure,proto3,oneof"` +} -func (*CompleteAwakeableEntryMessage_Failure) isCompleteAwakeableEntryMessage_Result() {} +func (*RunEntryMessage_Value) isRunEntryMessage_Result() {} + +func (*RunEntryMessage_Failure) isRunEntryMessage_Result() {} // This failure object carries user visible errors, -// e.g. invocation failure return value or failure result of an -// InvokeEntryMessage. +// e.g. invocation failure return value or failure result of an InvokeEntryMessage. type Failure struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The code should be any of the gRPC error codes, - // as defined here: - // https://github.com/grpc/grpc/blob/master/doc/statuscodes.md#status-codes-and-their-use-in-grpc - // - // If code > 16, the runtime will interpret it as code 2 (UNKNOWN). + // The code can be any HTTP status code, as described https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml. Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // Contains a concise error message, e.g. Throwable#getMessage() in Java. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` @@ -1425,7 +2069,7 @@ type Failure struct { func (x *Failure) Reset() { *x = Failure{} if protoimpl.UnsafeEnabled { - mi := &file_proto_protocol_protocol_proto_msgTypes[18] + mi := &file_proto_protocol_protocol_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1438,7 +2082,7 @@ func (x *Failure) String() string { func (*Failure) ProtoMessage() {} func (x *Failure) ProtoReflect() protoreflect.Message { - mi := &file_proto_protocol_protocol_proto_msgTypes[18] + mi := &file_proto_protocol_protocol_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1451,7 +2095,7 @@ func (x *Failure) ProtoReflect() protoreflect.Message { // Deprecated: Use Failure.ProtoReflect.Descriptor instead. func (*Failure) Descriptor() ([]byte, []int) { - return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{18} + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{22} } func (x *Failure) GetCode() uint32 { @@ -1468,6 +2112,99 @@ func (x *Failure) GetMessage() string { return "" } +type Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Header) Reset() { + *x = Header{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_protocol_protocol_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header) ProtoMessage() {} + +func (x *Header) ProtoReflect() protoreflect.Message { + mi := &file_proto_protocol_protocol_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{23} +} + +func (x *Header) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Header) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_protocol_protocol_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_proto_protocol_protocol_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_proto_protocol_protocol_proto_rawDescGZIP(), []int{24} +} + type StartMessage_StateEntry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1482,7 +2219,7 @@ type StartMessage_StateEntry struct { func (x *StartMessage_StateEntry) Reset() { *x = StartMessage_StateEntry{} if protoimpl.UnsafeEnabled { - mi := &file_proto_protocol_protocol_proto_msgTypes[19] + mi := &file_proto_protocol_protocol_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1495,7 +2232,7 @@ func (x *StartMessage_StateEntry) String() string { func (*StartMessage_StateEntry) ProtoMessage() {} func (x *StartMessage_StateEntry) ProtoReflect() protoreflect.Message { - mi := &file_proto_protocol_protocol_proto_msgTypes[19] + mi := &file_proto_protocol_protocol_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1536,7 +2273,7 @@ type GetStateKeysEntryMessage_StateKeys struct { func (x *GetStateKeysEntryMessage_StateKeys) Reset() { *x = GetStateKeysEntryMessage_StateKeys{} if protoimpl.UnsafeEnabled { - mi := &file_proto_protocol_protocol_proto_msgTypes[20] + mi := &file_proto_protocol_protocol_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1549,7 +2286,7 @@ func (x *GetStateKeysEntryMessage_StateKeys) String() string { func (*GetStateKeysEntryMessage_StateKeys) ProtoMessage() {} func (x *GetStateKeysEntryMessage_StateKeys) ProtoReflect() protoreflect.Message { - mi := &file_proto_protocol_protocol_proto_msgTypes[20] + mi := &file_proto_protocol_protocol_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1578,177 +2315,280 @@ var file_proto_protocol_protocol_proto_rawDesc = []byte{ 0x0a, 0x1d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x1a, 0x1b, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, - 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x02, 0x0a, 0x0c, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x64, - 0x65, 0x62, 0x75, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, - 0x65, 0x62, 0x75, 0x67, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, - 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6b, - 0x6e, 0x6f, 0x77, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x09, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x70, 0x12, - 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x1a, 0x34, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc9, 0x01, 0x0a, 0x11, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x2e, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x9f, 0x02, + 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, + 0x0a, 0x08, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x64, 0x65, 0x62, 0x75, 0x67, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6b, 0x6e, 0x6f, + 0x77, 0x6e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x52, + 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x35, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x65, 0x4d, + 0x61, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x34, 0x0a, 0x0a, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0xd6, 0x01, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x72, + 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, + 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, + 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x42, 0x08, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x38, 0x0a, 0x11, 0x53, 0x75, 0x73, 0x70, + 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x65, 0x73, 0x22, 0xbf, 0x02, 0x0a, 0x0c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x65, + 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x12, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x10, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x12, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x02, 0x52, 0x10, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, 0x16, + 0x0a, 0x14, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x15, 0x0a, + 0x13, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x22, 0x32, 0x0a, 0x0f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x41, 0x63, 0x6b, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, + 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x6e, + 0x74, 0x72, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x0c, 0x0a, 0x0a, 0x45, 0x6e, 0x64, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x7d, 0x0a, 0x11, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8d, 0x01, 0x0a, 0x12, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, + 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xde, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x16, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, + 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x52, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3e, 0x0a, 0x16, 0x43, 0x6c, + 0x65, 0x61, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x19, 0x43, 0x6c, + 0x65, 0x61, 0x72, 0x41, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x18, + 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x58, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4b, + 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, + 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x1a, 0x1f, 0x0a, 0x09, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa3, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6d, + 0x69, 0x73, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, - 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x42, 0x08, 0x0a, 0x06, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x38, 0x0a, 0x11, 0x53, 0x75, 0x73, 0x70, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, - 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, - 0x22, 0x5e, 0x0a, 0x0c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x32, 0x0a, 0x0f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x41, 0x63, 0x6b, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x22, 0x0c, 0x0a, 0x0a, 0x45, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x1b, 0x50, 0x6f, 0x6c, 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x17, 0x50, + 0x65, 0x65, 0x6b, 0x50, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, + 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x05, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, + 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, + 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe0, + 0x02, 0x0a, 0x1b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6d, 0x69, + 0x73, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x2b, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x56, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, + 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, + 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, + 0x48, 0x00, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, + 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x01, 0x52, 0x07, 0x66, 0x61, + 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x22, 0xd3, 0x01, 0x0a, 0x11, 0x53, 0x6c, 0x65, 0x65, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x77, 0x61, 0x6b, 0x65, 0x5f, + 0x75, 0x70, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x77, + 0x61, 0x6b, 0x65, 0x55, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, + 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, + 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, + 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xc1, 0x02, 0x0a, 0x10, 0x43, 0x61, 0x6c, 0x6c, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x12, 0x3e, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, - 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x42, 0x08, 0x0a, - 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x7f, 0x0a, 0x18, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, - 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, + 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x83, 0x02, 0x0a, 0x16, + 0x4f, 0x6e, 0x65, 0x57, 0x61, 0x79, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, + 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0a, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, - 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x42, 0x08, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xbd, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, - 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, - 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, - 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x42, 0x08, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3e, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2a, 0x0a, 0x16, 0x43, 0x6c, 0x65, 0x61, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x6c, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0xe2, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4b, 0x65, - 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x58, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x48, - 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, - 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, - 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, - 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x1a, 0x1f, 0x0a, 0x09, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x42, 0x08, 0x0a, 0x06, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xb2, 0x01, 0x0a, 0x11, 0x53, 0x6c, 0x65, 0x65, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0c, - 0x77, 0x61, 0x6b, 0x65, 0x5f, 0x75, 0x70, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0a, 0x77, 0x61, 0x6b, 0x65, 0x55, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2e, - 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x41, - 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, - 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, - 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xdb, 0x01, 0x0a, 0x12, - 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, - 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, - 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x42, - 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa1, 0x01, 0x0a, 0x1c, 0x42, 0x61, - 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, - 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x7c, 0x0a, - 0x15, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x90, 0x01, 0x0a, 0x15, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, + 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa8, 0x01, 0x0a, 0x1d, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, - 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x94, 0x01, 0x0a, 0x1d, - 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x61, 0x62, 0x6c, - 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, - 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x22, 0x37, 0x0a, 0x07, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x85, 0x02, 0x0a, 0x20, - 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x42, 0x0d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x75, - 0x68, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x7a, 0x6d, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0xa2, 0x02, 0x04, 0x44, 0x52, 0x53, 0x50, 0xaa, 0x02, 0x1c, 0x44, 0x65, 0x76, 0x2e, 0x52, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xca, 0x02, 0x1c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xe2, 0x02, 0x28, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x1f, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0x8a, 0x01, 0x0a, 0x0f, 0x52, 0x75, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x66, + 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, + 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x37, 0x0a, 0x07, + 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x30, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x2a, 0x4a, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x24, 0x53, 0x45, + 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x56, + 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x56, 0x31, 0x10, 0x01, 0x42, 0xfc, 0x01, 0x0a, + 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x42, 0x0d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x64, 0x65, 0x76, 0x2f, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xa2, 0x02, 0x04, 0x44, 0x52, 0x53, 0x50, + 0xaa, 0x02, 0x1c, 0x44, 0x65, 0x76, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xca, + 0x02, 0x1c, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xe2, 0x02, + 0x28, 0x44, 0x65, 0x76, 0x5c, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1f, 0x44, 0x65, 0x76, 0x3a, + 0x3a, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1763,51 +2603,67 @@ func file_proto_protocol_protocol_proto_rawDescGZIP() []byte { return file_proto_protocol_protocol_proto_rawDescData } -var file_proto_protocol_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_proto_protocol_protocol_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_proto_protocol_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_proto_protocol_protocol_proto_goTypes = []interface{}{ - (*StartMessage)(nil), // 0: dev.restate.service.protocol.StartMessage - (*CompletionMessage)(nil), // 1: dev.restate.service.protocol.CompletionMessage - (*SuspensionMessage)(nil), // 2: dev.restate.service.protocol.SuspensionMessage - (*ErrorMessage)(nil), // 3: dev.restate.service.protocol.ErrorMessage - (*EntryAckMessage)(nil), // 4: dev.restate.service.protocol.EntryAckMessage - (*EndMessage)(nil), // 5: dev.restate.service.protocol.EndMessage - (*PollInputStreamEntryMessage)(nil), // 6: dev.restate.service.protocol.PollInputStreamEntryMessage - (*OutputStreamEntryMessage)(nil), // 7: dev.restate.service.protocol.OutputStreamEntryMessage - (*GetStateEntryMessage)(nil), // 8: dev.restate.service.protocol.GetStateEntryMessage - (*SetStateEntryMessage)(nil), // 9: dev.restate.service.protocol.SetStateEntryMessage - (*ClearStateEntryMessage)(nil), // 10: dev.restate.service.protocol.ClearStateEntryMessage - (*ClearAllStateEntryMessage)(nil), // 11: dev.restate.service.protocol.ClearAllStateEntryMessage - (*GetStateKeysEntryMessage)(nil), // 12: dev.restate.service.protocol.GetStateKeysEntryMessage - (*SleepEntryMessage)(nil), // 13: dev.restate.service.protocol.SleepEntryMessage - (*InvokeEntryMessage)(nil), // 14: dev.restate.service.protocol.InvokeEntryMessage - (*BackgroundInvokeEntryMessage)(nil), // 15: dev.restate.service.protocol.BackgroundInvokeEntryMessage - (*AwakeableEntryMessage)(nil), // 16: dev.restate.service.protocol.AwakeableEntryMessage - (*CompleteAwakeableEntryMessage)(nil), // 17: dev.restate.service.protocol.CompleteAwakeableEntryMessage - (*Failure)(nil), // 18: dev.restate.service.protocol.Failure - (*StartMessage_StateEntry)(nil), // 19: dev.restate.service.protocol.StartMessage.StateEntry - (*GetStateKeysEntryMessage_StateKeys)(nil), // 20: dev.restate.service.protocol.GetStateKeysEntryMessage.StateKeys - (*emptypb.Empty)(nil), // 21: google.protobuf.Empty + (ServiceProtocolVersion)(0), // 0: dev.restate.service.protocol.ServiceProtocolVersion + (*StartMessage)(nil), // 1: dev.restate.service.protocol.StartMessage + (*CompletionMessage)(nil), // 2: dev.restate.service.protocol.CompletionMessage + (*SuspensionMessage)(nil), // 3: dev.restate.service.protocol.SuspensionMessage + (*ErrorMessage)(nil), // 4: dev.restate.service.protocol.ErrorMessage + (*EntryAckMessage)(nil), // 5: dev.restate.service.protocol.EntryAckMessage + (*EndMessage)(nil), // 6: dev.restate.service.protocol.EndMessage + (*InputEntryMessage)(nil), // 7: dev.restate.service.protocol.InputEntryMessage + (*OutputEntryMessage)(nil), // 8: dev.restate.service.protocol.OutputEntryMessage + (*GetStateEntryMessage)(nil), // 9: dev.restate.service.protocol.GetStateEntryMessage + (*SetStateEntryMessage)(nil), // 10: dev.restate.service.protocol.SetStateEntryMessage + (*ClearStateEntryMessage)(nil), // 11: dev.restate.service.protocol.ClearStateEntryMessage + (*ClearAllStateEntryMessage)(nil), // 12: dev.restate.service.protocol.ClearAllStateEntryMessage + (*GetStateKeysEntryMessage)(nil), // 13: dev.restate.service.protocol.GetStateKeysEntryMessage + (*GetPromiseEntryMessage)(nil), // 14: dev.restate.service.protocol.GetPromiseEntryMessage + (*PeekPromiseEntryMessage)(nil), // 15: dev.restate.service.protocol.PeekPromiseEntryMessage + (*CompletePromiseEntryMessage)(nil), // 16: dev.restate.service.protocol.CompletePromiseEntryMessage + (*SleepEntryMessage)(nil), // 17: dev.restate.service.protocol.SleepEntryMessage + (*CallEntryMessage)(nil), // 18: dev.restate.service.protocol.CallEntryMessage + (*OneWayCallEntryMessage)(nil), // 19: dev.restate.service.protocol.OneWayCallEntryMessage + (*AwakeableEntryMessage)(nil), // 20: dev.restate.service.protocol.AwakeableEntryMessage + (*CompleteAwakeableEntryMessage)(nil), // 21: dev.restate.service.protocol.CompleteAwakeableEntryMessage + (*RunEntryMessage)(nil), // 22: dev.restate.service.protocol.RunEntryMessage + (*Failure)(nil), // 23: dev.restate.service.protocol.Failure + (*Header)(nil), // 24: dev.restate.service.protocol.Header + (*Empty)(nil), // 25: dev.restate.service.protocol.Empty + (*StartMessage_StateEntry)(nil), // 26: dev.restate.service.protocol.StartMessage.StateEntry + (*GetStateKeysEntryMessage_StateKeys)(nil), // 27: dev.restate.service.protocol.GetStateKeysEntryMessage.StateKeys } var file_proto_protocol_protocol_proto_depIdxs = []int32{ - 19, // 0: dev.restate.service.protocol.StartMessage.state_map:type_name -> dev.restate.service.protocol.StartMessage.StateEntry - 21, // 1: dev.restate.service.protocol.CompletionMessage.empty:type_name -> google.protobuf.Empty - 18, // 2: dev.restate.service.protocol.CompletionMessage.failure:type_name -> dev.restate.service.protocol.Failure - 18, // 3: dev.restate.service.protocol.PollInputStreamEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure - 18, // 4: dev.restate.service.protocol.OutputStreamEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure - 21, // 5: dev.restate.service.protocol.GetStateEntryMessage.empty:type_name -> google.protobuf.Empty - 18, // 6: dev.restate.service.protocol.GetStateEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure - 20, // 7: dev.restate.service.protocol.GetStateKeysEntryMessage.value:type_name -> dev.restate.service.protocol.GetStateKeysEntryMessage.StateKeys - 18, // 8: dev.restate.service.protocol.GetStateKeysEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure - 21, // 9: dev.restate.service.protocol.SleepEntryMessage.empty:type_name -> google.protobuf.Empty - 18, // 10: dev.restate.service.protocol.SleepEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure - 18, // 11: dev.restate.service.protocol.InvokeEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure - 18, // 12: dev.restate.service.protocol.AwakeableEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure - 18, // 13: dev.restate.service.protocol.CompleteAwakeableEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 26, // 0: dev.restate.service.protocol.StartMessage.state_map:type_name -> dev.restate.service.protocol.StartMessage.StateEntry + 25, // 1: dev.restate.service.protocol.CompletionMessage.empty:type_name -> dev.restate.service.protocol.Empty + 23, // 2: dev.restate.service.protocol.CompletionMessage.failure:type_name -> dev.restate.service.protocol.Failure + 24, // 3: dev.restate.service.protocol.InputEntryMessage.headers:type_name -> dev.restate.service.protocol.Header + 23, // 4: dev.restate.service.protocol.OutputEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 25, // 5: dev.restate.service.protocol.GetStateEntryMessage.empty:type_name -> dev.restate.service.protocol.Empty + 23, // 6: dev.restate.service.protocol.GetStateEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 27, // 7: dev.restate.service.protocol.GetStateKeysEntryMessage.value:type_name -> dev.restate.service.protocol.GetStateKeysEntryMessage.StateKeys + 23, // 8: dev.restate.service.protocol.GetStateKeysEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 23, // 9: dev.restate.service.protocol.GetPromiseEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 25, // 10: dev.restate.service.protocol.PeekPromiseEntryMessage.empty:type_name -> dev.restate.service.protocol.Empty + 23, // 11: dev.restate.service.protocol.PeekPromiseEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 23, // 12: dev.restate.service.protocol.CompletePromiseEntryMessage.completion_failure:type_name -> dev.restate.service.protocol.Failure + 25, // 13: dev.restate.service.protocol.CompletePromiseEntryMessage.empty:type_name -> dev.restate.service.protocol.Empty + 23, // 14: dev.restate.service.protocol.CompletePromiseEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 25, // 15: dev.restate.service.protocol.SleepEntryMessage.empty:type_name -> dev.restate.service.protocol.Empty + 23, // 16: dev.restate.service.protocol.SleepEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 24, // 17: dev.restate.service.protocol.CallEntryMessage.headers:type_name -> dev.restate.service.protocol.Header + 23, // 18: dev.restate.service.protocol.CallEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 24, // 19: dev.restate.service.protocol.OneWayCallEntryMessage.headers:type_name -> dev.restate.service.protocol.Header + 23, // 20: dev.restate.service.protocol.AwakeableEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 23, // 21: dev.restate.service.protocol.CompleteAwakeableEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 23, // 22: dev.restate.service.protocol.RunEntryMessage.failure:type_name -> dev.restate.service.protocol.Failure + 23, // [23:23] is the sub-list for method output_type + 23, // [23:23] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name } func init() { file_proto_protocol_protocol_proto_init() } @@ -1889,7 +2745,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollInputStreamEntryMessage); i { + switch v := v.(*InputEntryMessage); i { case 0: return &v.state case 1: @@ -1901,7 +2757,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OutputStreamEntryMessage); i { + switch v := v.(*OutputEntryMessage); i { case 0: return &v.state case 1: @@ -1973,7 +2829,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SleepEntryMessage); i { + switch v := v.(*GetPromiseEntryMessage); i { case 0: return &v.state case 1: @@ -1985,7 +2841,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeEntryMessage); i { + switch v := v.(*PeekPromiseEntryMessage); i { case 0: return &v.state case 1: @@ -1997,7 +2853,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackgroundInvokeEntryMessage); i { + switch v := v.(*CompletePromiseEntryMessage); i { case 0: return &v.state case 1: @@ -2009,7 +2865,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AwakeableEntryMessage); i { + switch v := v.(*SleepEntryMessage); i { case 0: return &v.state case 1: @@ -2021,7 +2877,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CompleteAwakeableEntryMessage); i { + switch v := v.(*CallEntryMessage); i { case 0: return &v.state case 1: @@ -2033,7 +2889,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Failure); i { + switch v := v.(*OneWayCallEntryMessage); i { case 0: return &v.state case 1: @@ -2045,7 +2901,7 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartMessage_StateEntry); i { + switch v := v.(*AwakeableEntryMessage); i { case 0: return &v.state case 1: @@ -2057,6 +2913,78 @@ func file_proto_protocol_protocol_proto_init() { } } file_proto_protocol_protocol_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompleteAwakeableEntryMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_protocol_protocol_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunEntryMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_protocol_protocol_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Failure); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_protocol_protocol_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_protocol_protocol_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_protocol_protocol_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartMessage_StateEntry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_protocol_protocol_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStateKeysEntryMessage_StateKeys); i { case 0: return &v.state @@ -2074,13 +3002,10 @@ func file_proto_protocol_protocol_proto_init() { (*CompletionMessage_Value)(nil), (*CompletionMessage_Failure)(nil), } - file_proto_protocol_protocol_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*PollInputStreamEntryMessage_Value)(nil), - (*PollInputStreamEntryMessage_Failure)(nil), - } + file_proto_protocol_protocol_proto_msgTypes[3].OneofWrappers = []interface{}{} file_proto_protocol_protocol_proto_msgTypes[7].OneofWrappers = []interface{}{ - (*OutputStreamEntryMessage_Value)(nil), - (*OutputStreamEntryMessage_Failure)(nil), + (*OutputEntryMessage_Value)(nil), + (*OutputEntryMessage_Failure)(nil), } file_proto_protocol_protocol_proto_msgTypes[8].OneofWrappers = []interface{}{ (*GetStateEntryMessage_Empty)(nil), @@ -2092,33 +3017,53 @@ func file_proto_protocol_protocol_proto_init() { (*GetStateKeysEntryMessage_Failure)(nil), } file_proto_protocol_protocol_proto_msgTypes[13].OneofWrappers = []interface{}{ - (*SleepEntryMessage_Empty)(nil), - (*SleepEntryMessage_Failure)(nil), + (*GetPromiseEntryMessage_Value)(nil), + (*GetPromiseEntryMessage_Failure)(nil), } file_proto_protocol_protocol_proto_msgTypes[14].OneofWrappers = []interface{}{ - (*InvokeEntryMessage_Value)(nil), - (*InvokeEntryMessage_Failure)(nil), + (*PeekPromiseEntryMessage_Empty)(nil), + (*PeekPromiseEntryMessage_Value)(nil), + (*PeekPromiseEntryMessage_Failure)(nil), + } + file_proto_protocol_protocol_proto_msgTypes[15].OneofWrappers = []interface{}{ + (*CompletePromiseEntryMessage_CompletionValue)(nil), + (*CompletePromiseEntryMessage_CompletionFailure)(nil), + (*CompletePromiseEntryMessage_Empty)(nil), + (*CompletePromiseEntryMessage_Failure)(nil), } file_proto_protocol_protocol_proto_msgTypes[16].OneofWrappers = []interface{}{ + (*SleepEntryMessage_Empty)(nil), + (*SleepEntryMessage_Failure)(nil), + } + file_proto_protocol_protocol_proto_msgTypes[17].OneofWrappers = []interface{}{ + (*CallEntryMessage_Value)(nil), + (*CallEntryMessage_Failure)(nil), + } + file_proto_protocol_protocol_proto_msgTypes[19].OneofWrappers = []interface{}{ (*AwakeableEntryMessage_Value)(nil), (*AwakeableEntryMessage_Failure)(nil), } - file_proto_protocol_protocol_proto_msgTypes[17].OneofWrappers = []interface{}{ + file_proto_protocol_protocol_proto_msgTypes[20].OneofWrappers = []interface{}{ (*CompleteAwakeableEntryMessage_Value)(nil), (*CompleteAwakeableEntryMessage_Failure)(nil), } + file_proto_protocol_protocol_proto_msgTypes[21].OneofWrappers = []interface{}{ + (*RunEntryMessage_Value)(nil), + (*RunEntryMessage_Failure)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_protocol_protocol_proto_rawDesc, - NumEnums: 0, - NumMessages: 21, + NumEnums: 1, + NumMessages: 27, NumExtensions: 0, NumServices: 0, }, GoTypes: file_proto_protocol_protocol_proto_goTypes, DependencyIndexes: file_proto_protocol_protocol_proto_depIdxs, + EnumInfos: file_proto_protocol_protocol_proto_enumTypes, MessageInfos: file_proto_protocol_protocol_proto_msgTypes, }.Build() File_proto_protocol_protocol_proto = out.File diff --git a/generated/proto/services/services.pb.go b/generated/proto/services/services.pb.go deleted file mode 100644 index f3ceaf3..0000000 --- a/generated/proto/services/services.pb.go +++ /dev/null @@ -1,1151 +0,0 @@ -// Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH -// -// This file is part of the Restate service protocol, which is -// released under the MIT license. -// -// You can find a copy of the license in file LICENSE in the root -// directory of this repository or package, or at -// https://github.com/restatedev/proto/blob/main/LICENSE - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: proto/services/services.proto - -// -//This package contains internal service interfaces - -package services - -import ( - _ "github.com/restatedev/sdk-go/generated/dev/restate" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - _ "google.golang.org/protobuf/types/known/structpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type StartRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // User provided operation id, this is used as idempotency key. - OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` - // Stream id to uniquely identify a open stream between client and Restate. - // There can be at most one open stream at the same time. - StreamId string `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - // Retention period for the response in seconds. - // After the invocation completes, the response will be persisted for the - // given duration. Afterwards, the system will cleanup the response and treats - // any subsequent invocation with same operation_id as new. - // - // If not set, 30 minutes will be used as retention period. - RetentionPeriodSec uint32 `protobuf:"varint,3,opt,name=retention_period_sec,json=retentionPeriodSec,proto3" json:"retention_period_sec,omitempty"` - // Argument of the invocation - Argument []byte `protobuf:"bytes,4,opt,name=argument,proto3" json:"argument,omitempty"` -} - -func (x *StartRequest) Reset() { - *x = StartRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartRequest) ProtoMessage() {} - -func (x *StartRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartRequest.ProtoReflect.Descriptor instead. -func (*StartRequest) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{0} -} - -func (x *StartRequest) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -func (x *StartRequest) GetStreamId() string { - if x != nil { - return x.StreamId - } - return "" -} - -func (x *StartRequest) GetRetentionPeriodSec() uint32 { - if x != nil { - return x.RetentionPeriodSec - } - return 0 -} - -func (x *StartRequest) GetArgument() []byte { - if x != nil { - return x.Argument - } - return nil -} - -type StartResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to InvocationStatus: - // - // *StartResponse_Executing - // *StartResponse_Completed - InvocationStatus isStartResponse_InvocationStatus `protobuf_oneof:"invocation_status"` -} - -func (x *StartResponse) Reset() { - *x = StartResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartResponse) ProtoMessage() {} - -func (x *StartResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartResponse.ProtoReflect.Descriptor instead. -func (*StartResponse) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{1} -} - -func (m *StartResponse) GetInvocationStatus() isStartResponse_InvocationStatus { - if m != nil { - return m.InvocationStatus - } - return nil -} - -func (x *StartResponse) GetExecuting() []byte { - if x, ok := x.GetInvocationStatus().(*StartResponse_Executing); ok { - return x.Executing - } - return nil -} - -func (x *StartResponse) GetCompleted() *GetResultResponse { - if x, ok := x.GetInvocationStatus().(*StartResponse_Completed); ok { - return x.Completed - } - return nil -} - -type isStartResponse_InvocationStatus interface { - isStartResponse_InvocationStatus() -} - -type StartResponse_Executing struct { - // Contains the concatenated first messages of the stream, encoded using the - // same framing used by service-protocol - Executing []byte `protobuf:"bytes,1,opt,name=executing,proto3,oneof"` -} - -type StartResponse_Completed struct { - // Contains the result of the invocation - Completed *GetResultResponse `protobuf:"bytes,2,opt,name=completed,proto3,oneof"` -} - -func (*StartResponse_Executing) isStartResponse_InvocationStatus() {} - -func (*StartResponse_Completed) isStartResponse_InvocationStatus() {} - -type SendRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // User provided operation id, this is used as idempotency key. - OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` - // Stream id to uniquely identify a open stream between client and Restate. - // There can be at most one open stream at the same time. - StreamId string `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - // Contains the concatenated messages of the stream, encoded using the same - // framing used by service-protocol - Messages []byte `protobuf:"bytes,3,opt,name=messages,proto3" json:"messages,omitempty"` -} - -func (x *SendRequest) Reset() { - *x = SendRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendRequest) ProtoMessage() {} - -func (x *SendRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendRequest.ProtoReflect.Descriptor instead. -func (*SendRequest) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{2} -} - -func (x *SendRequest) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -func (x *SendRequest) GetStreamId() string { - if x != nil { - return x.StreamId - } - return "" -} - -func (x *SendRequest) GetMessages() []byte { - if x != nil { - return x.Messages - } - return nil -} - -type SendResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Response: - // - // *SendResponse_Ok - // *SendResponse_InvalidStream - // *SendResponse_InvocationCompleted - Response isSendResponse_Response `protobuf_oneof:"response"` -} - -func (x *SendResponse) Reset() { - *x = SendResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendResponse) ProtoMessage() {} - -func (x *SendResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendResponse.ProtoReflect.Descriptor instead. -func (*SendResponse) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{3} -} - -func (m *SendResponse) GetResponse() isSendResponse_Response { - if m != nil { - return m.Response - } - return nil -} - -func (x *SendResponse) GetOk() *emptypb.Empty { - if x, ok := x.GetResponse().(*SendResponse_Ok); ok { - return x.Ok - } - return nil -} - -func (x *SendResponse) GetInvalidStream() *emptypb.Empty { - if x, ok := x.GetResponse().(*SendResponse_InvalidStream); ok { - return x.InvalidStream - } - return nil -} - -func (x *SendResponse) GetInvocationCompleted() *emptypb.Empty { - if x, ok := x.GetResponse().(*SendResponse_InvocationCompleted); ok { - return x.InvocationCompleted - } - return nil -} - -type isSendResponse_Response interface { - isSendResponse_Response() -} - -type SendResponse_Ok struct { - Ok *emptypb.Empty `protobuf:"bytes,1,opt,name=ok,proto3,oneof"` -} - -type SendResponse_InvalidStream struct { - // This means the provided stream_id is invalid, and it should not be - // reused, nor the client should create a new stream using Start(). The - // client can instead read the invocation result using GetResult(). - InvalidStream *emptypb.Empty `protobuf:"bytes,2,opt,name=invalid_stream,json=invalidStream,proto3,oneof"` -} - -type SendResponse_InvocationCompleted struct { - // This means the invocation is completed, and the result should be - // collected using GetResult - InvocationCompleted *emptypb.Empty `protobuf:"bytes,3,opt,name=invocation_completed,json=invocationCompleted,proto3,oneof"` -} - -func (*SendResponse_Ok) isSendResponse_Response() {} - -func (*SendResponse_InvalidStream) isSendResponse_Response() {} - -func (*SendResponse_InvocationCompleted) isSendResponse_Response() {} - -type RecvRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // User provided operation id, this is used as idempotency key. - OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` - // Stream id to uniquely identify a open stream between client and Restate. - // There can be at most one open stream at the same time. - StreamId string `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` -} - -func (x *RecvRequest) Reset() { - *x = RecvRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecvRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecvRequest) ProtoMessage() {} - -func (x *RecvRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecvRequest.ProtoReflect.Descriptor instead. -func (*RecvRequest) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{4} -} - -func (x *RecvRequest) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -func (x *RecvRequest) GetStreamId() string { - if x != nil { - return x.StreamId - } - return "" -} - -type RecvResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Response: - // - // *RecvResponse_Messages - // *RecvResponse_InvalidStream - // *RecvResponse_InvocationCompleted - Response isRecvResponse_Response `protobuf_oneof:"response"` -} - -func (x *RecvResponse) Reset() { - *x = RecvResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecvResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecvResponse) ProtoMessage() {} - -func (x *RecvResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecvResponse.ProtoReflect.Descriptor instead. -func (*RecvResponse) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{5} -} - -func (m *RecvResponse) GetResponse() isRecvResponse_Response { - if m != nil { - return m.Response - } - return nil -} - -func (x *RecvResponse) GetMessages() []byte { - if x, ok := x.GetResponse().(*RecvResponse_Messages); ok { - return x.Messages - } - return nil -} - -func (x *RecvResponse) GetInvalidStream() *emptypb.Empty { - if x, ok := x.GetResponse().(*RecvResponse_InvalidStream); ok { - return x.InvalidStream - } - return nil -} - -func (x *RecvResponse) GetInvocationCompleted() *emptypb.Empty { - if x, ok := x.GetResponse().(*RecvResponse_InvocationCompleted); ok { - return x.InvocationCompleted - } - return nil -} - -type isRecvResponse_Response interface { - isRecvResponse_Response() -} - -type RecvResponse_Messages struct { - // Contains the concatenated messages of the stream, encoded using the same - // framing used by service-protocol - Messages []byte `protobuf:"bytes,1,opt,name=messages,proto3,oneof"` -} - -type RecvResponse_InvalidStream struct { - // This means the provided stream_id is invalid, and it should not be - // reused, nor the client should create a new stream using Start(). The - // client can instead read the invocation result using GetResult(). - InvalidStream *emptypb.Empty `protobuf:"bytes,2,opt,name=invalid_stream,json=invalidStream,proto3,oneof"` -} - -type RecvResponse_InvocationCompleted struct { - // This means the invocation is completed, and the result should be - // collected using GetResult - InvocationCompleted *emptypb.Empty `protobuf:"bytes,3,opt,name=invocation_completed,json=invocationCompleted,proto3,oneof"` -} - -func (*RecvResponse_Messages) isRecvResponse_Response() {} - -func (*RecvResponse_InvalidStream) isRecvResponse_Response() {} - -func (*RecvResponse_InvocationCompleted) isRecvResponse_Response() {} - -type GetResultRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // User provided operation id, this is used as idempotency key. - OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` -} - -func (x *GetResultRequest) Reset() { - *x = GetResultRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResultRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResultRequest) ProtoMessage() {} - -func (x *GetResultRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResultRequest.ProtoReflect.Descriptor instead. -func (*GetResultRequest) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{6} -} - -func (x *GetResultRequest) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -type GetResultResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Response: - // - // *GetResultResponse_None - // *GetResultResponse_Success - // *GetResultResponse_Failure - Response isGetResultResponse_Response `protobuf_oneof:"response"` - // Timestamp of the response expiry time in RFC3339. - // Empty if response = none - ExpiryTime string `protobuf:"bytes,15,opt,name=expiry_time,json=expiryTime,proto3" json:"expiry_time,omitempty"` -} - -func (x *GetResultResponse) Reset() { - *x = GetResultResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResultResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResultResponse) ProtoMessage() {} - -func (x *GetResultResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResultResponse.ProtoReflect.Descriptor instead. -func (*GetResultResponse) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{7} -} - -func (m *GetResultResponse) GetResponse() isGetResultResponse_Response { - if m != nil { - return m.Response - } - return nil -} - -func (x *GetResultResponse) GetNone() *emptypb.Empty { - if x, ok := x.GetResponse().(*GetResultResponse_None); ok { - return x.None - } - return nil -} - -func (x *GetResultResponse) GetSuccess() []byte { - if x, ok := x.GetResponse().(*GetResultResponse_Success); ok { - return x.Success - } - return nil -} - -func (x *GetResultResponse) GetFailure() *GetResultResponse_InvocationFailure { - if x, ok := x.GetResponse().(*GetResultResponse_Failure); ok { - return x.Failure - } - return nil -} - -func (x *GetResultResponse) GetExpiryTime() string { - if x != nil { - return x.ExpiryTime - } - return "" -} - -type isGetResultResponse_Response interface { - isGetResultResponse_Response() -} - -type GetResultResponse_None struct { - // See GetResult documentation - None *emptypb.Empty `protobuf:"bytes,1,opt,name=none,proto3,oneof"` -} - -type GetResultResponse_Success struct { - Success []byte `protobuf:"bytes,2,opt,name=success,proto3,oneof"` -} - -type GetResultResponse_Failure struct { - Failure *GetResultResponse_InvocationFailure `protobuf:"bytes,3,opt,name=failure,proto3,oneof"` -} - -func (*GetResultResponse_None) isGetResultResponse_Response() {} - -func (*GetResultResponse_Success) isGetResultResponse_Response() {} - -func (*GetResultResponse_Failure) isGetResultResponse_Response() {} - -type CleanupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // User provided operation id, this is used as idempotency key. - OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` -} - -func (x *CleanupRequest) Reset() { - *x = CleanupRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CleanupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CleanupRequest) ProtoMessage() {} - -func (x *CleanupRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CleanupRequest.ProtoReflect.Descriptor instead. -func (*CleanupRequest) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{8} -} - -func (x *CleanupRequest) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -type GetResultResponse_InvocationFailure struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *GetResultResponse_InvocationFailure) Reset() { - *x = GetResultResponse_InvocationFailure{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_services_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResultResponse_InvocationFailure) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResultResponse_InvocationFailure) ProtoMessage() {} - -func (x *GetResultResponse_InvocationFailure) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_services_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResultResponse_InvocationFailure.ProtoReflect.Descriptor instead. -func (*GetResultResponse_InvocationFailure) Descriptor() ([]byte, []int) { - return file_proto_services_services_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *GetResultResponse_InvocationFailure) GetCode() uint32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *GetResultResponse_InvocationFailure) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -var File_proto_services_services_proto protoreflect.FileDescriptor - -var file_proto_services_services_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x1c, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x1a, 0x15, 0x64, - 0x65, 0x76, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x65, 0x78, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xa2, 0x01, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x27, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x90, 0x82, 0x19, 0x00, 0x52, 0x0b, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x53, 0x65, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x67, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x61, 0x72, 0x67, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x09, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x4f, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x64, 0x65, 0x76, 0x2e, - 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, - 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x69, 0x6e, 0x76, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x6f, 0x0a, 0x0b, - 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x04, 0x90, 0x82, 0x19, 0x00, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0xd2, 0x01, - 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, - 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x48, 0x00, 0x52, 0x02, 0x6f, 0x6b, 0x12, 0x3f, 0x0a, 0x0e, 0x69, 0x6e, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x4b, 0x0a, 0x14, 0x69, 0x6e, 0x76, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, - 0x00, 0x52, 0x13, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x76, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x90, 0x82, 0x19, 0x00, 0x52, 0x0b, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0xc6, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x63, 0x76, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0e, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x4b, 0x0a, 0x14, 0x69, 0x6e, 0x76, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, - 0x13, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x3b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x90, 0x82, 0x19, 0x00, - 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xac, 0x02, - 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x6f, 0x6e, - 0x65, 0x12, 0x1a, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x5d, 0x0a, - 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, - 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x41, 0x0a, - 0x11, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x75, - 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x0a, 0x0e, - 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, - 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0x90, 0x82, 0x19, 0x00, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x32, 0xf4, 0x03, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x60, 0x0a, 0x05, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x2a, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x04, 0x53, - 0x65, 0x6e, 0x64, 0x12, 0x29, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, - 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x53, 0x65, - 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x04, 0x52, 0x65, - 0x63, 0x76, 0x12, 0x29, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x52, 0x65, 0x63, 0x76, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, - 0x76, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x09, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2e, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x07, 0x43, 0x6c, 0x65, 0x61, 0x6e, - 0x75, 0x70, 0x12, 0x2c, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x04, 0x90, 0x82, 0x19, 0x01, 0x42, 0x85, - 0x02, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x72, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x42, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6d, 0x75, 0x68, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x7a, 0x6d, 0x79, 0x2f, 0x72, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0xa2, 0x02, 0x04, 0x44, 0x52, 0x53, 0x53, 0xaa, 0x02, 0x1c, 0x44, 0x65, - 0x76, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0xca, 0x02, 0x1c, 0x44, 0x65, 0x76, - 0x5c, 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0xe2, 0x02, 0x28, 0x44, 0x65, 0x76, 0x5c, - 0x52, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1f, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x52, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proto_services_services_proto_rawDescOnce sync.Once - file_proto_services_services_proto_rawDescData = file_proto_services_services_proto_rawDesc -) - -func file_proto_services_services_proto_rawDescGZIP() []byte { - file_proto_services_services_proto_rawDescOnce.Do(func() { - file_proto_services_services_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_services_services_proto_rawDescData) - }) - return file_proto_services_services_proto_rawDescData -} - -var file_proto_services_services_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_proto_services_services_proto_goTypes = []interface{}{ - (*StartRequest)(nil), // 0: dev.restate.service.services.StartRequest - (*StartResponse)(nil), // 1: dev.restate.service.services.StartResponse - (*SendRequest)(nil), // 2: dev.restate.service.services.SendRequest - (*SendResponse)(nil), // 3: dev.restate.service.services.SendResponse - (*RecvRequest)(nil), // 4: dev.restate.service.services.RecvRequest - (*RecvResponse)(nil), // 5: dev.restate.service.services.RecvResponse - (*GetResultRequest)(nil), // 6: dev.restate.service.services.GetResultRequest - (*GetResultResponse)(nil), // 7: dev.restate.service.services.GetResultResponse - (*CleanupRequest)(nil), // 8: dev.restate.service.services.CleanupRequest - (*GetResultResponse_InvocationFailure)(nil), // 9: dev.restate.service.services.GetResultResponse.InvocationFailure - (*emptypb.Empty)(nil), // 10: google.protobuf.Empty -} -var file_proto_services_services_proto_depIdxs = []int32{ - 7, // 0: dev.restate.service.services.StartResponse.completed:type_name -> dev.restate.service.services.GetResultResponse - 10, // 1: dev.restate.service.services.SendResponse.ok:type_name -> google.protobuf.Empty - 10, // 2: dev.restate.service.services.SendResponse.invalid_stream:type_name -> google.protobuf.Empty - 10, // 3: dev.restate.service.services.SendResponse.invocation_completed:type_name -> google.protobuf.Empty - 10, // 4: dev.restate.service.services.RecvResponse.invalid_stream:type_name -> google.protobuf.Empty - 10, // 5: dev.restate.service.services.RecvResponse.invocation_completed:type_name -> google.protobuf.Empty - 10, // 6: dev.restate.service.services.GetResultResponse.none:type_name -> google.protobuf.Empty - 9, // 7: dev.restate.service.services.GetResultResponse.failure:type_name -> dev.restate.service.services.GetResultResponse.InvocationFailure - 0, // 8: dev.restate.service.services.RemoteContext.Start:input_type -> dev.restate.service.services.StartRequest - 2, // 9: dev.restate.service.services.RemoteContext.Send:input_type -> dev.restate.service.services.SendRequest - 4, // 10: dev.restate.service.services.RemoteContext.Recv:input_type -> dev.restate.service.services.RecvRequest - 6, // 11: dev.restate.service.services.RemoteContext.GetResult:input_type -> dev.restate.service.services.GetResultRequest - 8, // 12: dev.restate.service.services.RemoteContext.Cleanup:input_type -> dev.restate.service.services.CleanupRequest - 1, // 13: dev.restate.service.services.RemoteContext.Start:output_type -> dev.restate.service.services.StartResponse - 3, // 14: dev.restate.service.services.RemoteContext.Send:output_type -> dev.restate.service.services.SendResponse - 5, // 15: dev.restate.service.services.RemoteContext.Recv:output_type -> dev.restate.service.services.RecvResponse - 7, // 16: dev.restate.service.services.RemoteContext.GetResult:output_type -> dev.restate.service.services.GetResultResponse - 10, // 17: dev.restate.service.services.RemoteContext.Cleanup:output_type -> google.protobuf.Empty - 13, // [13:18] is the sub-list for method output_type - 8, // [8:13] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_proto_services_services_proto_init() } -func file_proto_services_services_proto_init() { - if File_proto_services_services_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proto_services_services_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecvRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecvResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResultRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResultResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CleanupRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_services_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResultResponse_InvocationFailure); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_proto_services_services_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*StartResponse_Executing)(nil), - (*StartResponse_Completed)(nil), - } - file_proto_services_services_proto_msgTypes[3].OneofWrappers = []interface{}{ - (*SendResponse_Ok)(nil), - (*SendResponse_InvalidStream)(nil), - (*SendResponse_InvocationCompleted)(nil), - } - file_proto_services_services_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*RecvResponse_Messages)(nil), - (*RecvResponse_InvalidStream)(nil), - (*RecvResponse_InvocationCompleted)(nil), - } - file_proto_services_services_proto_msgTypes[7].OneofWrappers = []interface{}{ - (*GetResultResponse_None)(nil), - (*GetResultResponse_Success)(nil), - (*GetResultResponse_Failure)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_services_services_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_proto_services_services_proto_goTypes, - DependencyIndexes: file_proto_services_services_proto_depIdxs, - MessageInfos: file_proto_services_services_proto_msgTypes, - }.Build() - File_proto_services_services_proto = out.File - file_proto_services_services_proto_rawDesc = nil - file_proto_services_services_proto_goTypes = nil - file_proto_services_services_proto_depIdxs = nil -} diff --git a/go.mod b/go.mod index 65164a6..f9f4eb6 100644 --- a/go.mod +++ b/go.mod @@ -3,21 +3,20 @@ module github.com/restatedev/sdk-go go 1.22.0 require ( + github.com/google/uuid v1.6.0 + github.com/posener/h2conn v0.0.0-20231204025407-3997deeca0f0 github.com/rs/zerolog v1.32.0 + github.com/stretchr/testify v1.9.0 + github.com/vmihailenco/msgpack/v5 v5.4.1 golang.org/x/net v0.21.0 google.golang.org/protobuf v1.32.0 ) require ( - github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/google/uuid v1.6.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/posener/h2conn v0.0.0-20231204025407-3997deeca0f0 // indirect - github.com/stretchr/testify v1.9.0 // indirect - github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/go.sum b/go.sum index deb27be..11597c7 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -29,14 +29,16 @@ golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/handler.go b/handler.go index a376d44..5dd650f 100644 --- a/handler.go +++ b/handler.go @@ -4,9 +4,6 @@ import ( "encoding/json" "fmt" "reflect" - - "github.com/restatedev/sdk-go/generated/proto/dynrpc" - "google.golang.org/protobuf/types/known/structpb" ) // Void is a placeholder used usually for functions that their signature require that @@ -37,12 +34,7 @@ func NewUnKeyedHandler[I any, O any](fn UnKeyedHandlerFn[I, O]) *UnKeyedHandler } } -func (h *UnKeyedHandler) Call(ctx Context, request *dynrpc.RpcRequest) (*dynrpc.RpcResponse, error) { - bytes, err := request.Request.MarshalJSON() - if err != nil { - return nil, TerminalError(fmt.Errorf("request is not valid json: %w", err)) - } - +func (h *UnKeyedHandler) Call(ctx Context, _key string, bytes []byte) ([]byte, error) { input := reflect.New(h.input) if err := json.Unmarshal(bytes, input.Interface()); err != nil { @@ -61,19 +53,12 @@ func (h *UnKeyedHandler) Call(ctx Context, request *dynrpc.RpcRequest) (*dynrpc. return nil, errI.(error) } - bytes, err = json.Marshal(outI) + bytes, err := json.Marshal(outI) if err != nil { return nil, TerminalError(fmt.Errorf("failed to serialize output: %w", err)) } - var response dynrpc.RpcResponse - response.Response = &structpb.Value{} - - if err := response.Response.UnmarshalJSON(bytes); err != nil { - return nil, TerminalError(err) - } - - return &response, nil + return bytes, nil } func (h *UnKeyedHandler) sealed() {} @@ -92,12 +77,7 @@ func NewKeyedHandler[I any, O any](fn KeyedHandlerFn[I, O]) *KeyedHandler { } } -func (h *KeyedHandler) Call(ctx Context, request *dynrpc.RpcRequest) (*dynrpc.RpcResponse, error) { - bytes, err := request.Request.MarshalJSON() - if err != nil { - return nil, TerminalError(fmt.Errorf("request is not valid json: %w", err)) - } - +func (h *KeyedHandler) Call(ctx Context, key string, bytes []byte) ([]byte, error) { input := reflect.New(h.input) if err := json.Unmarshal(bytes, input.Interface()); err != nil { @@ -107,7 +87,7 @@ func (h *KeyedHandler) Call(ctx Context, request *dynrpc.RpcRequest) (*dynrpc.Rp // we are sure about the fn signature so it's safe to do this output := h.fn.Call([]reflect.Value{ reflect.ValueOf(ctx), - reflect.ValueOf(request.Key), + reflect.ValueOf(key), input.Elem(), }) @@ -117,19 +97,12 @@ func (h *KeyedHandler) Call(ctx Context, request *dynrpc.RpcRequest) (*dynrpc.Rp return nil, errI.(error) } - bytes, err = json.Marshal(outI) + bytes, err := json.Marshal(outI) if err != nil { return nil, TerminalError(fmt.Errorf("failed to serialize output: %w", err)) } - var response dynrpc.RpcResponse - response.Response = &structpb.Value{} - - if err := response.Response.UnmarshalJSON(bytes); err != nil { - return nil, TerminalError(err) - } - - return &response, nil + return bytes, nil } func (h *KeyedHandler) sealed() {} diff --git a/internal/discovery.go b/internal/discovery.go new file mode 100644 index 0000000..738d789 --- /dev/null +++ b/internal/discovery.go @@ -0,0 +1,57 @@ +package internal + +type ProtocolMode string + +const ( + ProtocolMode_BIDI_STREAM ProtocolMode = "BIDI_STREAM" + ProtocolMode_REQUEST_RESPONSE ProtocolMode = "REQUEST_RESPONSE" +) + +type ServiceType string + +const ( + ServiceType_VIRTUAL_OBJECT ServiceType = "VIRTUAL_OBJECT" + ServiceType_SERVICE ServiceType = "SERVICE" + ServiceType_WORKFLOW ServiceType = "WORKFLOW" +) + +type ServiceHandlerType string + +const ( + ServiceHandlerType_WORKFLOW ServiceHandlerType = "WORKFLOW" + ServiceHandlerType_EXCLUSIVE ServiceHandlerType = "EXCLUSIVE" + ServiceHandlerType_SHARED ServiceHandlerType = "SHARED" +) + +type InputPayload struct { + Required bool `json:"required"` + ContentType string `json:"contentType"` + JsonSchema interface{} `json:"jsonSchema,omitempty"` +} + +type OutputPayload struct { + ContentType string `json:"contentType"` + SetContentTypeIfEmpty bool `json:"setContentTypeIfEmpty"` + JsonSchema interface{} `json:"jsonSchema,omitempty"` +} + +type Handler struct { + Name string `json:"name,omitempty"` + // If unspecified, defaults to EXCLUSIVE for Virtual Object. This should be unset for Services. + Ty *ServiceHandlerType `json:"ty,omitempty"` + Input *InputPayload `json:"input,omitempty"` + Output *OutputPayload `json:"output,omitempty"` +} + +type Service struct { + Name string `json:"name"` + Ty ServiceType `json:"ty"` + Handlers []Handler `json:"handlers"` +} + +type Endpoint struct { + ProtocolMode ProtocolMode `json:"protocolMode"` + MinProtocolVersion int32 `json:"minProtocolVersion"` + MaxProtocolVersion int32 `json:"maxProtocolVersion"` + Services []Service `json:"services"` +} diff --git a/internal/dynrpc.binbp b/internal/dynrpc.binbp deleted file mode 100644 index 005949b..0000000 Binary files a/internal/dynrpc.binbp and /dev/null differ diff --git a/internal/dynrpc.go b/internal/dynrpc.go deleted file mode 100644 index 8836efe..0000000 --- a/internal/dynrpc.go +++ /dev/null @@ -1,109 +0,0 @@ -package internal - -import ( - _ "embed" - "fmt" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -var ( - requestTypeName = "RpcRequest" - responseTypeName = "RpcResponse" -) - -//go:embed dynrpc.binbp -var dynRpcBytes []byte - -// NewDynRpcDescriptorSet creates a new DynRpcDescriptorSet -func NewDynRpcDescriptorSet() *DynRpcDescriptorSet { - var ds descriptorpb.FileDescriptorSet - err := proto.Unmarshal(dynRpcBytes, &ds) - if err != nil { - panic(fmt.Sprintf("invalid file descriptor set: %s", err)) - } - - return &DynRpcDescriptorSet{&ds} -} - -// DynRpcService wrapper around ServiceDescriptorProto for easier manipulation -type DynRpcService struct { - *descriptorpb.ServiceDescriptorProto -} - -func (s *DynRpcService) AddHandler(name string) { - s.Method = append(s.Method, &descriptorpb.MethodDescriptorProto{ - Name: &name, - InputType: &requestTypeName, - OutputType: &responseTypeName, - // TODO: check options and others - }) -} - -// DynRpcDescriptorSet wrapper around FileDescriptorSet for easier manipulation -type DynRpcDescriptorSet struct { - *descriptorpb.FileDescriptorSet -} - -// Inner returns the inner *descriptorpb.FileDescriptorSet -func (d *DynRpcDescriptorSet) Inner() *descriptorpb.FileDescriptorSet { - return d.FileDescriptorSet -} - -func (d *DynRpcDescriptorSet) getDynRpcFile() (*descriptorpb.FileDescriptorProto, error) { - // since it's always the last file may be we should use the index - // but this is safer - for _, file := range d.File { - if file.Name != nil && *file.Name == "dynrpc/dynrpc.proto" { - return file, nil - } - } - - return nil, fmt.Errorf("file descriptor for dynrpc not found") -} - -// AddKeyedService creates a new Keyed service from the KeyedRpcService template -func (d *DynRpcDescriptorSet) AddKeyedService(name string) (*DynRpcService, error) { - return d.addService(name, 0) -} - -// AddUnKeyedService creates a new Un-Keyed service from the RpcService template -func (d *DynRpcDescriptorSet) AddUnKeyedService(name string) (*DynRpcService, error) { - return d.addService(name, 1) -} - -func (d *DynRpcDescriptorSet) addService(name string, from int) (*DynRpcService, error) { - file, err := d.getDynRpcFile() - if err != nil { - return nil, err - } - - // unkeyed service is always number one - service, err := deepCopy(file.Service[from]) - if err != nil { - return nil, err - } - - service.Name = &name - // clean up services - service.Method = []*descriptorpb.MethodDescriptorProto{} - - file.Service = append(file.Service, service) - - return &DynRpcService{service}, nil -} - -func deepCopy(src *descriptorpb.ServiceDescriptorProto) (*descriptorpb.ServiceDescriptorProto, error) { - bytes, err := proto.Marshal(src) - if err != nil { - return nil, err - } - - var copy descriptorpb.ServiceDescriptorProto - if err := proto.Unmarshal(bytes, ©); err != nil { - return nil, err - } - - return ©, nil -} diff --git a/internal/dynrpc_test.go b/internal/dynrpc_test.go deleted file mode 100644 index e28a411..0000000 --- a/internal/dynrpc_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package internal - -import ( - "fmt" - "testing" -) - -func TestDynRpc(t *testing.T) { - - ds := NewDynRpcDescriptorSet() - - //fmt.Println(len(ds.File)) - // require.Len(t, ds.File, 2) - - for _, file := range ds.File { - - fmt.Println(*file.Name) - fmt.Printf("dep: %+v\n", file.Dependency) - for _, service := range file.Service { - fmt.Println(" - service: ", *service.Name) - } - } -} diff --git a/internal/state/call.go b/internal/state/call.go index 7052620..03bc670 100644 --- a/internal/state/call.go +++ b/internal/state/call.go @@ -6,16 +6,14 @@ import ( "fmt" "time" - "github.com/restatedev/sdk-go" - "github.com/restatedev/sdk-go/generated/proto/dynrpc" + restate "github.com/restatedev/sdk-go" "github.com/restatedev/sdk-go/generated/proto/protocol" "github.com/restatedev/sdk-go/internal/wire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/structpb" ) var ( _ restate.Service = (*serviceProxy)(nil) + _ restate.Object = (*serviceProxy)(nil) _ restate.Call = (*serviceCall)(nil) ) @@ -24,12 +22,14 @@ var ( type serviceProxy struct { *Context service string + key string } func (c *serviceProxy) Method(fn string) restate.Call { return &serviceCall{ Context: c.Context, service: c.service, + key: c.key, method: fn, } } @@ -37,66 +37,34 @@ func (c *serviceProxy) Method(fn string) restate.Call { type serviceCall struct { *Context service string + key string method string } // Do makes a call and wait for the response -func (c *serviceCall) Do(key string, input any, output any) error { - return c.machine.doDynCall(c.service, c.method, key, input, output) +func (c *serviceCall) Do(input any, output any) error { + return c.machine.doDynCall(c.service, c.key, c.method, input, output) } // Send runs a call in the background after delay duration -func (c *serviceCall) Send(key string, body any, delay time.Duration) error { - return c.machine.sendCall(c.service, c.method, key, body, delay) +func (c *serviceCall) Send(body any, delay time.Duration) error { + return c.machine.sendCall(c.service, c.method, c.key, body, delay) } -func (m *Machine) makeRequest(key string, body any) ([]byte, error) { - - input, err := json.Marshal(body) - if err != nil { - return nil, err - } - - params := &dynrpc.RpcRequest{ - Key: key, - Request: &structpb.Value{}, - } - - if err := params.Request.UnmarshalJSON(input); err != nil { - return nil, err - } - - return proto.Marshal(params) -} - -func (m *Machine) doDynCall(service, method, key string, input, output any) error { +func (m *Machine) doDynCall(service, key, method string, input, output any) error { m.log.Debug().Str("service", service).Str("method", method).Msg("in do call") - params, err := m.makeRequest(key, input) + params, err := json.Marshal(input) if err != nil { return err } - bytes, err := m.doCall(service, method, params) + bytes, err := m.doCall(service, key, method, params) if err != nil { return err } - var rpcResponse dynrpc.RpcResponse - if err := proto.Unmarshal(bytes, &rpcResponse); err != nil { - return fmt.Errorf("failed to decode rpc response: %w", err) - } - - js, err := rpcResponse.Response.MarshalJSON() - if err != nil { - return fmt.Errorf("failed to process response payload") - } - - if output == nil { - return nil - } - - if err := json.Unmarshal(js, output); err != nil { + if err := json.Unmarshal(bytes, output); err != nil { // TODO: is this should be a terminal error or not? return restate.TerminalError(fmt.Errorf("failed to decode response (%s): %w", string(bytes), err)) } @@ -104,35 +72,37 @@ func (m *Machine) doDynCall(service, method, key string, input, output any) erro return nil } -func (m *Machine) doCall(service, method string, params []byte) ([]byte, error) { +func (m *Machine) doCall(service, key, method string, params []byte) ([]byte, error) { return replayOrNew( m, - wire.InvokeEntryMessageType, - func(entry *wire.InvokeEntryMessage) ([]byte, error) { + wire.CallEntryMessageType, + func(entry *wire.CallEntryMessage) ([]byte, error) { if entry.Payload.ServiceName != service || - entry.Payload.MethodName != method || + entry.Payload.Key != key || + entry.Payload.HandlerName != method || !bytes.Equal(entry.Payload.Parameter, params) { return nil, errEntryMismatch } switch result := entry.Payload.Result.(type) { - case *protocol.InvokeEntryMessage_Failure: + case *protocol.CallEntryMessage_Failure: return nil, restate.WithErrorCode(fmt.Errorf(result.Failure.Message), restate.Code(result.Failure.Code)) - case *protocol.InvokeEntryMessage_Value: + case *protocol.CallEntryMessage_Value: return result.Value, nil } return nil, errUnreachable }, func() ([]byte, error) { - return m._doCall(service, method, params) + return m._doCall(service, key, method, params) }) } -func (m *Machine) _doCall(service, method string, params []byte) ([]byte, error) { - err := m.protocol.Write(&protocol.InvokeEntryMessage{ +func (m *Machine) _doCall(service, key, method string, params []byte) ([]byte, error) { + err := m.protocol.Write(&protocol.CallEntryMessage{ ServiceName: service, - MethodName: method, + HandlerName: method, Parameter: params, + Key: key, }) if err != nil { @@ -163,17 +133,18 @@ func (m *Machine) _doCall(service, method string, params []byte) ([]byte, error) } func (c *Machine) sendCall(service, method, key string, body any, delay time.Duration) error { - params, err := c.makeRequest(key, body) + params, err := json.Marshal(body) if err != nil { return err } _, err = replayOrNew( c, - wire.BackgroundInvokeEntryMessageType, - func(entry *wire.BackgroundInvokeEntryMessage) (restate.Void, error) { + wire.OneWayCallEntryMessageType, + func(entry *wire.OneWayCallEntryMessage) (restate.Void, error) { if entry.Payload.ServiceName != service || - entry.Payload.MethodName != method || + entry.Payload.Key != key || + entry.Payload.HandlerName != method || !bytes.Equal(entry.Payload.Parameter, params) { return restate.Void{}, errEntryMismatch } @@ -194,9 +165,9 @@ func (c *Machine) _sendCall(service, method string, params []byte, delay time.Du invokeTime = uint64(time.Now().Add(delay).UnixMilli()) } - err := c.protocol.Write(&protocol.BackgroundInvokeEntryMessage{ + err := c.protocol.Write(&protocol.OneWayCallEntryMessage{ ServiceName: service, - MethodName: method, + HandlerName: method, Parameter: params, InvokeTime: invokeTime, }) diff --git a/internal/state/state.go b/internal/state/state.go index c25dfbe..46d8b07 100644 --- a/internal/state/state.go +++ b/internal/state/state.go @@ -8,9 +8,7 @@ import ( "sync" "time" - "github.com/cenkalti/backoff/v4" - "github.com/restatedev/sdk-go" - "github.com/restatedev/sdk-go/generated/proto/dynrpc" + restate "github.com/restatedev/sdk-go" "github.com/restatedev/sdk-go/generated/proto/protocol" "github.com/restatedev/sdk-go/internal/wire" @@ -80,17 +78,16 @@ func (c *Context) Service(service string) restate.Service { } } -func (c *Context) SideEffect(fn func() ([]byte, error), bo ...backoff.BackOff) ([]byte, error) { - var back backoff.BackOff - if len(bo) == 0 { - back = &restate.DefaultBackoffPolicy - } else if len(bo) == 1 { - back = bo[0] - } else { - panic("only single backoff policy is allowed") +func (c *Context) Object(service, key string) restate.Object { + return &serviceProxy{ + Context: c, + service: service, + key: key, } +} - return c.machine.sideEffect(fn, back) +func (c *Context) SideEffect(fn func() ([]byte, error)) ([]byte, error) { + return c.machine.sideEffect(fn) } func newContext(inner context.Context, machine *Machine) *Context { @@ -149,9 +146,6 @@ func (m *Machine) Start(inner context.Context, trace string) error { start := msg.(*wire.StartMessage) m.id = start.Payload.DebugId - if start.Version != Version { - return ErrInvalidVersion - } m.log = log.With().Str("id", start.Payload.DebugId).Str("method", trace).Logger() @@ -164,15 +158,15 @@ func (m *Machine) Start(inner context.Context, trace string) error { } // handle handler response and build proper response message -func (m *Machine) output(r *dynrpc.RpcResponse, err error) proto.Message { +func (m *Machine) output(bytes []byte, err error) proto.Message { if err != nil { m.log.Error().Err(err).Msg("failure") } if err != nil && restate.IsTerminalError(err) { // terminal errors. - return &protocol.OutputStreamEntryMessage{ - Result: &protocol.OutputStreamEntryMessage_Failure{ + return &protocol.OutputEntryMessage{ + Result: &protocol.OutputEntryMessage_Failure{ Failure: &protocol.Failure{ Code: uint32(restate.ErrorCode(err)), Message: err.Error(), @@ -187,24 +181,14 @@ func (m *Machine) output(r *dynrpc.RpcResponse, err error) proto.Message { } } - bytes, err := proto.Marshal(r) - if err != nil { - // this shouldn't happen but in case we return a retry error - return &protocol.ErrorMessage{ - Code: uint32(restate.INTERNAL), - Message: err.Error(), - Description: "failed to serialize call output", - } - } - - return &protocol.OutputStreamEntryMessage{ - Result: &protocol.OutputStreamEntryMessage_Value{ + return &protocol.OutputEntryMessage{ + Result: &protocol.OutputEntryMessage_Value{ Value: bytes, }, } } -func (m *Machine) invoke(ctx *Context, input *dynrpc.RpcRequest) error { +func (m *Machine) invoke(ctx *Context, key string, input []byte) error { // always terminate the invocation with // an end message. // this will always terminate the connection @@ -250,7 +234,7 @@ func (m *Machine) invoke(ctx *Context, input *dynrpc.RpcRequest) error { } }() - output := m.output(m.handler.Call(ctx, input)) + output := m.output(m.handler.Call(ctx, key, input)) return m.protocol.Write(output) } @@ -266,7 +250,7 @@ func (m *Machine) process(ctx *Context, start *wire.StartMessage) error { return err } - if msg.Type() != wire.PollInputEntryMessageType { + if msg.Type() != wire.InputEntryMessageType { return wire.ErrUnexpectedMessage } @@ -284,14 +268,9 @@ func (m *Machine) process(ctx *Context, start *wire.StartMessage) error { m.entries = append(m.entries, msg) } - inputMsg := msg.(*wire.PollInputEntry) + inputMsg := msg.(*wire.InputEntryMessage) value := inputMsg.Payload.GetValue() - var input dynrpc.RpcRequest - if err := proto.Unmarshal(value, &input); err != nil { - return fmt.Errorf("invalid invocation input: %w", err) - } - - return m.invoke(ctx, &input) + return m.invoke(ctx, start.Payload.Key, value) } diff --git a/internal/state/sys.go b/internal/state/sys.go index 571d0aa..da03ac3 100644 --- a/internal/state/sys.go +++ b/internal/state/sys.go @@ -2,12 +2,11 @@ package state import ( "bytes" + "errors" "fmt" "time" - "github.com/cenkalti/backoff/v4" - "github.com/restatedev/sdk-go" - "github.com/restatedev/sdk-go/generated/proto/javascript" + restate "github.com/restatedev/sdk-go" "github.com/restatedev/sdk-go/generated/proto/protocol" "github.com/restatedev/sdk-go/internal/wire" "google.golang.org/protobuf/proto" @@ -321,59 +320,62 @@ func (m *Machine) _sleep(until time.Time) error { return nil } -func (m *Machine) sideEffect(fn func() ([]byte, error), bo backoff.BackOff) ([]byte, error) { +func (m *Machine) sideEffect(fn func() ([]byte, error)) ([]byte, error) { return replayOrNew( m, - wire.SideEffectEntryMessageType, - func(entry *wire.SideEffectEntryMessage) ([]byte, error) { + wire.RunEntryMessageType, + func(entry *wire.RunEntryMessage) ([]byte, error) { switch result := entry.Payload.Result.(type) { - case *javascript.SideEffectEntryMessage_Failure: - err := fmt.Errorf("[%d] %s", result.Failure.Failure.Code, result.Failure.Failure.Message) - if result.Failure.Terminal { - err = restate.TerminalError(err) - } - return nil, err - case *javascript.SideEffectEntryMessage_Value: + case *protocol.RunEntryMessage_Failure: + return nil, restate.TerminalError(errors.New(result.Failure.Message), restate.Code(result.Failure.Code)) + case *protocol.RunEntryMessage_Value: return result.Value, nil } return nil, errUnreachable }, func() ([]byte, error) { - return m._sideEffect(fn, bo) + return m._sideEffect(fn) }, ) } -func (m *Machine) _sideEffect(fn func() ([]byte, error), bo backoff.BackOff) ([]byte, error) { - var bytes []byte - err := backoff.Retry(func() error { - var err error - bytes, err = fn() +func (m *Machine) _sideEffect(fn func() ([]byte, error)) ([]byte, error) { + bytes, err := fn() - if restate.IsTerminalError(err) { - // if inner function returned a terminal error - // we need to wrap it in permanent to break - // the retries - return backoff.Permanent(err) - } - return err - }, bo) - - var msg javascript.SideEffectEntryMessage + var msg protocol.RunEntryMessage if err != nil { - msg.Result = &javascript.SideEffectEntryMessage_Failure{ - Failure: &javascript.FailureWithTerminal{ - Failure: &protocol.Failure{ - Code: uint32(restate.ErrorCode(err)), - Message: err.Error(), + if restate.IsTerminalError(err) { + msg := protocol.RunEntryMessage{ + Result: &protocol.RunEntryMessage_Failure{ + Failure: &protocol.Failure{ + Code: uint32(restate.ErrorCode(err)), + Message: err.Error(), + }, }, - Terminal: restate.IsTerminalError(err), - }, + } + if err := m.protocol.Write(&msg); err != nil { + return nil, err + } + } else { + ty := uint32(wire.RunEntryMessageType) + msg := protocol.ErrorMessage{ + Code: uint32(restate.ErrorCode(err)), + Message: err.Error(), + RelatedEntryType: &ty, + } + if err := m.protocol.Write(&msg); err != nil { + return nil, err + } } } else { - msg.Result = &javascript.SideEffectEntryMessage_Value{ - Value: bytes, + msg := protocol.RunEntryMessage{ + Result: &protocol.RunEntryMessage_Value{ + Value: bytes, + }, + } + if err := m.protocol.Write(&msg); err != nil { + return nil, err } } diff --git a/internal/wire/wire.go b/internal/wire/wire.go index 2c29134..a750d0f 100644 --- a/internal/wire/wire.go +++ b/internal/wire/wire.go @@ -9,8 +9,7 @@ import ( "io" "math" - "github.com/restatedev/sdk-go/generated/proto/javascript" - "github.com/restatedev/sdk-go/generated/proto/protocol" + protocol "github.com/restatedev/sdk-go/generated/proto/protocol" "github.com/rs/zerolog/log" "google.golang.org/protobuf/proto" ) @@ -36,8 +35,8 @@ const ( EndMessageType Type = 0x0000 + 5 // Input/Output - PollInputEntryMessageType Type = 0x0400 - OutputStreamEntryMessageType Type = 0x0400 + 1 + InputEntryMessageType Type = 0x0400 + OutputEntryMessageType Type = 0x0400 + 1 // State GetStateEntryMessageType Type = 0x0800 @@ -47,12 +46,12 @@ const ( GetStateKeysEntryMessageType Type = 0x0800 + 4 //SysCalls - SleepEntryMessageType Type = 0x0C00 - InvokeEntryMessageType Type = 0x0C00 + 1 - BackgroundInvokeEntryMessageType Type = 0x0C00 + 2 - - // SideEffect - SideEffectEntryMessageType Type = 0xFC00 + 1 + SleepEntryMessageType Type = 0x0C00 + CallEntryMessageType Type = 0x0C00 + 1 + OneWayCallEntryMessageType Type = 0x0C00 + 2 + AwakeableEntryMessageType Type = 0x0C00 + 3 + CompleteAwakeableEntryMessageType Type = 0x0C00 + 4 + RunEntryMessageType Type = 0x0C00 + 5 ) type Type uint16 @@ -65,11 +64,6 @@ func (t Type) String() string { // a different meaning based on message type. type Flag uint16 -// this is only valid with start message -func (r Flag) version() uint16 { - return uint16(r) & VersionMask -} - func (r Flag) Completed() bool { return r&FlagCompleted != 0 } @@ -193,10 +187,10 @@ func (s *Protocol) Write(message proto.Message, flags ...Flag) error { typ = StartMessageType case *protocol.SuspensionMessage: typ = SuspensionMessageType - case *protocol.PollInputStreamEntryMessage: - typ = PollInputEntryMessageType - case *protocol.OutputStreamEntryMessage: - typ = OutputStreamEntryMessageType + case *protocol.InputEntryMessage: + typ = InputEntryMessageType + case *protocol.OutputEntryMessage: + typ = OutputEntryMessageType case *protocol.ErrorMessage: typ = ErrorMessageType case *protocol.EndMessage: @@ -211,14 +205,14 @@ func (s *Protocol) Write(message proto.Message, flags ...Flag) error { typ = ClearAllStateEntryMessageType case *protocol.SleepEntryMessage: typ = SleepEntryMessageType - case *protocol.InvokeEntryMessage: - typ = InvokeEntryMessageType - case *protocol.BackgroundInvokeEntryMessage: - typ = BackgroundInvokeEntryMessageType + case *protocol.CallEntryMessage: + typ = CallEntryMessageType + case *protocol.OneWayCallEntryMessage: + typ = OneWayCallEntryMessageType case *protocol.GetStateKeysEntryMessage: typ = GetStateKeysEntryMessageType - case *javascript.SideEffectEntryMessage: - typ = SideEffectEntryMessageType + case *protocol.RunEntryMessage: + typ = RunEntryMessageType default: return fmt.Errorf("can not send message of unknown message type") } @@ -258,8 +252,7 @@ var ( builders = map[Type]messageBuilder{ StartMessageType: func(header Header, bytes []byte) (Message, error) { msg := &StartMessage{ - Header: header, - Version: header.Flag.version(), + Header: header, } return msg, proto.Unmarshal(bytes, &msg.Payload) @@ -271,15 +264,15 @@ var ( return msg, proto.Unmarshal(bytes, &msg.Payload) }, - PollInputEntryMessageType: func(header Header, bytes []byte) (Message, error) { - msg := &PollInputEntry{ + InputEntryMessageType: func(header Header, bytes []byte) (Message, error) { + msg := &InputEntryMessage{ Header: header, } return msg, proto.Unmarshal(bytes, &msg.Payload) }, - OutputStreamEntryMessageType: func(header Header, bytes []byte) (Message, error) { - msg := &OutputStreamEntry{ + OutputEntryMessageType: func(header Header, bytes []byte) (Message, error) { + msg := &OutputEntryMessage{ Header: header, } @@ -334,22 +327,22 @@ var ( return msg, proto.Unmarshal(bytes, &msg.Payload) }, - InvokeEntryMessageType: func(header Header, bytes []byte) (Message, error) { - msg := &InvokeEntryMessage{ + CallEntryMessageType: func(header Header, bytes []byte) (Message, error) { + msg := &CallEntryMessage{ Header: header, } return msg, proto.Unmarshal(bytes, &msg.Payload) }, - BackgroundInvokeEntryMessageType: func(header Header, bytes []byte) (Message, error) { - msg := &BackgroundInvokeEntryMessage{ + OneWayCallEntryMessageType: func(header Header, bytes []byte) (Message, error) { + msg := &OneWayCallEntryMessage{ Header: header, } return msg, proto.Unmarshal(bytes, &msg.Payload) }, - SideEffectEntryMessageType: func(header Header, bytes []byte) (Message, error) { - msg := &SideEffectEntryMessage{ + RunEntryMessageType: func(header Header, bytes []byte) (Message, error) { + msg := &RunEntryMessage{ Header: header, } @@ -360,18 +353,17 @@ var ( type StartMessage struct { Header - Version uint16 Payload protocol.StartMessage } -type PollInputEntry struct { +type InputEntryMessage struct { Header - Payload protocol.PollInputStreamEntryMessage + Payload protocol.InputEntryMessage } -type OutputStreamEntry struct { +type OutputEntryMessage struct { Header - Payload protocol.OutputStreamEntryMessage + Payload protocol.OutputEntryMessage } type GetStateEntryMessage struct { @@ -409,19 +401,19 @@ type SleepEntryMessage struct { Payload protocol.SleepEntryMessage } -type InvokeEntryMessage struct { +type CallEntryMessage struct { Header - Payload protocol.InvokeEntryMessage + Payload protocol.CallEntryMessage } -type BackgroundInvokeEntryMessage struct { +type OneWayCallEntryMessage struct { Header - Payload protocol.BackgroundInvokeEntryMessage + Payload protocol.OneWayCallEntryMessage } -type SideEffectEntryMessage struct { +type RunEntryMessage struct { Header - Payload javascript.SideEffectEntryMessage + Payload protocol.RunEntryMessage } type EntryAckMessage struct { diff --git a/proto/buf.lock b/proto/buf.lock deleted file mode 100644 index 84e0028..0000000 --- a/proto/buf.lock +++ /dev/null @@ -1,8 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: restatedev - repository: proto - commit: 6ea2d15aed8f408590a1465844df5a8e - digest: shake256:e6599809ff13490a631f87d1a4b13ef1886d1bd1c0aa001ccb92806c0acc373d047a6ead761f8a21dfbd57a4fd9acd5915a52e47bd5b4e4a02dd1766f78511b3 diff --git a/proto/discovery/discovery.proto b/proto/discovery/discovery.proto index 36d8d92..e385c92 100644 --- a/proto/discovery/discovery.proto +++ b/proto/discovery/discovery.proto @@ -1,46 +1,22 @@ -/* - * Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH - * - * This file is part of the Restate SDK for Node.js/TypeScript, - * which is released under the MIT license. - * - * You can find a copy of the license in file LICENSE in the root - * directory of this repository or package, or at - * https://github.com/restatedev/sdk-typescript/blob/main/LICENSE - */ +// Copyright (c) 2024 - Restate Software, Inc., Restate GmbH +// +// This file is part of the Restate service protocol, which is +// released under the MIT license. +// +// You can find a copy of the license in file LICENSE in the root +// directory of this repository or package, or at +// https://github.com/restatedev/service-protocol/blob/main/LICENSE syntax = "proto3"; package dev.restate.service.discovery; -import "google/protobuf/descriptor.proto"; +option java_package = "dev.restate.generated.service.discovery"; +option go_package = "restate.dev/sdk-go/pb/service/discovery"; -// --- Service discovery endpoint --- -// Request: POST /discover with application/proto containing -// ServiceDiscoveryRequest Response: application/proto containing -// ServiceDiscoveryResponse - -message ServiceDiscoveryRequest {} - -enum ProtocolMode { - // protolint:disable:next ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH - BIDI_STREAM = 0; - REQUEST_RESPONSE = 1; -} - -message ServiceDiscoveryResponse { - // List of all proto files used to define the services, including the - // dependencies. - google.protobuf.FileDescriptorSet files = 1; - - // List of services to register. This might be a subset of services defined in - // files. - repeated string services = 2; - - // Service-protocol version negotiation - uint32 min_protocol_version = 3; - uint32 max_protocol_version = 4; - - // Protocol mode negotiation - ProtocolMode protocol_mode = 5; +// Service discovery protocol version. +enum ServiceDiscoveryProtocolVersion { + SERVICE_DISCOVERY_PROTOCOL_VERSION_UNSPECIFIED = 0; + // initial service discovery protocol version using endpoint_manifest_schema.json + V1 = 1; } diff --git a/proto/dynrpc/dynrpc.proto b/proto/dynrpc/dynrpc.proto deleted file mode 100644 index 8f459ae..0000000 --- a/proto/dynrpc/dynrpc.proto +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH - * - * This file is part of the Restate SDK for Node.js/TypeScript, - * which is released under the MIT license. - * - * You can find a copy of the license in file LICENSE in the root - * directory of this repository or package, or at - * https://github.com/restatedev/sdk-typescript/blob/main/LICENSE - */ - -syntax = "proto3"; - -import "dev/restate/ext.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/empty.proto"; - -service RpcEndpoint { - option (dev.restate.ext.service_type) = KEYED; - - rpc call(RpcRequest) returns (RpcResponse) {}; - - rpc handle(KeyedEvent) returns (google.protobuf.Empty) {}; -} - -message KeyedEvent { - string key = 1 [ (dev.restate.ext.field) = KEY ]; - bytes payload = 3 [ (dev.restate.ext.field) = EVENT_PAYLOAD ]; - map attributes = 15 - [ (dev.restate.ext.field) = EVENT_METADATA ]; -} - -service UnkeyedRpcEndpoint { - option (dev.restate.ext.service_type) = UNKEYED; - - rpc call(RpcRequest) returns (RpcResponse) {}; -} - -message RpcRequest { - string key = 1 [ (dev.restate.ext.field) = KEY ]; - google.protobuf.Value request = 2; - - // internal: see src/utils/assumptions.ts - int32 sender_assumes = 101; -} - -message RpcResponse { google.protobuf.Value response = 1; } diff --git a/proto/javascript/javascript.proto b/proto/javascript/javascript.proto index c78b9d6..f774986 100644 --- a/proto/javascript/javascript.proto +++ b/proto/javascript/javascript.proto @@ -15,20 +15,6 @@ package dev.restate.sdk.javascript; import "proto/protocol/protocol.proto"; -message FailureWithTerminal { - dev.restate.service.protocol.Failure failure = 1; - bool terminal = 2; -} - -// Type: 0xFC00 + 1 -// Flag: RequiresRuntimeAck -message SideEffectEntryMessage { - oneof result { - bytes value = 14; - FailureWithTerminal failure = 15; - }; -} - // Type: 0xFC00 + 2 message CombinatorEntryMessage { int32 combinator_id = 1; diff --git a/proto/protocol/protocol.proto b/proto/protocol/protocol.proto index 68c9d95..333a36e 100644 --- a/proto/protocol/protocol.proto +++ b/proto/protocol/protocol.proto @@ -11,11 +11,16 @@ syntax = "proto3"; package dev.restate.service.protocol; -import "google/protobuf/empty.proto"; - option java_package = "dev.restate.generated.service.protocol"; option go_package = "restate.dev/sdk-go/pb/service/protocol"; +// Service protocol version. +enum ServiceProtocolVersion { + SERVICE_PROTOCOL_VERSION_UNSPECIFIED = 0; + // initial service protocol version + V1 = 1; +} + // --- Core frames --- // Type: 0x0000 + 0 @@ -27,13 +32,11 @@ message StartMessage { bytes value = 2; } - // Unique id of the invocation. This id is unique across invocations and won't - // change when replaying the journal. + // Unique id of the invocation. This id is unique across invocations and won't change when replaying the journal. bytes id = 1; // Invocation id that can be used for logging. - // The user can use this id to address this invocation in admin and status - // introspection apis. + // The user can use this id to address this invocation in admin and status introspection apis. string debug_id = 2; uint32 known_entries = 3; @@ -41,6 +44,9 @@ message StartMessage { // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED repeated StateEntry state_map = 4; bool partial_state = 5; + + // If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise. + string key = 6; } // Type: 0x0000 + 1 @@ -48,7 +54,7 @@ message CompletionMessage { uint32 entry_index = 1; oneof result { - google.protobuf.Empty empty = 13; + Empty empty = 13; bytes value = 14; Failure failure = 15; }; @@ -57,76 +63,84 @@ message CompletionMessage { // Type: 0x0000 + 2 // Implementations MUST send this message when suspending an invocation. message SuspensionMessage { - // This list represents any of the entry_index the invocation is waiting on to - // progress. The runtime will resume the invocation as soon as one of the - // given entry_index is completed. This list MUST not be empty. False - // positive, entry_indexes is a valid plural of entry_indices. + // This list represents any of the entry_index the invocation is waiting on to progress. + // The runtime will resume the invocation as soon as one of the given entry_index is completed. + // This list MUST not be empty. + // False positive, entry_indexes is a valid plural of entry_indices. // https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/i/index-indexes-indices - repeated uint32 entry_indexes = - 1; // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED + repeated uint32 entry_indexes = 1; // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED } // Type: 0x0000 + 3 message ErrorMessage { - // The code can be: - // * Any of the error codes defined by OutputStreamEntry.failure (see Failure - // message) - // * JOURNAL_MISMATCH = 32, that is when the SDK cannot replay a journal due - // to the mismatch between the journal and the actual code. - // * PROTOCOL_VIOLATION = 33, that is when the SDK receives an unexpected - // message or an expected message variant, given its state. - // - // If 16 < code < 32, or code > 33, the runtime will interpret it as code 2 - // (UNKNOWN). + // The code can be any HTTP status code, as described https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml. + // In addition, we define the following error codes that MAY be used by the SDK for better error reporting: + // * JOURNAL_MISMATCH = 570, that is when the SDK cannot replay a journal due to the mismatch between the journal and the actual code. + // * PROTOCOL_VIOLATION = 571, that is when the SDK receives an unexpected message or an expected message variant, given its state. uint32 code = 1; // Contains a concise error message, e.g. Throwable#getMessage() in Java. string message = 2; // Contains a verbose error description, e.g. the exception stacktrace. string description = 3; + + // Entry that caused the failure. This may be outside the current stored journal size. + // If no specific entry caused the failure, the current replayed/processed entry can be used. + optional uint32 related_entry_index = 4; + // Name of the entry that caused the failure. + optional string related_entry_name = 5; + // Entry type. + optional uint32 related_entry_type = 6; } // Type: 0x0000 + 4 -message EntryAckMessage { uint32 entry_index = 1; } +message EntryAckMessage { + uint32 entry_index = 1; +} // Type: 0x0000 + 5 // Implementations MUST send this message when the invocation lifecycle ends. -message EndMessage {} +message EndMessage { +} // --- Journal Entries --- -// Every Completable JournalEntry has a result field, filled only and only if -// the entry is in DONE state. Depending on the semantics of the corresponding -// syscall, the entry can represent the result field with any of these three -// types: +// Every Completable JournalEntry has a result field, filled only and only if the entry is in DONE state. +// +// For every journal entry, fields 12, 13, 14 and 15 are reserved. +// +// The field 12 is used for name. The name is used by introspection/observability tools. +// +// Depending on the semantics of the corresponding syscall, the entry can represent the completion result field with any of these three types: // -// * google.protobuf.Empty empty = 13 for cases when we need to propagate to -// user code the distinction between default value or no value. +// * google.protobuf.Empty empty = 13 for cases when we need to propagate to user code the distinction between default value or no value. // * bytes value = 14 for carrying the result value // * Failure failure = 15 for carrying a failure -// -// The tag numbers 13, 14 and 15 are reserved and shouldn't be used for other -// fields. // ------ Input and output ------ -// Completable: Yes +// Completable: No // Fallible: No // Type: 0x0400 + 0 -message PollInputStreamEntryMessage { - oneof result { - bytes value = 14; - Failure failure = 15; - } +message InputEntryMessage { + repeated Header headers = 1; + + bytes value = 14; + + // Entry name + string name = 12; } // Completable: No // Fallible: No // Type: 0x0400 + 1 -message OutputStreamEntryMessage { +message OutputEntryMessage { oneof result { bytes value = 14; Failure failure = 15; }; + + // Entry name + string name = 12; } // ------ State access ------ @@ -138,10 +152,13 @@ message GetStateEntryMessage { bytes key = 1; oneof result { - google.protobuf.Empty empty = 13; + Empty empty = 13; bytes value = 14; Failure failure = 15; }; + + // Entry name + string name = 12; } // Completable: No @@ -150,28 +167,98 @@ message GetStateEntryMessage { message SetStateEntryMessage { bytes key = 1; bytes value = 3; + + // Entry name + string name = 12; } // Completable: No // Fallible: No // Type: 0x0800 + 2 -message ClearStateEntryMessage { bytes key = 1; } +message ClearStateEntryMessage { + bytes key = 1; + + // Entry name + string name = 12; +} // Completable: No // Fallible: No // Type: 0x0800 + 3 -message ClearAllStateEntryMessage {} +message ClearAllStateEntryMessage { + // Entry name + string name = 12; +} // Completable: Yes // Fallible: No // Type: 0x0800 + 4 message GetStateKeysEntryMessage { - message StateKeys { repeated bytes keys = 1; } + message StateKeys { + repeated bytes keys = 1; + } oneof result { StateKeys value = 14; Failure failure = 15; }; + + // Entry name + string name = 12; +} + +// Completable: Yes +// Fallible: No +// Type: 0x0800 + 8 +message GetPromiseEntryMessage { + string key = 1; + + oneof result { + bytes value = 14; + Failure failure = 15; + }; + + // Entry name + string name = 12; +} + +// Completable: Yes +// Fallible: No +// Type: 0x0800 + 9 +message PeekPromiseEntryMessage { + string key = 1; + + oneof result { + Empty empty = 13; + bytes value = 14; + Failure failure = 15; + }; + + // Entry name + string name = 12; +} + +// Completable: Yes +// Fallible: No +// Type: 0x0800 + A +message CompletePromiseEntryMessage { + string key = 1; + + // The value to use to complete the promise + oneof completion { + bytes completion_value = 2; + Failure completion_failure = 3; + }; + + oneof result { + // Returns empty if value was set successfully + Empty empty = 13; + // Returns a failure if the promise was already completed + Failure failure = 15; + } + + // Entry name + string name = 12; } // ------ Syscalls ------ @@ -185,32 +272,43 @@ message SleepEntryMessage { uint64 wake_up_time = 1; oneof result { - google.protobuf.Empty empty = 13; + Empty empty = 13; Failure failure = 15; } + + // Entry name + string name = 12; } // Completable: Yes // Fallible: Yes // Type: 0x0C00 + 1 -message InvokeEntryMessage { +message CallEntryMessage { string service_name = 1; - string method_name = 2; + string handler_name = 2; bytes parameter = 3; + repeated Header headers = 4; + + // If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise. + string key = 5; + oneof result { bytes value = 14; Failure failure = 15; }; + + // Entry name + string name = 12; } // Completable: No // Fallible: Yes // Type: 0x0C00 + 2 -message BackgroundInvokeEntryMessage { +message OneWayCallEntryMessage { string service_name = 1; - string method_name = 2; + string handler_name = 2; bytes parameter = 3; @@ -219,18 +317,28 @@ message BackgroundInvokeEntryMessage { // If this value is not set, equal to 0, or past in time, // the runtime will execute this BackgroundInvoke as soon as possible. uint64 invoke_time = 4; + + repeated Header headers = 5; + + // If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise. + string key = 6; + + // Entry name + string name = 12; } // Completable: Yes // Fallible: No // Type: 0x0C00 + 3 -// Awakeables are addressed by an identifier exposed to the user. See the spec -// for more details. +// Awakeables are addressed by an identifier exposed to the user. See the spec for more details. message AwakeableEntryMessage { oneof result { bytes value = 14; Failure failure = 15; }; + + // Entry name + string name = 12; } // Completable: No @@ -241,23 +349,43 @@ message CompleteAwakeableEntryMessage { string id = 1; oneof result { - bytes value = 5; - Failure failure = 6; + bytes value = 14; + Failure failure = 15; + }; + + // Entry name + string name = 12; +} + +// Completable: No +// Fallible: No +// Type: 0x0C00 + 5 +// Flag: RequiresRuntimeAck +message RunEntryMessage { + oneof result { + bytes value = 14; + dev.restate.service.protocol.Failure failure = 15; }; + + // Entry name + string name = 12; } // --- Nested messages // This failure object carries user visible errors, -// e.g. invocation failure return value or failure result of an -// InvokeEntryMessage. +// e.g. invocation failure return value or failure result of an InvokeEntryMessage. message Failure { - // The code should be any of the gRPC error codes, - // as defined here: - // https://github.com/grpc/grpc/blob/master/doc/statuscodes.md#status-codes-and-their-use-in-grpc - // - // If code > 16, the runtime will interpret it as code 2 (UNKNOWN). + // The code can be any HTTP status code, as described https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml. uint32 code = 1; // Contains a concise error message, e.g. Throwable#getMessage() in Java. string message = 2; } + +message Header { + string key = 1; + string value = 2; +} + +message Empty { +} diff --git a/proto/services/services.proto b/proto/services/services.proto deleted file mode 100644 index 59c939e..0000000 --- a/proto/services/services.proto +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) 2023-2024 - Restate Software, Inc., Restate GmbH -// -// This file is part of the Restate service protocol, which is -// released under the MIT license. -// -// You can find a copy of the license in file LICENSE in the root -// directory of this repository or package, or at -// https://github.com/restatedev/proto/blob/main/LICENSE - -syntax = "proto3"; - -/* - This package contains internal service interfaces - */ -package dev.restate.service.services; - -import "dev/restate/ext.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/struct.proto"; - -// RemoteContext service to implement the embedded handler API -service RemoteContext { - option (dev.restate.ext.service_type) = KEYED; - - // Start a new invocation, or resume a previously existing one. - // - // If another client is already executing this invocation, it will be fenced - // off and this client will take precedence. - // - // This method is not idempotent. - rpc Start(StartRequest) returns (StartResponse); - - // Send new messages to append to the message stream. - // - // This method is not idempotent, and a request can fail for several reasons, - // including errors in sent messages, or some other transient error. - // The client should consider the stream in an unrecoverable error state and - // it can retry by creating a new stream through Start() with a different - // stream_id. - // - // Once the invocation is completed, subsequent Send fail. - rpc Send(SendRequest) returns (SendResponse); - - // Receive new messages from the message stream. - // - // This method is not idempotent, and a request can fail for several reasons, - // including errors in sent messages, or some other transient error. - // The client should consider the stream in an unrecoverable error state and - // it can retry by creating a new stream through Start() with a different - // stream_id. - // - // If the invocation is completed, Recv returns a response with messages field - // empty. - rpc Recv(RecvRequest) returns (RecvResponse); - - // Get the result of the invocation. - // - // In case another client is executing the invocation (through a sequence of - // Start/Send/Recv), this method will block until a response is computed. In - // case the response is already available, it will return immediately with the - // response. In case no client is executing the invocation, that is no client - // ever invoked Start() for the given operation_id, this method will return - // response.none. - // - // This method can be safely invoked by multiple clients and it's idempotent. - rpc GetResult(GetResultRequest) returns (GetResultResponse); - - // Cleanup all the state of the invocation, excluding the user state. - // - // This is automatically executed when retention_period_sec is past, but it - // can be manually invoked before the expiry time elapsed. - rpc Cleanup(CleanupRequest) returns (google.protobuf.Empty); -} - -message StartRequest { - // User provided operation id, this is used as idempotency key. - string operation_id = 1 [ (dev.restate.ext.field) = KEY ]; - - // Stream id to uniquely identify a open stream between client and Restate. - // There can be at most one open stream at the same time. - string stream_id = 2; - - // Retention period for the response in seconds. - // After the invocation completes, the response will be persisted for the - // given duration. Afterwards, the system will cleanup the response and treats - // any subsequent invocation with same operation_id as new. - // - // If not set, 30 minutes will be used as retention period. - uint32 retention_period_sec = 3; - - // Argument of the invocation - bytes argument = 4; -} - -message StartResponse { - oneof invocation_status { - // Contains the concatenated first messages of the stream, encoded using the - // same framing used by service-protocol - bytes executing = 1; - - // Contains the result of the invocation - GetResultResponse completed = 2; - } -} - -message SendRequest { - // User provided operation id, this is used as idempotency key. - string operation_id = 1 [ (dev.restate.ext.field) = KEY ]; - - // Stream id to uniquely identify a open stream between client and Restate. - // There can be at most one open stream at the same time. - string stream_id = 2; - - // Contains the concatenated messages of the stream, encoded using the same - // framing used by service-protocol - bytes messages = 3; -} - -message SendResponse { - oneof response { - google.protobuf.Empty ok = 1; - - // This means the provided stream_id is invalid, and it should not be - // reused, nor the client should create a new stream using Start(). The - // client can instead read the invocation result using GetResult(). - google.protobuf.Empty invalid_stream = 2; - - // This means the invocation is completed, and the result should be - // collected using GetResult - google.protobuf.Empty invocation_completed = 3; - } -} - -message RecvRequest { - // User provided operation id, this is used as idempotency key. - string operation_id = 1 [ (dev.restate.ext.field) = KEY ]; - - // Stream id to uniquely identify a open stream between client and Restate. - // There can be at most one open stream at the same time. - string stream_id = 2; -} - -message RecvResponse { - oneof response { - // Contains the concatenated messages of the stream, encoded using the same - // framing used by service-protocol - bytes messages = 1; - - // This means the provided stream_id is invalid, and it should not be - // reused, nor the client should create a new stream using Start(). The - // client can instead read the invocation result using GetResult(). - google.protobuf.Empty invalid_stream = 2; - - // This means the invocation is completed, and the result should be - // collected using GetResult - google.protobuf.Empty invocation_completed = 3; - } -} - -message GetResultRequest { - // User provided operation id, this is used as idempotency key. - string operation_id = 1 [ (dev.restate.ext.field) = KEY ]; -} - -message GetResultResponse { - message InvocationFailure { - uint32 code = 1; - string message = 2; - } - - oneof response { - // See GetResult documentation - google.protobuf.Empty none = 1; - bytes success = 2; - InvocationFailure failure = 3; - } - - // Timestamp of the response expiry time in RFC3339. - // Empty if response = none - string expiry_time = 15; -} - -message CleanupRequest { - // User provided operation id, this is used as idempotency key. - string operation_id = 1 [ (dev.restate.ext.field) = KEY ]; -} diff --git a/router.go b/router.go index ac6b2d5..c7c411d 100644 --- a/router.go +++ b/router.go @@ -5,30 +5,18 @@ import ( "fmt" "time" - "github.com/cenkalti/backoff/v4" - "github.com/restatedev/sdk-go/generated/proto/dynrpc" "github.com/vmihailenco/msgpack/v5" ) var ( ErrKeyNotFound = fmt.Errorf("key not found") - //DefaultBackoffPolicy is an infinite exponential backoff - DefaultBackoffPolicy = backoff.ExponentialBackOff{ - InitialInterval: 10 * time.Microsecond, - RandomizationFactor: backoff.DefaultRandomizationFactor, - Multiplier: backoff.DefaultMultiplier, - MaxInterval: backoff.DefaultMaxInterval, - MaxElapsedTime: 0, - Stop: backoff.Stop, - Clock: backoff.SystemClock, - } ) type Call interface { // Do makes a call and wait for the response - Do(key string, input any, output any) error + Do(input any, output any) error // Send makes a call in the background (doesn't wait for response) after delay duration - Send(key string, body any, delay time.Duration) error + Send(body any, delay time.Duration) error } type Service interface { @@ -36,6 +24,11 @@ type Service interface { Method(method string) Call } +type Object interface { + // Method creates a call to method with name + Method(method string) Call +} + type Context interface { // Context of request. Ctx() context.Context @@ -60,13 +53,16 @@ type Context interface { // Service gets a Service accessor by name where service // must be another service known by restate runtime Service(service string) Service + // Object gets a Object accessor by name where object + // must be another object known by restate runtime and + // key is any string representing the key for the object + Object(object, key string) Object - // SideEffects runs the function (fn) with backoff strategy bo until it succeeds - // or permanently fail. + // SideEffects runs the function (fn) until it succeeds or permanently fails. // this stores the results of the function inside restate runtime so a replay // will produce the same value (think generating a unique id for example) // Note: use the SideEffectAs helper function - SideEffect(fn func() ([]byte, error), bo ...backoff.BackOff) ([]byte, error) + SideEffect(fn func() ([]byte, error)) ([]byte, error) } // UnKeyedHandlerFn signature of `un-keyed` handler function @@ -77,7 +73,7 @@ type KeyedHandlerFn[I any, O any] func(ctx Context, key string, input I) (output // Handler interface. type Handler interface { - Call(ctx Context, request *dynrpc.RpcRequest) (output *dynrpc.RpcResponse, err error) + Call(ctx Context, key string, request []byte) (output []byte, err error) sealed() } @@ -171,7 +167,7 @@ func SetAs[T any](ctx Context, key string, value T) error { // SideEffectAs helper function runs a side effect function with specific concrete type as a result // it does encoding/decoding of bytes automatically using msgpack -func SideEffectAs[T any](ctx Context, fn func() (T, error), bo ...backoff.BackOff) (output T, err error) { +func SideEffectAs[T any](ctx Context, fn func() (T, error)) (output T, err error) { bytes, err := ctx.SideEffect(func() ([]byte, error) { out, err := fn() if err != nil { @@ -180,7 +176,7 @@ func SideEffectAs[T any](ctx Context, fn func() (T, error), bo ...backoff.BackOf bytes, err := msgpack.Marshal(out) return bytes, TerminalError(err) - }, bo...) + }) if err != nil { return output, err diff --git a/server/restate.go b/server/restate.go index caf0fb6..3c506c9 100644 --- a/server/restate.go +++ b/server/restate.go @@ -2,21 +2,43 @@ package server import ( "context" + "encoding/json" "fmt" "net" "net/http" + "runtime/debug" "strings" "github.com/posener/h2conn" - "github.com/restatedev/sdk-go" + restate "github.com/restatedev/sdk-go" "github.com/restatedev/sdk-go/generated/proto/discovery" + "github.com/restatedev/sdk-go/generated/proto/protocol" "github.com/restatedev/sdk-go/internal" "github.com/restatedev/sdk-go/internal/state" "github.com/rs/zerolog/log" "golang.org/x/net/http2" - "google.golang.org/protobuf/proto" ) +const MIN_SERVICE_PROTOCOL_VERSION protocol.ServiceProtocolVersion = protocol.ServiceProtocolVersion_V1 +const MAX_SERVICE_PROTOCOL_VERSION protocol.ServiceProtocolVersion = protocol.ServiceProtocolVersion_V1 +const MIN_SERVICE_DISCOVERY_PROTOCOL_VERSION discovery.ServiceDiscoveryProtocolVersion = discovery.ServiceDiscoveryProtocolVersion_V1 +const MAX_SERVICE_DISCOVERY_PROTOCOL_VERSION discovery.ServiceDiscoveryProtocolVersion = discovery.ServiceDiscoveryProtocolVersion_V1 + +var X_RESTATE_SERVER = `restate-sdk-go/unknown` + +func init() { + bi, ok := debug.ReadBuildInfo() + if !ok { + return + } + for _, dep := range bi.Deps { + if dep.Path == "github.com/restatedev/sdk-go" { + X_RESTATE_SERVER = "restate-sdk-go/" + dep.Version + break + } + } +} + type Restate struct { routers map[string]restate.Router } @@ -40,39 +62,62 @@ func (r *Restate) Bind(name string, router restate.Router) *Restate { return r } -func (r *Restate) discover() (resource *discovery.ServiceDiscoveryResponse, err error) { - ds := internal.NewDynRpcDescriptorSet() - resource = &discovery.ServiceDiscoveryResponse{ - ProtocolMode: discovery.ProtocolMode_BIDI_STREAM, - Files: ds.Inner(), +func (r *Restate) discover() (resource *internal.Endpoint, err error) { + resource = &internal.Endpoint{ + ProtocolMode: internal.ProtocolMode_BIDI_STREAM, + MinProtocolVersion: 1, + MaxProtocolVersion: 2, + Services: make([]internal.Service, 0, len(r.routers)), } for name, router := range r.routers { - resource.Services = append(resource.Services, name) - var service *internal.DynRpcService + serviceType := internal.ServiceType_SERVICE if router.Keyed() { - service, err = ds.AddKeyedService(name) - } else { - service, err = ds.AddUnKeyedService(name) + serviceType = internal.ServiceType_VIRTUAL_OBJECT } - - if err != nil { - return resource, fmt.Errorf("failed to build service '%s': %w", name, err) + service := internal.Service{ + Name: name, + Ty: serviceType, + Handlers: make([]internal.Handler, 0, len(router.Handlers())), } for name := range router.Handlers() { - service.AddHandler(name) + service.Handlers = append(service.Handlers, internal.Handler{ + Name: name, + Input: &internal.InputPayload{ + Required: false, + ContentType: "application/json", // TODO configurable handler encoding + }, + Output: &internal.OutputPayload{ + SetContentTypeIfEmpty: false, + ContentType: "application/json", + }, + }) } + resource.Services = append(resource.Services, service) } - resource.Files = ds.Inner() - return } -func (r *Restate) discoverHandler(writer http.ResponseWriter, _ *http.Request) { +func (r *Restate) discoverHandler(writer http.ResponseWriter, req *http.Request) { log.Trace().Msg("discover called") - writer.Header().Add("Content-Type", "application/proto") + + acceptVersionsString := req.Header.Get("accept") + if acceptVersionsString == "" { + writer.Write([]byte("missing accept header")) + writer.WriteHeader(http.StatusUnsupportedMediaType) + + return + } + + serviceDiscoveryProtocolVersion := selectSupportedServiceDiscoveryProtocolVersion(acceptVersionsString) + + if serviceDiscoveryProtocolVersion == discovery.ServiceDiscoveryProtocolVersion_SERVICE_DISCOVERY_PROTOCOL_VERSION_UNSPECIFIED { + writer.Write([]byte(fmt.Sprint("Unsupported service discovery protocol version '%s'", acceptVersionsString))) + writer.WriteHeader(http.StatusUnsupportedMediaType) + return + } response, err := r.discover() if err != nil { @@ -82,7 +127,7 @@ func (r *Restate) discoverHandler(writer http.ResponseWriter, _ *http.Request) { return } - bytes, err := proto.Marshal(response) + bytes, err := json.Marshal(response) if err != nil { writer.Write([]byte(err.Error())) writer.WriteHeader(http.StatusInternalServerError) @@ -90,17 +135,72 @@ func (r *Restate) discoverHandler(writer http.ResponseWriter, _ *http.Request) { return } + writer.Header().Add("Content-Type", serviceDiscoveryProtocolVersionToHeaderValue(serviceDiscoveryProtocolVersion)) writer.WriteHeader(200) if _, err := writer.Write(bytes); err != nil { log.Error().Err(err).Msg("failed to write discovery information") } } +func selectSupportedServiceDiscoveryProtocolVersion(accept string) discovery.ServiceDiscoveryProtocolVersion { + maxVersion := discovery.ServiceDiscoveryProtocolVersion_SERVICE_DISCOVERY_PROTOCOL_VERSION_UNSPECIFIED + + for _, versionString := range strings.Split(accept, ",") { + version := parseServiceDiscoveryProtocolVersion(versionString) + if isServiceDiscoveryProtocolVersionSupported(version) && version > maxVersion { + maxVersion = version + } + } + + return maxVersion +} + +func parseServiceDiscoveryProtocolVersion(versionString string) discovery.ServiceDiscoveryProtocolVersion { + if strings.TrimSpace(versionString) == "application/vnd.restate.endpointmanifest.v1+json" { + return discovery.ServiceDiscoveryProtocolVersion_V1 + } + + return discovery.ServiceDiscoveryProtocolVersion_SERVICE_DISCOVERY_PROTOCOL_VERSION_UNSPECIFIED +} + +func isServiceDiscoveryProtocolVersionSupported(version discovery.ServiceDiscoveryProtocolVersion) bool { + return version >= MIN_SERVICE_DISCOVERY_PROTOCOL_VERSION && version <= MAX_SERVICE_DISCOVERY_PROTOCOL_VERSION +} + +func serviceDiscoveryProtocolVersionToHeaderValue(serviceDiscoveryProtocolVersion discovery.ServiceDiscoveryProtocolVersion) string { + switch serviceDiscoveryProtocolVersion { + case discovery.ServiceDiscoveryProtocolVersion_V1: + return "application/vnd.restate.endpointmanifest.v1+json" + } + panic(fmt.Sprintf("unexpected service discovery protocol version %d", serviceDiscoveryProtocolVersion)) +} + +func parseServiceProtocolVersion(versionString string) protocol.ServiceProtocolVersion { + if strings.TrimSpace(versionString) == "application/vnd.restate.invocation.v1" { + return protocol.ServiceProtocolVersion_V1 + } + + return protocol.ServiceProtocolVersion_SERVICE_PROTOCOL_VERSION_UNSPECIFIED +} + +func isServiceProtocolVersionSupported(version protocol.ServiceProtocolVersion) bool { + return version >= MIN_SERVICE_PROTOCOL_VERSION && version <= MAX_SERVICE_PROTOCOL_VERSION +} + +func serviceProtocolVersionToHeaderValue(serviceProtocolVersion protocol.ServiceProtocolVersion) string { + switch serviceProtocolVersion { + case protocol.ServiceProtocolVersion_V1: + return "application/vnd.restate.invocation.v1" + } + panic(fmt.Sprintf("unexpected service protocol version %d", serviceProtocolVersion)) +} + // takes care of function call -func (r *Restate) callHandler(service, fn string, writer http.ResponseWriter, request *http.Request) { +func (r *Restate) callHandler(serviceProtocolVersion protocol.ServiceProtocolVersion, service, fn string, writer http.ResponseWriter, request *http.Request) { log.Debug().Str("service", service).Str("handler", fn).Msg("new request") - writer.Header().Add("content-type", "application/restate") + writer.Header().Add("x-restate-server", X_RESTATE_SERVER) + writer.Header().Add("content-type", serviceProtocolVersionToHeaderValue(serviceProtocolVersion)) router, ok := r.routers[service] if !ok { @@ -133,15 +233,28 @@ func (r *Restate) callHandler(service, fn string, writer http.ResponseWriter, re func (r *Restate) handler(writer http.ResponseWriter, request *http.Request) { log.Trace().Str("proto", request.Proto).Str("method", request.Method).Str("path", request.RequestURI).Msg("got request") - if request.Method != http.MethodPost { - writer.WriteHeader(http.StatusMethodNotAllowed) + if request.RequestURI == "/discover" { + r.discoverHandler(writer, request) return } - if request.RequestURI == "/discover" { - r.discoverHandler(writer, request) + serviceProtocolVersionString := request.Header.Get("content-type") + if serviceProtocolVersionString == "" { + writer.Write([]byte("missing content-type header")) + writer.WriteHeader(http.StatusUnsupportedMediaType) + return } + + serviceProtocolVersion := parseServiceProtocolVersion(serviceProtocolVersionString) + + if !isServiceProtocolVersionSupported(serviceProtocolVersion) { + writer.Write([]byte(fmt.Sprintf("Unsupported service protocol version '%s'", serviceProtocolVersionString))) + writer.WriteHeader(http.StatusUnsupportedMediaType) + + return + } + // we expecting the uri to be something like `/invoke/{service}/{method}` // so if !strings.HasPrefix(request.RequestURI, "/invoke/") { @@ -155,7 +268,7 @@ func (r *Restate) handler(writer http.ResponseWriter, request *http.Request) { return } - r.callHandler(parts[0], parts[1], writer, request) + r.callHandler(serviceProtocolVersion, parts[0], parts[1], writer, request) } func (r *Restate) Start(ctx context.Context, address string) error {