diff --git a/internal/client/clientapp.go b/internal/client/clientapp.go index 796735c..c291209 100644 --- a/internal/client/clientapp.go +++ b/internal/client/clientapp.go @@ -60,25 +60,6 @@ func (a *App) Run(ctx context.Context) error { return fmt.Errorf("create gRPC stream: %w", err) } - g.Go(func() error { - for { - envelope, recErr := stream.Recv() - if recErr != nil { - return fmt.Errorf("receive envelope: %w", recErr) - } - - pbEvt := envelope.GetEvent() - if pbEvt == nil { - a.logger.Error("Received envelope without event") - continue - } - - evt := protocol.EventFromProto(pbEvt) - a.logger.Debug("Received event from gRPC stream", "event", evt) - a.bus.Send(evt) - } - }) - ui, err := terminal.NewUI(ctx, terminal.Params{ EventBus: a.bus, Dispatcher: func(cmd event.Command) { @@ -99,9 +80,53 @@ func (a *App) Run(ctx context.Context) error { g.Go(func() error { return ui.Run(ctx) }) + // After the UI is available, perform a handshake with the server. + // Ordering is important here. We want to ensure that the UI is ready to + // react to events received from the server. Performing the handshake ensures + // the client has received at least one event. + if err := a.doHandshake(stream); err != nil { + return fmt.Errorf("do handshake: %w", err) + } + + g.Go(func() error { + for { + envelope, recErr := stream.Recv() + if recErr != nil { + return fmt.Errorf("receive envelope: %w", recErr) + } + + pbEvt := envelope.GetEvent() + if pbEvt == nil { + a.logger.Error("Received envelope without event") + continue + } + + evt := protocol.EventFromProto(pbEvt) + a.logger.Debug("Received event from gRPC stream", "event", evt.EventName(), "payload", evt) + a.bus.Send(evt) + } + }) + if err := g.Wait(); err == terminal.ErrUserClosed { return nil } else { return fmt.Errorf("errgroup.Wait: %w", err) } } + +func (a *App) doHandshake(stream pb.InternalAPI_CommunicateClient) error { + env, err := stream.Recv() + if err != nil { + return fmt.Errorf("receive ready event: %w", err) + } + + if evt := env.GetEvent(); evt == nil || evt.GetInternalApiReady() == nil { + return fmt.Errorf("expected ready event but got: %T", env) + } + + if err = stream.Send(&pb.Envelope{Payload: &pb.Envelope_Command{Command: &pb.Command{CommandType: &pb.Command_StartInternalStream{}}}}); err != nil { + return fmt.Errorf("send start command: %w", err) + } + + return nil +} diff --git a/internal/client/integration_helpers_test.go b/internal/client/integration_helpers_test.go index 7f5a73c..dc416ef 100644 --- a/internal/client/integration_helpers_test.go +++ b/internal/client/integration_helpers_test.go @@ -49,6 +49,7 @@ func buildClientServer( server := server.New(server.Params{ ConfigService: configService, DockerClient: dockerClient, + WaitForClient: true, Logger: logger, }) diff --git a/internal/client/integration_test.go b/internal/client/integration_test.go index c31b3ea..d4bf0d2 100644 --- a/internal/client/integration_test.go +++ b/internal/client/integration_test.go @@ -8,6 +8,7 @@ import ( "crypto/tls" "crypto/x509" "encoding/pem" + "errors" "fmt" "net" "os" @@ -16,12 +17,15 @@ import ( "git.netflux.io/rob/octoplex/internal/config" "git.netflux.io/rob/octoplex/internal/container" + "git.netflux.io/rob/octoplex/internal/container/mocks" "git.netflux.io/rob/octoplex/internal/domain" "git.netflux.io/rob/octoplex/internal/testhelpers" + "github.com/docker/docker/api/types/network" dockerclient "github.com/docker/docker/client" "github.com/docker/docker/errdefs" "github.com/gdamore/tcell/v2" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" @@ -861,6 +865,76 @@ func TestIntegrationMediaServerError(t *testing.T) { assert.ErrorContains(t, result.errServer, "media server exited") } +func TestIntegrationDockerClientError(t *testing.T) { + ctx, cancel := context.WithTimeout(t.Context(), 10*time.Minute) + defer cancel() + + logger := testhelpers.NewTestLogger(t).With("component", "integration") + + var dockerClient mocks.DockerClient + dockerClient.EXPECT().NetworkCreate(mock.Anything, mock.Anything, mock.Anything).Return(network.CreateResponse{}, errors.New("boom")) + + configService := setupConfigService(t, config.Config{Sources: config.Sources{MediaServer: config.MediaServerSource{RTMP: config.RTMPSource{Enabled: true}}}}) + screen, screenCaptureC, getContents := setupSimulationScreen(t) + + client, server := buildClientServer(configService, &dockerClient, screen, screenCaptureC, logger) + ch := runClientServer(ctx, t, client, server) + + require.EventuallyWithT( + t, + func(c *assert.CollectT) { + assert.True(c, contentsIncludes(getContents(), "An error occurred:"), "expected to see error message") + assert.True(c, contentsIncludes(getContents(), "create container client: network create: boom"), "expected to see message") + }, + waitTime, + time.Second, + "expected to see fatal error modal", + ) + printScreen(t, getContents, "Ater displaying the fatal error modal") + + // Quit the app: + sendKey(t, screen, tcell.KeyEnter, ' ') + + result := <-ch + assert.ErrorContains(t, result.errClient, "context canceled") + assert.EqualError(t, result.errServer, "create container client: network create: boom") +} + +func TestIntegrationDockerConnectionError(t *testing.T) { + ctx, cancel := context.WithTimeout(t.Context(), 10*time.Minute) + defer cancel() + + logger := testhelpers.NewTestLogger(t).With("component", "integration") + dockerClient, err := dockerclient.NewClientWithOpts(dockerclient.WithHost("http://docker.example.com")) + require.NoError(t, err) + + configService := setupConfigService(t, config.Config{Sources: config.Sources{MediaServer: config.MediaServerSource{RTMP: config.RTMPSource{Enabled: true}}}}) + screen, screenCaptureC, getContents := setupSimulationScreen(t) + + client, server := buildClientServer(configService, dockerClient, screen, screenCaptureC, logger) + ch := runClientServer(ctx, t, client, server) + + require.EventuallyWithT( + t, + func(c *assert.CollectT) { + assert.True(c, contentsIncludes(getContents(), "An error occurred:"), "expected to see error message") + assert.True(c, contentsIncludes(getContents(), "Could not connect to Docker. Is Docker installed"), "expected to see message") + }, + waitTime, + time.Second, + "expected to see fatal error modal", + ) + printScreen(t, getContents, "Ater displaying the fatal error modal") + + // Quit the app: + sendKey(t, screen, tcell.KeyEnter, ' ') + + result := <-ch + assert.ErrorContains(t, result.errClient, "context canceled") + assert.ErrorContains(t, result.errServer, "dial tcp: lookup docker.example.com") + assert.ErrorContains(t, result.errServer, "no such host") +} + func TestIntegrationCopyURLs(t *testing.T) { type binding struct { key tcell.Key diff --git a/internal/generated/grpc/api.pb.go b/internal/generated/grpc/api.pb.go index 59f1571..dcc1c10 100644 --- a/internal/generated/grpc/api.pb.go +++ b/internal/generated/grpc/api.pb.go @@ -7,12 +7,11 @@ package grpc import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( @@ -68,7 +67,7 @@ func (x Destination_Status) Number() protoreflect.EnumNumber { // Deprecated: Use Destination_Status.Descriptor instead. func (Destination_Status) EnumDescriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{11, 0} + return file_api_proto_rawDescGZIP(), []int{12, 0} } type Envelope struct { @@ -165,6 +164,7 @@ type Command struct { // *Command_StopDestination // *Command_CloseOtherInstances // *Command_Quit + // *Command_StartInternalStream CommandType isCommand_CommandType `protobuf_oneof:"command_type"` } @@ -249,6 +249,13 @@ func (x *Command) GetQuit() *QuitCommand { return nil } +func (x *Command) GetStartInternalStream() *StartInternalStreamCommand { + if x, ok := x.GetCommandType().(*Command_StartInternalStream); ok { + return x.StartInternalStream + } + return nil +} + type isCommand_CommandType interface { isCommand_CommandType() } @@ -277,6 +284,10 @@ type Command_Quit struct { Quit *QuitCommand `protobuf:"bytes,6,opt,name=quit,proto3,oneof"` } +type Command_StartInternalStream struct { + StartInternalStream *StartInternalStreamCommand `protobuf:"bytes,7,opt,name=start_internal_stream,json=startInternalStream,proto3,oneof"` +} + func (*Command_AddDestination) isCommand_CommandType() {} func (*Command_RemoveDestination) isCommand_CommandType() {} @@ -289,6 +300,8 @@ func (*Command_CloseOtherInstances) isCommand_CommandType() {} func (*Command_Quit) isCommand_CommandType() {} +func (*Command_StartInternalStream) isCommand_CommandType() {} + type AddDestinationCommand struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -561,6 +574,44 @@ func (*QuitCommand) Descriptor() ([]byte, []int) { return file_api_proto_rawDescGZIP(), []int{7} } +type StartInternalStreamCommand struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StartInternalStreamCommand) Reset() { + *x = StartInternalStreamCommand{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartInternalStreamCommand) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartInternalStreamCommand) ProtoMessage() {} + +func (x *StartInternalStreamCommand) ProtoReflect() protoreflect.Message { + mi := &file_api_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 StartInternalStreamCommand.ProtoReflect.Descriptor instead. +func (*StartInternalStreamCommand) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{8} +} + type Event struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -578,13 +629,14 @@ type Event struct { // *Event_MediaServerStarted // *Event_OtherInstanceDetected // *Event_FatalError + // *Event_InternalApiReady EventType isEvent_EventType `protobuf_oneof:"event_type"` } func (x *Event) Reset() { *x = Event{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[8] + mi := &file_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -597,7 +649,7 @@ func (x *Event) String() string { func (*Event) ProtoMessage() {} func (x *Event) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[8] + mi := &file_api_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -610,7 +662,7 @@ func (x *Event) ProtoReflect() protoreflect.Message { // Deprecated: Use Event.ProtoReflect.Descriptor instead. func (*Event) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{8} + return file_api_proto_rawDescGZIP(), []int{9} } func (m *Event) GetEventType() isEvent_EventType { @@ -690,6 +742,13 @@ func (x *Event) GetFatalError() *FatalErrorEvent { return nil } +func (x *Event) GetInternalApiReady() *InternalAPIReadyEvent { + if x, ok := x.GetEventType().(*Event_InternalApiReady); ok { + return x.InternalApiReady + } + return nil +} + type isEvent_EventType interface { isEvent_EventType() } @@ -734,6 +793,10 @@ type Event_FatalError struct { FatalError *FatalErrorEvent `protobuf:"bytes,10,opt,name=fatal_error,json=fatalError,proto3,oneof"` } +type Event_InternalApiReady struct { + InternalApiReady *InternalAPIReadyEvent `protobuf:"bytes,11,opt,name=internal_api_ready,json=internalApiReady,proto3,oneof"` +} + func (*Event_AppStateChanged) isEvent_EventType() {} func (*Event_DestinationStreamExited) isEvent_EventType() {} @@ -754,6 +817,8 @@ func (*Event_OtherInstanceDetected) isEvent_EventType() {} func (*Event_FatalError) isEvent_EventType() {} +func (*Event_InternalApiReady) isEvent_EventType() {} + type Container struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -779,7 +844,7 @@ type Container struct { func (x *Container) Reset() { *x = Container{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[9] + mi := &file_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -792,7 +857,7 @@ func (x *Container) String() string { func (*Container) ProtoMessage() {} func (x *Container) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[9] + mi := &file_api_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -805,7 +870,7 @@ func (x *Container) ProtoReflect() protoreflect.Message { // Deprecated: Use Container.ProtoReflect.Descriptor instead. func (*Container) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{9} + return file_api_proto_rawDescGZIP(), []int{10} } func (x *Container) GetId() string { @@ -928,7 +993,7 @@ type Source struct { func (x *Source) Reset() { *x = Source{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[10] + mi := &file_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -941,7 +1006,7 @@ func (x *Source) String() string { func (*Source) ProtoMessage() {} func (x *Source) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[10] + mi := &file_api_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -954,7 +1019,7 @@ func (x *Source) ProtoReflect() protoreflect.Message { // Deprecated: Use Source.ProtoReflect.Descriptor instead. func (*Source) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{10} + return file_api_proto_rawDescGZIP(), []int{11} } func (x *Source) GetContainer() *Container { @@ -1006,7 +1071,7 @@ type Destination struct { func (x *Destination) Reset() { *x = Destination{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[11] + mi := &file_api_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1019,7 +1084,7 @@ func (x *Destination) String() string { func (*Destination) ProtoMessage() {} func (x *Destination) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[11] + mi := &file_api_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1032,7 +1097,7 @@ func (x *Destination) ProtoReflect() protoreflect.Message { // Deprecated: Use Destination.ProtoReflect.Descriptor instead. func (*Destination) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{11} + return file_api_proto_rawDescGZIP(), []int{12} } func (x *Destination) GetContainer() *Container { @@ -1077,7 +1142,7 @@ type BuildInfo struct { func (x *BuildInfo) Reset() { *x = BuildInfo{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[12] + mi := &file_api_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1090,7 +1155,7 @@ func (x *BuildInfo) String() string { func (*BuildInfo) ProtoMessage() {} func (x *BuildInfo) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[12] + mi := &file_api_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1103,7 +1168,7 @@ func (x *BuildInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildInfo.ProtoReflect.Descriptor instead. func (*BuildInfo) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{12} + return file_api_proto_rawDescGZIP(), []int{13} } func (x *BuildInfo) GetGoVersion() string { @@ -1147,7 +1212,7 @@ type AppState struct { func (x *AppState) Reset() { *x = AppState{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[13] + mi := &file_api_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1160,7 +1225,7 @@ func (x *AppState) String() string { func (*AppState) ProtoMessage() {} func (x *AppState) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[13] + mi := &file_api_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1173,7 +1238,7 @@ func (x *AppState) ProtoReflect() protoreflect.Message { // Deprecated: Use AppState.ProtoReflect.Descriptor instead. func (*AppState) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{13} + return file_api_proto_rawDescGZIP(), []int{14} } func (x *AppState) GetSource() *Source { @@ -1208,7 +1273,7 @@ type AppStateChangedEvent struct { func (x *AppStateChangedEvent) Reset() { *x = AppStateChangedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[14] + mi := &file_api_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1221,7 +1286,7 @@ func (x *AppStateChangedEvent) String() string { func (*AppStateChangedEvent) ProtoMessage() {} func (x *AppStateChangedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[14] + mi := &file_api_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1234,7 +1299,7 @@ func (x *AppStateChangedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use AppStateChangedEvent.ProtoReflect.Descriptor instead. func (*AppStateChangedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{14} + return file_api_proto_rawDescGZIP(), []int{15} } func (x *AppStateChangedEvent) GetAppState() *AppState { @@ -1256,7 +1321,7 @@ type DestinationStreamExitedEvent struct { func (x *DestinationStreamExitedEvent) Reset() { *x = DestinationStreamExitedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[15] + mi := &file_api_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1269,7 +1334,7 @@ func (x *DestinationStreamExitedEvent) String() string { func (*DestinationStreamExitedEvent) ProtoMessage() {} func (x *DestinationStreamExitedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[15] + mi := &file_api_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1282,7 +1347,7 @@ func (x *DestinationStreamExitedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use DestinationStreamExitedEvent.ProtoReflect.Descriptor instead. func (*DestinationStreamExitedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{15} + return file_api_proto_rawDescGZIP(), []int{16} } func (x *DestinationStreamExitedEvent) GetName() string { @@ -1310,7 +1375,7 @@ type DestinationAddedEvent struct { func (x *DestinationAddedEvent) Reset() { *x = DestinationAddedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[16] + mi := &file_api_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1323,7 +1388,7 @@ func (x *DestinationAddedEvent) String() string { func (*DestinationAddedEvent) ProtoMessage() {} func (x *DestinationAddedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[16] + mi := &file_api_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1336,7 +1401,7 @@ func (x *DestinationAddedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use DestinationAddedEvent.ProtoReflect.Descriptor instead. func (*DestinationAddedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{16} + return file_api_proto_rawDescGZIP(), []int{17} } func (x *DestinationAddedEvent) GetUrl() string { @@ -1358,7 +1423,7 @@ type AddDestinationFailedEvent struct { func (x *AddDestinationFailedEvent) Reset() { *x = AddDestinationFailedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[17] + mi := &file_api_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1371,7 +1436,7 @@ func (x *AddDestinationFailedEvent) String() string { func (*AddDestinationFailedEvent) ProtoMessage() {} func (x *AddDestinationFailedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[17] + mi := &file_api_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1384,7 +1449,7 @@ func (x *AddDestinationFailedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use AddDestinationFailedEvent.ProtoReflect.Descriptor instead. func (*AddDestinationFailedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{17} + return file_api_proto_rawDescGZIP(), []int{18} } func (x *AddDestinationFailedEvent) GetUrl() string { @@ -1412,7 +1477,7 @@ type DestinationRemovedEvent struct { func (x *DestinationRemovedEvent) Reset() { *x = DestinationRemovedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[18] + mi := &file_api_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1425,7 +1490,7 @@ func (x *DestinationRemovedEvent) String() string { func (*DestinationRemovedEvent) ProtoMessage() {} func (x *DestinationRemovedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[18] + mi := &file_api_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1438,7 +1503,7 @@ func (x *DestinationRemovedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use DestinationRemovedEvent.ProtoReflect.Descriptor instead. func (*DestinationRemovedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{18} + return file_api_proto_rawDescGZIP(), []int{19} } func (x *DestinationRemovedEvent) GetUrl() string { @@ -1460,7 +1525,7 @@ type RemoveDestinationFailedEvent struct { func (x *RemoveDestinationFailedEvent) Reset() { *x = RemoveDestinationFailedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[19] + mi := &file_api_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1473,7 +1538,7 @@ func (x *RemoveDestinationFailedEvent) String() string { func (*RemoveDestinationFailedEvent) ProtoMessage() {} func (x *RemoveDestinationFailedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[19] + mi := &file_api_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1486,7 +1551,7 @@ func (x *RemoveDestinationFailedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDestinationFailedEvent.ProtoReflect.Descriptor instead. func (*RemoveDestinationFailedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{19} + return file_api_proto_rawDescGZIP(), []int{20} } func (x *RemoveDestinationFailedEvent) GetUrl() string { @@ -1515,7 +1580,7 @@ type StartDestinationFailedEvent struct { func (x *StartDestinationFailedEvent) Reset() { *x = StartDestinationFailedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[20] + mi := &file_api_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1528,7 +1593,7 @@ func (x *StartDestinationFailedEvent) String() string { func (*StartDestinationFailedEvent) ProtoMessage() {} func (x *StartDestinationFailedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[20] + mi := &file_api_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1541,7 +1606,7 @@ func (x *StartDestinationFailedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use StartDestinationFailedEvent.ProtoReflect.Descriptor instead. func (*StartDestinationFailedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{20} + return file_api_proto_rawDescGZIP(), []int{21} } func (x *StartDestinationFailedEvent) GetUrl() string { @@ -1570,7 +1635,7 @@ type MediaServerStartedEvent struct { func (x *MediaServerStartedEvent) Reset() { *x = MediaServerStartedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[21] + mi := &file_api_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1583,7 +1648,7 @@ func (x *MediaServerStartedEvent) String() string { func (*MediaServerStartedEvent) ProtoMessage() {} func (x *MediaServerStartedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[21] + mi := &file_api_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1596,7 +1661,7 @@ func (x *MediaServerStartedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use MediaServerStartedEvent.ProtoReflect.Descriptor instead. func (*MediaServerStartedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{21} + return file_api_proto_rawDescGZIP(), []int{22} } func (x *MediaServerStartedEvent) GetRtmpUrl() string { @@ -1622,7 +1687,7 @@ type OtherInstanceDetectedEvent struct { func (x *OtherInstanceDetectedEvent) Reset() { *x = OtherInstanceDetectedEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[22] + mi := &file_api_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1635,7 +1700,7 @@ func (x *OtherInstanceDetectedEvent) String() string { func (*OtherInstanceDetectedEvent) ProtoMessage() {} func (x *OtherInstanceDetectedEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[22] + mi := &file_api_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1648,7 +1713,7 @@ func (x *OtherInstanceDetectedEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use OtherInstanceDetectedEvent.ProtoReflect.Descriptor instead. func (*OtherInstanceDetectedEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{22} + return file_api_proto_rawDescGZIP(), []int{23} } type FatalErrorEvent struct { @@ -1662,7 +1727,7 @@ type FatalErrorEvent struct { func (x *FatalErrorEvent) Reset() { *x = FatalErrorEvent{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[23] + mi := &file_api_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1675,7 +1740,7 @@ func (x *FatalErrorEvent) String() string { func (*FatalErrorEvent) ProtoMessage() {} func (x *FatalErrorEvent) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[23] + mi := &file_api_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1688,7 +1753,7 @@ func (x *FatalErrorEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use FatalErrorEvent.ProtoReflect.Descriptor instead. func (*FatalErrorEvent) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{23} + return file_api_proto_rawDescGZIP(), []int{24} } func (x *FatalErrorEvent) GetMessage() string { @@ -1698,6 +1763,44 @@ func (x *FatalErrorEvent) GetMessage() string { return "" } +type InternalAPIReadyEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *InternalAPIReadyEvent) Reset() { + *x = InternalAPIReadyEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InternalAPIReadyEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InternalAPIReadyEvent) ProtoMessage() {} + +func (x *InternalAPIReadyEvent) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[25] + 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 InternalAPIReadyEvent.ProtoReflect.Descriptor instead. +func (*InternalAPIReadyEvent) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{25} +} + var File_api_proto protoreflect.FileDescriptor var file_api_proto_rawDesc = []byte{ @@ -1710,7 +1813,7 @@ var file_api_proto_rawDesc = []byte{ 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x22, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xc6, 0x03, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x9d, 0x04, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x45, 0x0a, 0x0f, 0x61, 0x64, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, @@ -1737,198 +1840,211 @@ var file_api_proto_rawDesc = []byte{ 0x48, 0x00, 0x52, 0x13, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x04, 0x71, 0x75, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x51, 0x75, 0x69, 0x74, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x04, 0x71, 0x75, 0x69, 0x74, 0x42, - 0x0e, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, - 0x3d, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x2c, - 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x04, 0x71, 0x75, 0x69, 0x74, 0x12, + 0x55, 0x0a, 0x15, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, + 0x00, 0x52, 0x13, 0x73, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x0e, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3d, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x2c, 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x72, 0x6c, 0x22, 0x2b, 0x0a, 0x17, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x22, 0x2a, 0x0a, 0x16, 0x53, 0x74, 0x6f, 0x70, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x2b, 0x0a, 0x17, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x2a, 0x0a, 0x16, 0x53, 0x74, 0x6f, - 0x70, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x1c, 0x0a, 0x1a, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x4f, 0x74, - 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x22, 0x0d, 0x0a, 0x0b, 0x51, 0x75, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x22, 0xd8, 0x06, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x11, - 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x70, - 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x5f, 0x0a, 0x19, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x65, 0x78, 0x69, 0x74, - 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x45, 0x78, 0x69, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x17, 0x64, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x45, 0x78, 0x69, 0x74, 0x65, 0x64, 0x12, 0x49, 0x0a, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, - 0x10, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x65, - 0x64, 0x12, 0x56, 0x0a, 0x16, 0x61, 0x64, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x14, 0x61, 0x64, 0x64, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x4f, 0x0a, 0x13, 0x64, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x5f, 0x0a, 0x19, 0x72, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x48, 0x00, 0x52, 0x17, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x5c, 0x0a, 0x18, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, - 0x00, 0x52, 0x16, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x50, 0x0a, 0x14, 0x6d, 0x65, 0x64, - 0x69, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, - 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x1c, 0x0a, 0x1a, + 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x0d, 0x0a, 0x0b, 0x51, 0x75, + 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0xa4, 0x07, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x47, 0x0a, 0x11, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x5f, 0x0a, 0x19, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x5f, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x69, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x48, 0x00, 0x52, 0x17, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x69, 0x74, 0x65, 0x64, 0x12, 0x49, 0x0a, 0x11, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x48, 0x00, 0x52, 0x10, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x41, 0x64, 0x64, 0x65, 0x64, 0x12, 0x56, 0x0a, 0x16, 0x61, 0x64, 0x64, 0x5f, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x64, 0x64, + 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x14, 0x61, 0x64, 0x64, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x4f, + 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x12, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, + 0x5f, 0x0a, 0x19, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x17, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x12, 0x5c, 0x0a, 0x18, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x16, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x50, + 0x0a, 0x14, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x12, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x59, 0x0a, 0x17, 0x6f, - 0x74, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x64, 0x65, - 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, - 0x15, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, - 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x66, 0x61, 0x74, 0x61, 0x6c, 0x5f, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x46, 0x61, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x61, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x42, - 0x0c, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0xfd, 0x03, - 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x70, 0x75, 0x5f, 0x70, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x63, 0x70, 0x75, - 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x10, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x55, 0x73, 0x61, 0x67, 0x65, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x78, 0x5f, 0x72, 0x61, 0x74, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x78, 0x52, 0x61, 0x74, 0x65, 0x12, 0x17, - 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x74, 0x78, 0x52, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x78, 0x5f, 0x73, 0x69, - 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x72, 0x78, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x70, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, - 0x0a, 0x0d, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x75, 0x6c, 0x6c, 0x50, - 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, - 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x65, - 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, - 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x10, 0x0a, - 0x03, 0x65, 0x72, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x42, - 0x0c, 0x0a, 0x0a, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xc7, 0x01, - 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, + 0x12, 0x59, 0x0a, 0x17, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x48, 0x00, 0x52, 0x15, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x66, + 0x61, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x61, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x61, 0x74, 0x61, 0x6c, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x4a, 0x0a, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, + 0x50, 0x49, 0x52, 0x65, 0x61, 0x64, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x10, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x70, 0x69, 0x52, 0x65, 0x61, 0x64, 0x79, + 0x42, 0x0c, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0xfd, + 0x03, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x70, 0x75, 0x5f, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x63, 0x70, + 0x75, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x55, 0x73, 0x61, 0x67, + 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x78, 0x5f, 0x72, 0x61, 0x74, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x78, 0x52, 0x61, 0x74, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x74, 0x78, 0x52, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x78, 0x5f, 0x73, + 0x69, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x72, 0x78, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x23, 0x0a, 0x0d, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x75, 0x6c, 0x6c, + 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, + 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, + 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x48, + 0x00, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x10, + 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, + 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xc7, + 0x01, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x76, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x6c, + 0x69, 0x76, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0d, 0x6c, 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x69, 0x74, 0x5f, + 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, + 0x69, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xd6, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x6c, 0x69, - 0x76, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0d, 0x6c, 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x69, - 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xd6, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, - 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x42, 0x0a, 0x06, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x4f, 0x46, 0x46, 0x5f, 0x41, 0x49, 0x52, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, - 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4c, 0x49, 0x56, 0x45, 0x10, 0x02, - 0x22, 0x70, 0x0a, 0x09, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, - 0x0a, 0x67, 0x6f, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x67, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x08, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x23, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x64, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x42, 0x0a, 0x14, 0x41, 0x70, 0x70, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x2a, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x08, 0x61, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x48, 0x0a, - 0x1c, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x45, 0x78, 0x69, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x29, 0x0a, 0x15, 0x44, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x42, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x4f, 0x46, 0x46, 0x5f, 0x41, 0x49, 0x52, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, + 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4c, 0x49, 0x56, 0x45, 0x10, + 0x02, 0x22, 0x70, 0x0a, 0x09, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, + 0x0a, 0x0a, 0x67, 0x6f, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x08, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x23, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x42, 0x0a, 0x14, 0x41, 0x70, + 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x70, 0x70, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x08, 0x61, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x48, + 0x0a, 0x1c, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x45, 0x78, 0x69, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x29, 0x0a, 0x15, 0x44, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x72, 0x6c, 0x22, 0x43, 0x0a, 0x19, 0x41, 0x64, 0x64, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, - 0x72, 0x6c, 0x22, 0x43, 0x0a, 0x19, 0x41, 0x64, 0x64, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, - 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2b, 0x0a, 0x17, 0x44, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x72, 0x6c, 0x22, 0x46, 0x0a, 0x1c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x49, 0x0a, 0x1b, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 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, 0x51, 0x0a, 0x17, 0x4d, 0x65, 0x64, 0x69, 0x61, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x74, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x74, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, - 0x09, 0x72, 0x74, 0x6d, 0x70, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x72, 0x74, 0x6d, 0x70, 0x73, 0x55, 0x72, 0x6c, 0x22, 0x1c, 0x0a, 0x1a, 0x4f, 0x74, - 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x74, 0x65, 0x63, - 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x2b, 0x0a, 0x0f, 0x46, 0x61, 0x74, 0x61, - 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x3e, 0x0a, 0x0b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x41, 0x50, 0x49, 0x12, 0x2f, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, - 0x70, 0x65, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, - 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x2e, 0x6e, 0x65, 0x74, - 0x66, 0x6c, 0x75, 0x78, 0x2e, 0x69, 0x6f, 0x2f, 0x72, 0x6f, 0x62, 0x2f, 0x6f, 0x63, 0x74, 0x6f, - 0x70, 0x6c, 0x65, 0x78, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2b, 0x0a, 0x17, 0x44, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x46, 0x0a, 0x1c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x49, 0x0a, + 0x1b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 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, 0x51, 0x0a, 0x17, 0x4d, 0x65, 0x64, 0x69, + 0x61, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x74, 0x6d, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x74, 0x6d, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x1b, + 0x0a, 0x09, 0x72, 0x74, 0x6d, 0x70, 0x73, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x72, 0x74, 0x6d, 0x70, 0x73, 0x55, 0x72, 0x6c, 0x22, 0x1c, 0x0a, 0x1a, 0x4f, + 0x74, 0x68, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x65, 0x74, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x2b, 0x0a, 0x0f, 0x46, 0x61, 0x74, + 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x41, 0x50, 0x49, 0x52, 0x65, 0x61, 0x64, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x32, + 0x3e, 0x0a, 0x0b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x50, 0x49, 0x12, 0x2f, + 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x0d, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, + 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x66, 0x6c, 0x75, 0x78, 0x2e, 0x69, + 0x6f, 0x2f, 0x72, 0x6f, 0x62, 0x2f, 0x6f, 0x63, 0x74, 0x6f, 0x70, 0x6c, 0x65, 0x78, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x64, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1944,7 +2060,7 @@ func file_api_proto_rawDescGZIP() []byte { } var file_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_api_proto_goTypes = []interface{}{ (Destination_Status)(0), // 0: api.Destination.Status (*Envelope)(nil), // 1: api.Envelope @@ -1955,59 +2071,63 @@ var file_api_proto_goTypes = []interface{}{ (*StopDestinationCommand)(nil), // 6: api.StopDestinationCommand (*CloseOtherInstancesCommand)(nil), // 7: api.CloseOtherInstancesCommand (*QuitCommand)(nil), // 8: api.QuitCommand - (*Event)(nil), // 9: api.Event - (*Container)(nil), // 10: api.Container - (*Source)(nil), // 11: api.Source - (*Destination)(nil), // 12: api.Destination - (*BuildInfo)(nil), // 13: api.BuildInfo - (*AppState)(nil), // 14: api.AppState - (*AppStateChangedEvent)(nil), // 15: api.AppStateChangedEvent - (*DestinationStreamExitedEvent)(nil), // 16: api.DestinationStreamExitedEvent - (*DestinationAddedEvent)(nil), // 17: api.DestinationAddedEvent - (*AddDestinationFailedEvent)(nil), // 18: api.AddDestinationFailedEvent - (*DestinationRemovedEvent)(nil), // 19: api.DestinationRemovedEvent - (*RemoveDestinationFailedEvent)(nil), // 20: api.RemoveDestinationFailedEvent - (*StartDestinationFailedEvent)(nil), // 21: api.StartDestinationFailedEvent - (*MediaServerStartedEvent)(nil), // 22: api.MediaServerStartedEvent - (*OtherInstanceDetectedEvent)(nil), // 23: api.OtherInstanceDetectedEvent - (*FatalErrorEvent)(nil), // 24: api.FatalErrorEvent - (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp + (*StartInternalStreamCommand)(nil), // 9: api.StartInternalStreamCommand + (*Event)(nil), // 10: api.Event + (*Container)(nil), // 11: api.Container + (*Source)(nil), // 12: api.Source + (*Destination)(nil), // 13: api.Destination + (*BuildInfo)(nil), // 14: api.BuildInfo + (*AppState)(nil), // 15: api.AppState + (*AppStateChangedEvent)(nil), // 16: api.AppStateChangedEvent + (*DestinationStreamExitedEvent)(nil), // 17: api.DestinationStreamExitedEvent + (*DestinationAddedEvent)(nil), // 18: api.DestinationAddedEvent + (*AddDestinationFailedEvent)(nil), // 19: api.AddDestinationFailedEvent + (*DestinationRemovedEvent)(nil), // 20: api.DestinationRemovedEvent + (*RemoveDestinationFailedEvent)(nil), // 21: api.RemoveDestinationFailedEvent + (*StartDestinationFailedEvent)(nil), // 22: api.StartDestinationFailedEvent + (*MediaServerStartedEvent)(nil), // 23: api.MediaServerStartedEvent + (*OtherInstanceDetectedEvent)(nil), // 24: api.OtherInstanceDetectedEvent + (*FatalErrorEvent)(nil), // 25: api.FatalErrorEvent + (*InternalAPIReadyEvent)(nil), // 26: api.InternalAPIReadyEvent + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp } var file_api_proto_depIdxs = []int32{ 2, // 0: api.Envelope.command:type_name -> api.Command - 9, // 1: api.Envelope.event:type_name -> api.Event + 10, // 1: api.Envelope.event:type_name -> api.Event 3, // 2: api.Command.add_destination:type_name -> api.AddDestinationCommand 4, // 3: api.Command.remove_destination:type_name -> api.RemoveDestinationCommand 5, // 4: api.Command.start_destination:type_name -> api.StartDestinationCommand 6, // 5: api.Command.stop_destination:type_name -> api.StopDestinationCommand 7, // 6: api.Command.close_other_instances:type_name -> api.CloseOtherInstancesCommand 8, // 7: api.Command.quit:type_name -> api.QuitCommand - 15, // 8: api.Event.app_state_changed:type_name -> api.AppStateChangedEvent - 16, // 9: api.Event.destination_stream_exited:type_name -> api.DestinationStreamExitedEvent - 17, // 10: api.Event.destination_added:type_name -> api.DestinationAddedEvent - 18, // 11: api.Event.add_destination_failed:type_name -> api.AddDestinationFailedEvent - 19, // 12: api.Event.destination_removed:type_name -> api.DestinationRemovedEvent - 20, // 13: api.Event.remove_destination_failed:type_name -> api.RemoveDestinationFailedEvent - 21, // 14: api.Event.start_destination_failed:type_name -> api.StartDestinationFailedEvent - 22, // 15: api.Event.media_server_started:type_name -> api.MediaServerStartedEvent - 23, // 16: api.Event.other_instance_detected:type_name -> api.OtherInstanceDetectedEvent - 24, // 17: api.Event.fatal_error:type_name -> api.FatalErrorEvent - 25, // 18: api.Container.rx_since:type_name -> google.protobuf.Timestamp - 10, // 19: api.Source.container:type_name -> api.Container - 25, // 20: api.Source.live_changed_at:type_name -> google.protobuf.Timestamp - 10, // 21: api.Destination.container:type_name -> api.Container - 0, // 22: api.Destination.status:type_name -> api.Destination.Status - 11, // 23: api.AppState.source:type_name -> api.Source - 12, // 24: api.AppState.destinations:type_name -> api.Destination - 13, // 25: api.AppState.build_info:type_name -> api.BuildInfo - 14, // 26: api.AppStateChangedEvent.app_state:type_name -> api.AppState - 1, // 27: api.InternalAPI.Communicate:input_type -> api.Envelope - 1, // 28: api.InternalAPI.Communicate:output_type -> api.Envelope - 28, // [28:29] is the sub-list for method output_type - 27, // [27:28] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name + 9, // 8: api.Command.start_internal_stream:type_name -> api.StartInternalStreamCommand + 16, // 9: api.Event.app_state_changed:type_name -> api.AppStateChangedEvent + 17, // 10: api.Event.destination_stream_exited:type_name -> api.DestinationStreamExitedEvent + 18, // 11: api.Event.destination_added:type_name -> api.DestinationAddedEvent + 19, // 12: api.Event.add_destination_failed:type_name -> api.AddDestinationFailedEvent + 20, // 13: api.Event.destination_removed:type_name -> api.DestinationRemovedEvent + 21, // 14: api.Event.remove_destination_failed:type_name -> api.RemoveDestinationFailedEvent + 22, // 15: api.Event.start_destination_failed:type_name -> api.StartDestinationFailedEvent + 23, // 16: api.Event.media_server_started:type_name -> api.MediaServerStartedEvent + 24, // 17: api.Event.other_instance_detected:type_name -> api.OtherInstanceDetectedEvent + 25, // 18: api.Event.fatal_error:type_name -> api.FatalErrorEvent + 26, // 19: api.Event.internal_api_ready:type_name -> api.InternalAPIReadyEvent + 27, // 20: api.Container.rx_since:type_name -> google.protobuf.Timestamp + 11, // 21: api.Source.container:type_name -> api.Container + 27, // 22: api.Source.live_changed_at:type_name -> google.protobuf.Timestamp + 11, // 23: api.Destination.container:type_name -> api.Container + 0, // 24: api.Destination.status:type_name -> api.Destination.Status + 12, // 25: api.AppState.source:type_name -> api.Source + 13, // 26: api.AppState.destinations:type_name -> api.Destination + 14, // 27: api.AppState.build_info:type_name -> api.BuildInfo + 15, // 28: api.AppStateChangedEvent.app_state:type_name -> api.AppState + 1, // 29: api.InternalAPI.Communicate:input_type -> api.Envelope + 1, // 30: api.InternalAPI.Communicate:output_type -> api.Envelope + 30, // [30:31] is the sub-list for method output_type + 29, // [29:30] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_api_proto_init() } @@ -2113,7 +2233,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Event); i { + switch v := v.(*StartInternalStreamCommand); i { case 0: return &v.state case 1: @@ -2125,7 +2245,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Container); i { + switch v := v.(*Event); i { case 0: return &v.state case 1: @@ -2137,7 +2257,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Source); i { + switch v := v.(*Container); i { case 0: return &v.state case 1: @@ -2149,7 +2269,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Destination); i { + switch v := v.(*Source); i { case 0: return &v.state case 1: @@ -2161,7 +2281,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BuildInfo); i { + switch v := v.(*Destination); i { case 0: return &v.state case 1: @@ -2173,7 +2293,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AppState); i { + switch v := v.(*BuildInfo); i { case 0: return &v.state case 1: @@ -2185,7 +2305,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AppStateChangedEvent); i { + switch v := v.(*AppState); i { case 0: return &v.state case 1: @@ -2197,7 +2317,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DestinationStreamExitedEvent); i { + switch v := v.(*AppStateChangedEvent); i { case 0: return &v.state case 1: @@ -2209,7 +2329,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DestinationAddedEvent); i { + switch v := v.(*DestinationStreamExitedEvent); i { case 0: return &v.state case 1: @@ -2221,7 +2341,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddDestinationFailedEvent); i { + switch v := v.(*DestinationAddedEvent); i { case 0: return &v.state case 1: @@ -2233,7 +2353,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DestinationRemovedEvent); i { + switch v := v.(*AddDestinationFailedEvent); i { case 0: return &v.state case 1: @@ -2245,7 +2365,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveDestinationFailedEvent); i { + switch v := v.(*DestinationRemovedEvent); i { case 0: return &v.state case 1: @@ -2257,7 +2377,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartDestinationFailedEvent); i { + switch v := v.(*RemoveDestinationFailedEvent); i { case 0: return &v.state case 1: @@ -2269,7 +2389,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaServerStartedEvent); i { + switch v := v.(*StartDestinationFailedEvent); i { case 0: return &v.state case 1: @@ -2281,7 +2401,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OtherInstanceDetectedEvent); i { + switch v := v.(*MediaServerStartedEvent); i { case 0: return &v.state case 1: @@ -2293,6 +2413,18 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OtherInstanceDetectedEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FatalErrorEvent); i { case 0: return &v.state @@ -2304,6 +2436,18 @@ func file_api_proto_init() { return nil } } + file_api_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InternalAPIReadyEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_api_proto_msgTypes[0].OneofWrappers = []interface{}{ (*Envelope_Command)(nil), @@ -2316,8 +2460,9 @@ func file_api_proto_init() { (*Command_StopDestination)(nil), (*Command_CloseOtherInstances)(nil), (*Command_Quit)(nil), + (*Command_StartInternalStream)(nil), } - file_api_proto_msgTypes[8].OneofWrappers = []interface{}{ + file_api_proto_msgTypes[9].OneofWrappers = []interface{}{ (*Event_AppStateChanged)(nil), (*Event_DestinationStreamExited)(nil), (*Event_DestinationAdded)(nil), @@ -2328,15 +2473,16 @@ func file_api_proto_init() { (*Event_MediaServerStarted)(nil), (*Event_OtherInstanceDetected)(nil), (*Event_FatalError)(nil), + (*Event_InternalApiReady)(nil), } - file_api_proto_msgTypes[9].OneofWrappers = []interface{}{} + file_api_proto_msgTypes[10].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_proto_rawDesc, NumEnums: 1, - NumMessages: 24, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, diff --git a/internal/server/grpc.go b/internal/server/grpc.go index 1c68bba..16d1f7c 100644 --- a/internal/server/grpc.go +++ b/internal/server/grpc.go @@ -7,6 +7,7 @@ import ( "io" "log/slog" "sync" + "time" "git.netflux.io/rob/octoplex/internal/event" pb "git.netflux.io/rob/octoplex/internal/generated/grpc" @@ -29,6 +30,7 @@ type Server struct { mu sync.Mutex clientCount int + clientC chan struct{} } // newServer creates a new gRPC server. @@ -40,6 +42,7 @@ func newServer( return &Server{ dispatcher: dispatcher, bus: bus, + clientC: make(chan struct{}, 1), logger: logger.With("component", "server"), } } @@ -47,6 +50,24 @@ func newServer( func (s *Server) Communicate(stream pb.InternalAPI_CommunicateServer) error { g, ctx := errgroup.WithContext(stream.Context()) + // perform handshake: + if err := stream.Send(&pb.Envelope{Payload: &pb.Envelope_Event{Event: &pb.Event{EventType: &pb.Event_InternalApiReady{}}}}); err != nil { + return fmt.Errorf("send ready event: %w", err) + } + startStreamCmd, err := stream.Recv() + if err != nil { + return fmt.Errorf("receive start stream command: %w", err) + } + if startStreamCmd.GetCommand() == nil || startStreamCmd.GetCommand().GetStartInternalStream() == nil { + return fmt.Errorf("expected start stream command but got: %T", startStreamCmd) + } + + // Notify that a client has connected and completed the handshake. + select { + case s.clientC <- struct{}{}: + default: + } + g.Go(func() error { eventsC := s.bus.Register() defer s.bus.Deregister(eventsC) @@ -113,3 +134,18 @@ func (s *Server) GetClientCount() int { return s.clientCount } + +const waitForClientTimeout = 10 * time.Second + +// WaitForClient waits for _any_ client to connect and complete the handshake. +// It times out if no client has connected after 10 seconds. +func (s *Server) WaitForClient(ctx context.Context) error { + select { + case <-s.clientC: + return nil + case <-time.After(waitForClientTimeout): + return errors.New("timeout") + case <-ctx.Done(): + return ctx.Err() + } +} diff --git a/internal/server/protocol.go b/internal/server/protocol.go deleted file mode 100644 index abb4e43..0000000 --- a/internal/server/protocol.go +++ /dev/null @@ -1 +0,0 @@ -package server diff --git a/internal/server/serverapp.go b/internal/server/serverapp.go index 7e1f63d..675c241 100644 --- a/internal/server/serverapp.go +++ b/internal/server/serverapp.go @@ -29,6 +29,7 @@ type App struct { eventBus *event.Bus dispatchC chan event.Command dockerClient container.DockerClient + waitForClient bool logger *slog.Logger } @@ -38,6 +39,7 @@ type Params struct { DockerClient container.DockerClient ChanSize int ConfigFilePath string + WaitForClient bool Logger *slog.Logger } @@ -52,6 +54,7 @@ func New(params Params) *App { eventBus: event.NewBus(params.Logger.With("component", "event_bus")), dispatchC: make(chan event.Command, cmp.Or(params.ChanSize, defaultChanSize)), dockerClient: params.DockerClient, + waitForClient: params.WaitForClient, logger: params.Logger, } } @@ -83,6 +86,12 @@ func (a *App) Run(ctx context.Context) error { grpcDone <- grpcServer.Serve(lis) }() + if a.waitForClient { + if err = internalAPI.WaitForClient(ctx); err != nil { + return fmt.Errorf("wait for client: %w", err) + } + } + // emptyUI is a dummy function that sets the UI state to an empty state, and // re-renders the screen. // diff --git a/main.go b/main.go index fea522d..4696a94 100644 --- a/main.go +++ b/main.go @@ -32,12 +32,16 @@ var ( date string ) +// errInterrupt is an error type that indicates an interrupt signal was +// received. type errInterrupt struct{} +// Error implements the error interface. func (e errInterrupt) Error() string { return "interrupt signal received" } +// ExitCode implements the ExitCoder interface. func (e errInterrupt) ExitCode() int { return 130 } @@ -50,7 +54,6 @@ func main() { { Name: "client", Usage: "Run the client", - Flags: []cli.Flag{ /* client flags */ }, Action: func(c *cli.Context) error { return runClient(c.Context, c) }, @@ -58,15 +61,17 @@ func main() { { Name: "server", Usage: "Run the server", - Flags: []cli.Flag{ /* server flags */ }, Action: func(c *cli.Context) error { - return runServer(c.Context, c, serverConfig{stderrAvailable: true, handleSigInt: true}) + return runServer(c.Context, c, serverConfig{ + stderrAvailable: true, + handleSigInt: true, + waitForClient: false, + }) }, }, { Name: "run", Usage: "Run server and client together (testing)", - Flags: []cli.Flag{ /* optional combined flags */ }, Action: func(c *cli.Context) error { return runClientAndServer(c) }, @@ -124,6 +129,7 @@ func runClient(ctx context.Context, _ *cli.Context) error { type serverConfig struct { stderrAvailable bool handleSigInt bool + waitForClient bool } func runServer(ctx context.Context, _ *cli.Context, serverCfg serverConfig) error { @@ -187,6 +193,7 @@ func runServer(ctx context.Context, _ *cli.Context, serverCfg serverConfig) erro ConfigService: configService, DockerClient: dockerClient, ConfigFilePath: configService.Path(), + WaitForClient: serverCfg.waitForClient, Logger: logger, }) @@ -226,7 +233,11 @@ func runClientAndServer(c *cli.Context) error { }) g.Go(func() error { - if err := runServer(ctx, c, serverConfig{stderrAvailable: false, handleSigInt: false}); err != nil { + if err := runServer(ctx, c, serverConfig{ + stderrAvailable: false, + handleSigInt: false, + waitForClient: true, + }); err != nil { return err } diff --git a/proto/api.proto b/proto/api.proto index c3fba15..c059881 100644 --- a/proto/api.proto +++ b/proto/api.proto @@ -25,6 +25,7 @@ message Command { StopDestinationCommand stop_destination = 4; CloseOtherInstancesCommand close_other_instances = 5; QuitCommand quit = 6; + StartInternalStreamCommand start_internal_stream = 7; } } @@ -49,6 +50,8 @@ message CloseOtherInstancesCommand {} message QuitCommand {} +message StartInternalStreamCommand {} + message Event { oneof event_type { AppStateChangedEvent app_state_changed = 1; @@ -61,6 +64,7 @@ message Event { MediaServerStartedEvent media_server_started = 8; OtherInstanceDetectedEvent other_instance_detected = 9; FatalErrorEvent fatal_error = 10; + InternalAPIReadyEvent internal_api_ready = 11; } } @@ -158,3 +162,5 @@ message OtherInstanceDetectedEvent {} message FatalErrorEvent { string message = 1; } + +message InternalAPIReadyEvent {}