From a028c6e55d9f130620c3870d412904cf5f8c6dba Mon Sep 17 00:00:00 2001 From: Jack Kleeman Date: Sat, 6 Jul 2024 11:00:58 +0100 Subject: [PATCH] Update to restate 1.0 --- README.md | 2 - proto/buf.yaml => buf.yaml | 2 - example/user_session.go | 16 +- generated/proto/discovery/discovery.pb.go | 288 +-- generated/proto/dynrpc/dynrpc.pb.go | 362 ---- generated/proto/javascript/javascript.pb.go | 263 +-- generated/proto/protocol/protocol.pb.go | 1915 ++++++++++++++----- generated/proto/services/services.pb.go | 1151 ----------- go.mod | 9 +- go.sum | 8 +- handler.go | 41 +- internal/discovery.go | 57 + internal/dynrpc.binbp | Bin 78311 -> 0 bytes internal/dynrpc.go | 109 -- internal/dynrpc_test.go | 23 - internal/state/call.go | 93 +- internal/state/state.go | 59 +- internal/state/sys.go | 78 +- internal/wire/wire.go | 88 +- proto/buf.lock | 8 - proto/discovery/discovery.proto | 54 +- proto/dynrpc/dynrpc.proto | 47 - proto/javascript/javascript.proto | 14 - proto/protocol/protocol.proto | 250 ++- proto/services/services.proto | 186 -- router.go | 36 +- server/restate.go | 169 +- 27 files changed, 2096 insertions(+), 3232 deletions(-) rename proto/buf.yaml => buf.yaml (64%) delete mode 100644 generated/proto/dynrpc/dynrpc.pb.go delete mode 100644 generated/proto/services/services.pb.go create mode 100644 internal/discovery.go delete mode 100644 internal/dynrpc.binbp delete mode 100644 internal/dynrpc.go delete mode 100644 internal/dynrpc_test.go delete mode 100644 proto/buf.lock delete mode 100644 proto/dynrpc/dynrpc.proto delete mode 100644 proto/services/services.proto 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 005949b417ad30facceb283964cb96609df50fb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 78311 zcmd?S4SbzPb?5K<+&B4=EX&t+;wTAuqP*BnY$b65n|b1YdR-|_j<#AyXPXzzFSHh0N0z29 znrgNu7iQ)cTML6$S6lB|xDqV}4#XSw&CE9UrVYoMi?z$+(lnJ@3Q2KW_pWmXmvtKK z>~Tn=)vd?Co6GUWRer72;?i8>xF8m`t*zVNwJmXVzA<@I<7jhBWYwWqdqx~jHRqdi zQ_Z=_lUs^lv9_M8sa+Uvm|r?FJ2N?vYZlY2T<>!~>`lAZw#MsEG#fYNn|52%URCEB z?umPjH`{ISnOHnI-`rBN*(WPzpV7+AyxaF0r&DbxUfY~oI_@Bp4Z=$L4bx&dlrDAi zAgb-=!i#4nn_DUdVCxDL#@z4AVT69QJz#P3VsoxN)0*2-H6Z7$0J3kUIXkr+MAonN zthm~mUj#yXOBd_Yz3YrsK+HBrU7LDnTpNk|+O4I9$>zjlYpOXhGdJDZvep2cwF1DH zHQYnH5t`L|UB^(aof22tC+8L$H*e`N4)LYhuDIHqnh|bWdikMu*OnEKhu!b>&~V@b zm3aNK*{;f#SHw3Q^|jVcw(|-OJskHgG_}Vdv76aiLt^m9&aCdcxrwa{ zP~5!EiPMS+lXenGYwJCs)j=d+|4ZWDPV&??#pU*5V`0&RW4Z1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cYniA3maG!+XWW3OtPlK^Rt8DxySFdsK$MY&A%LZe{p%no_}ub7=}_ LmFHhb&+Y#K=<&`u 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 {