diff --git a/pkg/streamd/api/streamd.go b/pkg/streamd/api/streamd.go index 22e6b33..da39b5f 100644 --- a/pkg/streamd/api/streamd.go +++ b/pkg/streamd/api/streamd.go @@ -32,6 +32,7 @@ type StreamD interface { EndStream(ctx context.Context, platID streamcontrol.PlatformName) error GitRelogin(ctx context.Context) error GetBackendData(ctx context.Context, platID streamcontrol.PlatformName) (any, error) + Restart(ctx context.Context) error } type BackendDataOBS struct{} diff --git a/pkg/streamd/client/client.go b/pkg/streamd/client/client.go index ccce2b8..4a663db 100644 --- a/pkg/streamd/client/client.go +++ b/pkg/streamd/client/client.go @@ -2,27 +2,57 @@ package client import ( "context" + "encoding/json" + "fmt" "net/url" "github.com/xaionaro-go/streamctl/pkg/streamcontrol" "github.com/xaionaro-go/streamctl/pkg/streamd/api" "github.com/xaionaro-go/streamctl/pkg/streamd/config" + "github.com/xaionaro-go/streamctl/pkg/streamd/grpc/go/streamd_grpc" + "google.golang.org/grpc" ) -type Client struct{} +type Client struct { + URL *url.URL +} var _ api.StreamD = (*Client)(nil) func New(url *url.URL) *Client { - panic("not implemented") + return &Client{URL: url} +} + +func (c *Client) grpcClient() (streamd_grpc.StreamDClient, *grpc.ClientConn, error) { + conn, err := grpc.NewClient(c.URL.String()) + if err != nil { + return nil, nil, fmt.Errorf("unable to initialize a gRPC client: %w", err) + } + + client := streamd_grpc.NewStreamDClient(conn) + return client, conn, nil } func (c *Client) FetchConfig(ctx context.Context) error { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + _, err = client.OBSOLETE_FetchConfig(ctx, &streamd_grpc.OBSOLETE_FetchConfigRequest{}) + return err } func (c *Client) InitCache(ctx context.Context) error { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + _, err = client.InitCache(ctx, &streamd_grpc.InitCacheRequest{}) + return err } func (c *Client) SetPlatformConfig( @@ -34,27 +64,94 @@ func (c *Client) SetPlatformConfig( } func (c *Client) SaveConfig(ctx context.Context) error { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + _, err = client.SaveConfig(ctx, &streamd_grpc.SaveConfigRequest{}) + return err } func (c *Client) ResetCache(ctx context.Context) error { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + _, err = client.ResetCache(ctx, &streamd_grpc.ResetCacheRequest{}) + return err } func (c *Client) GetConfig(ctx context.Context) (*config.Config, error) { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return nil, err + } + defer conn.Close() + + reply, err := client.GetConfig(ctx, &streamd_grpc.GetConfigRequest{}) + if err != nil { + return nil, fmt.Errorf("unable to request the config: %w", err) + } + var config config.Config + err = json.Unmarshal([]byte(reply.Config), &config) + if err != nil { + return nil, fmt.Errorf("unable to unserialize the received config: %w", err) + } + return &config, nil } func (c *Client) SetConfig(ctx context.Context, cfg *config.Config) error { - panic("not implemented") + b, err := json.Marshal(cfg) + if err != nil { + return fmt.Errorf("unable to serialize the config: %w", err) + } + + req := &streamd_grpc.SetConfigRequest{ + Config: string(b), + } + + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + _, err = client.SetConfig(ctx, req) + return err } func (c *Client) IsBackendEnabled(ctx context.Context, id streamcontrol.PlatformName) (bool, error) { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return false, err + } + defer conn.Close() + + reply, err := client.GetBackendInfo(ctx, &streamd_grpc.GetBackendInfoRequest{ + PlatID: string(id), + }) + if err != nil { + return false, fmt.Errorf("unable to get backend info: %w", err) + } + return reply.IsInitialized, nil } func (c *Client) IsGITInitialized(ctx context.Context) (bool, error) { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return false, err + } + defer conn.Close() + + reply, err := client.OBSOLETE_GitInfo(ctx, &streamd_grpc.OBSOLETE_GetGitInfoRequest{}) + if err != nil { + return false, fmt.Errorf("unable to get backend info: %w", err) + } + return reply.IsInitialized, nil } func (c *Client) StartStream( @@ -64,16 +161,74 @@ func (c *Client) StartStream( profile streamcontrol.AbstractStreamProfile, customArgs ...any, ) error { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + b, err := json.Marshal(profile) + if err != nil { + return fmt.Errorf("unable to serialize the profile: %w", err) + } + + _, err = client.StartStream(ctx, &streamd_grpc.StartStreamRequest{ + PlatID: string(platID), + Title: title, + Description: description, + Profile: string(b), + }) + if err != nil { + return fmt.Errorf("unable to start the stream: %w", err) + } + + return nil } func (c *Client) EndStream(ctx context.Context, platID streamcontrol.PlatformName) error { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + _, err = client.EndStream(ctx, &streamd_grpc.EndStreamRequest{PlatID: string(platID)}) + if err != nil { + return fmt.Errorf("unable to end the stream: %w", err) + } + + return nil } func (c *Client) GitRelogin(ctx context.Context) error { - panic("not implemented") + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + _, err = client.OBSOLETE_GitRelogin(ctx, &streamd_grpc.OBSOLETE_GitReloginRequest{}) + if err != nil { + return fmt.Errorf("unable force git relogin: %w", err) + } + + return nil } func (c *Client) GetBackendData(ctx context.Context, platID streamcontrol.PlatformName) (any, error) { panic("not implemented") } + +func (c *Client) Restart(ctx context.Context) error { + client, conn, err := c.grpcClient() + if err != nil { + return err + } + defer conn.Close() + + _, err = client.Restart(ctx, &streamd_grpc.RestartRequest{}) + if err != nil { + return fmt.Errorf("unable restart the server: %w", err) + } + + return nil +} diff --git a/pkg/streamd/grpc/Makefile b/pkg/streamd/grpc/Makefile new file mode 100644 index 0000000..cf6c1bd --- /dev/null +++ b/pkg/streamd/grpc/Makefile @@ -0,0 +1,6 @@ + +all: go + +go: + protoc --go_out=. --go-grpc_out=. streamd.proto + diff --git a/pkg/streamd/grpc/go/streamd_grpc/streamd.pb.go b/pkg/streamd/grpc/go/streamd_grpc/streamd.pb.go new file mode 100644 index 0000000..48bdc6d --- /dev/null +++ b/pkg/streamd/grpc/go/streamd_grpc/streamd.pb.go @@ -0,0 +1,1520 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.12 +// source: streamd.proto + +package streamd_grpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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 GetConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetConfigRequest) Reset() { + *x = GetConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConfigRequest) ProtoMessage() {} + +func (x *GetConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 GetConfigRequest.ProtoReflect.Descriptor instead. +func (*GetConfigRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{0} +} + +type GetConfigReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config string `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *GetConfigReply) Reset() { + *x = GetConfigReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConfigReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConfigReply) ProtoMessage() {} + +func (x *GetConfigReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 GetConfigReply.ProtoReflect.Descriptor instead. +func (*GetConfigReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{1} +} + +func (x *GetConfigReply) GetConfig() string { + if x != nil { + return x.Config + } + return "" +} + +type SetConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config string `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *SetConfigRequest) Reset() { + *x = SetConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetConfigRequest) ProtoMessage() {} + +func (x *SetConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 SetConfigRequest.ProtoReflect.Descriptor instead. +func (*SetConfigRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{2} +} + +func (x *SetConfigRequest) GetConfig() string { + if x != nil { + return x.Config + } + return "" +} + +type SetConfigReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetConfigReply) Reset() { + *x = SetConfigReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetConfigReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetConfigReply) ProtoMessage() {} + +func (x *SetConfigReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 SetConfigReply.ProtoReflect.Descriptor instead. +func (*SetConfigReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{3} +} + +type SaveConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SaveConfigRequest) Reset() { + *x = SaveConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveConfigRequest) ProtoMessage() {} + +func (x *SaveConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 SaveConfigRequest.ProtoReflect.Descriptor instead. +func (*SaveConfigRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{4} +} + +type SaveConfigReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SaveConfigReply) Reset() { + *x = SaveConfigReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SaveConfigReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SaveConfigReply) ProtoMessage() {} + +func (x *SaveConfigReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 SaveConfigReply.ProtoReflect.Descriptor instead. +func (*SaveConfigReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{5} +} + +type ResetCacheRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ResetCacheRequest) Reset() { + *x = ResetCacheRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResetCacheRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResetCacheRequest) ProtoMessage() {} + +func (x *ResetCacheRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 ResetCacheRequest.ProtoReflect.Descriptor instead. +func (*ResetCacheRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{6} +} + +type ResetCacheReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ResetCacheReply) Reset() { + *x = ResetCacheReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResetCacheReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResetCacheReply) ProtoMessage() {} + +func (x *ResetCacheReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 ResetCacheReply.ProtoReflect.Descriptor instead. +func (*ResetCacheReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{7} +} + +type InitCacheRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *InitCacheRequest) Reset() { + *x = InitCacheRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitCacheRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitCacheRequest) ProtoMessage() {} + +func (x *InitCacheRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 InitCacheRequest.ProtoReflect.Descriptor instead. +func (*InitCacheRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{8} +} + +type InitCacheReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *InitCacheReply) Reset() { + *x = InitCacheReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitCacheReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitCacheReply) ProtoMessage() {} + +func (x *InitCacheReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 InitCacheReply.ProtoReflect.Descriptor instead. +func (*InitCacheReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{9} +} + +type StartStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlatID string `protobuf:"bytes,1,opt,name=platID,proto3" json:"platID,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Profile string `protobuf:"bytes,4,opt,name=profile,proto3" json:"profile,omitempty"` +} + +func (x *StartStreamRequest) Reset() { + *x = StartStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartStreamRequest) ProtoMessage() {} + +func (x *StartStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[10] + 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 StartStreamRequest.ProtoReflect.Descriptor instead. +func (*StartStreamRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{10} +} + +func (x *StartStreamRequest) GetPlatID() string { + if x != nil { + return x.PlatID + } + return "" +} + +func (x *StartStreamRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *StartStreamRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *StartStreamRequest) GetProfile() string { + if x != nil { + return x.Profile + } + return "" +} + +type StartStreamReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StartStreamReply) Reset() { + *x = StartStreamReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartStreamReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartStreamReply) ProtoMessage() {} + +func (x *StartStreamReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[11] + 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 StartStreamReply.ProtoReflect.Descriptor instead. +func (*StartStreamReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{11} +} + +type EndStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlatID string `protobuf:"bytes,1,opt,name=platID,proto3" json:"platID,omitempty"` +} + +func (x *EndStreamRequest) Reset() { + *x = EndStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EndStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EndStreamRequest) ProtoMessage() {} + +func (x *EndStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[12] + 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 EndStreamRequest.ProtoReflect.Descriptor instead. +func (*EndStreamRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{12} +} + +func (x *EndStreamRequest) GetPlatID() string { + if x != nil { + return x.PlatID + } + return "" +} + +type EndStreamReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EndStreamReply) Reset() { + *x = EndStreamReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EndStreamReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EndStreamReply) ProtoMessage() {} + +func (x *EndStreamReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[13] + 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 EndStreamReply.ProtoReflect.Descriptor instead. +func (*EndStreamReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{13} +} + +type GetBackendInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlatID string `protobuf:"bytes,1,opt,name=platID,proto3" json:"platID,omitempty"` +} + +func (x *GetBackendInfoRequest) Reset() { + *x = GetBackendInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBackendInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBackendInfoRequest) ProtoMessage() {} + +func (x *GetBackendInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[14] + 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 GetBackendInfoRequest.ProtoReflect.Descriptor instead. +func (*GetBackendInfoRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{14} +} + +func (x *GetBackendInfoRequest) GetPlatID() string { + if x != nil { + return x.PlatID + } + return "" +} + +type GetBackendInfoReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsInitialized bool `protobuf:"varint,1,opt,name=isInitialized,proto3" json:"isInitialized,omitempty"` + Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetBackendInfoReply) Reset() { + *x = GetBackendInfoReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBackendInfoReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBackendInfoReply) ProtoMessage() {} + +func (x *GetBackendInfoReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[15] + 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 GetBackendInfoReply.ProtoReflect.Descriptor instead. +func (*GetBackendInfoReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{15} +} + +func (x *GetBackendInfoReply) GetIsInitialized() bool { + if x != nil { + return x.IsInitialized + } + return false +} + +func (x *GetBackendInfoReply) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +type RestartRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RestartRequest) Reset() { + *x = RestartRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RestartRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RestartRequest) ProtoMessage() {} + +func (x *RestartRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[16] + 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 RestartRequest.ProtoReflect.Descriptor instead. +func (*RestartRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{16} +} + +type RestartReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RestartReply) Reset() { + *x = RestartReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RestartReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RestartReply) ProtoMessage() {} + +func (x *RestartReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 RestartReply.ProtoReflect.Descriptor instead. +func (*RestartReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{17} +} + +type OBSOLETE_FetchConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OBSOLETE_FetchConfigRequest) Reset() { + *x = OBSOLETE_FetchConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OBSOLETE_FetchConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OBSOLETE_FetchConfigRequest) ProtoMessage() {} + +func (x *OBSOLETE_FetchConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 OBSOLETE_FetchConfigRequest.ProtoReflect.Descriptor instead. +func (*OBSOLETE_FetchConfigRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{18} +} + +type OBSOLETE_FetchConfigReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OBSOLETE_FetchConfigReply) Reset() { + *x = OBSOLETE_FetchConfigReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OBSOLETE_FetchConfigReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OBSOLETE_FetchConfigReply) ProtoMessage() {} + +func (x *OBSOLETE_FetchConfigReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 OBSOLETE_FetchConfigReply.ProtoReflect.Descriptor instead. +func (*OBSOLETE_FetchConfigReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{19} +} + +type OBSOLETE_GetGitInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OBSOLETE_GetGitInfoRequest) Reset() { + *x = OBSOLETE_GetGitInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OBSOLETE_GetGitInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OBSOLETE_GetGitInfoRequest) ProtoMessage() {} + +func (x *OBSOLETE_GetGitInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 OBSOLETE_GetGitInfoRequest.ProtoReflect.Descriptor instead. +func (*OBSOLETE_GetGitInfoRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{20} +} + +type OBSOLETE_GetGitInfoReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsInitialized bool `protobuf:"varint,1,opt,name=isInitialized,proto3" json:"isInitialized,omitempty"` +} + +func (x *OBSOLETE_GetGitInfoReply) Reset() { + *x = OBSOLETE_GetGitInfoReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OBSOLETE_GetGitInfoReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OBSOLETE_GetGitInfoReply) ProtoMessage() {} + +func (x *OBSOLETE_GetGitInfoReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[21] + 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 OBSOLETE_GetGitInfoReply.ProtoReflect.Descriptor instead. +func (*OBSOLETE_GetGitInfoReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{21} +} + +func (x *OBSOLETE_GetGitInfoReply) GetIsInitialized() bool { + if x != nil { + return x.IsInitialized + } + return false +} + +type OBSOLETE_GitReloginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OBSOLETE_GitReloginRequest) Reset() { + *x = OBSOLETE_GitReloginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OBSOLETE_GitReloginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OBSOLETE_GitReloginRequest) ProtoMessage() {} + +func (x *OBSOLETE_GitReloginRequest) ProtoReflect() protoreflect.Message { + mi := &file_streamd_proto_msgTypes[22] + 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 OBSOLETE_GitReloginRequest.ProtoReflect.Descriptor instead. +func (*OBSOLETE_GitReloginRequest) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{22} +} + +type OBSOLETE_GitReloginReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OBSOLETE_GitReloginReply) Reset() { + *x = OBSOLETE_GitReloginReply{} + if protoimpl.UnsafeEnabled { + mi := &file_streamd_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OBSOLETE_GitReloginReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OBSOLETE_GitReloginReply) ProtoMessage() {} + +func (x *OBSOLETE_GitReloginReply) ProtoReflect() protoreflect.Message { + mi := &file_streamd_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 OBSOLETE_GitReloginReply.ProtoReflect.Descriptor instead. +func (*OBSOLETE_GitReloginReply) Descriptor() ([]byte, []int) { + return file_streamd_proto_rawDescGZIP(), []int{23} +} + +var File_streamd_proto protoreflect.FileDescriptor + +var file_streamd_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x12, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x28, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x2a, 0x0a, + 0x10, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x13, 0x0a, 0x11, 0x53, + 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x11, 0x0a, 0x0f, 0x53, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x65, + 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x12, 0x0a, 0x10, 0x49, + 0x6e, 0x69, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x10, 0x0a, 0x0e, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x22, 0x7e, 0x0a, 0x12, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x74, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x74, 0x49, 0x44, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 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, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2a, 0x0a, 0x10, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, + 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x74, 0x49, + 0x44, 0x22, 0x10, 0x0a, 0x0e, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x2f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, + 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x70, 0x6c, 0x61, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, + 0x61, 0x74, 0x49, 0x44, 0x22, 0x4f, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x69, + 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x4f, 0x42, 0x53, 0x4f, 0x4c, + 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x1b, 0x0a, 0x19, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, + 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x1c, 0x0a, 0x1a, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, + 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x40, 0x0a, 0x18, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65, + 0x74, 0x47, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a, + 0x0d, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, + 0x47, 0x69, 0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x1a, 0x0a, 0x18, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, + 0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xdc, 0x05, + 0x0a, 0x07, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x44, 0x12, 0x31, 0x0a, 0x09, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x11, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, + 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x11, 0x2e, 0x53, 0x65, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x53, + 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x34, 0x0a, 0x0a, 0x53, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x2e, + 0x53, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x10, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, 0x61, + 0x63, 0x68, 0x65, 0x12, 0x12, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x43, + 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x49, + 0x6e, 0x69, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x11, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x43, + 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x49, 0x6e, + 0x69, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x37, + 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x13, 0x2e, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x09, 0x45, 0x6e, 0x64, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x12, 0x11, 0x2e, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0e, 0x47, 0x65, + 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47, + 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, + 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x07, + 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x0f, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x14, 0x4f, 0x42, 0x53, + 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x1c, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, + 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1a, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x46, 0x65, 0x74, 0x63, 0x68, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, + 0x10, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1b, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65, 0x74, + 0x47, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, + 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x13, 0x4f, + 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67, + 0x69, 0x6e, 0x12, 0x1b, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, + 0x74, 0x52, 0x65, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x4f, 0x42, 0x53, 0x4f, 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x47, 0x69, 0x74, 0x52, 0x65, + 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x11, 0x5a, 0x0f, + 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x64, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_streamd_proto_rawDescOnce sync.Once + file_streamd_proto_rawDescData = file_streamd_proto_rawDesc +) + +func file_streamd_proto_rawDescGZIP() []byte { + file_streamd_proto_rawDescOnce.Do(func() { + file_streamd_proto_rawDescData = protoimpl.X.CompressGZIP(file_streamd_proto_rawDescData) + }) + return file_streamd_proto_rawDescData +} + +var file_streamd_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_streamd_proto_goTypes = []interface{}{ + (*GetConfigRequest)(nil), // 0: GetConfigRequest + (*GetConfigReply)(nil), // 1: GetConfigReply + (*SetConfigRequest)(nil), // 2: SetConfigRequest + (*SetConfigReply)(nil), // 3: SetConfigReply + (*SaveConfigRequest)(nil), // 4: SaveConfigRequest + (*SaveConfigReply)(nil), // 5: SaveConfigReply + (*ResetCacheRequest)(nil), // 6: ResetCacheRequest + (*ResetCacheReply)(nil), // 7: ResetCacheReply + (*InitCacheRequest)(nil), // 8: InitCacheRequest + (*InitCacheReply)(nil), // 9: InitCacheReply + (*StartStreamRequest)(nil), // 10: StartStreamRequest + (*StartStreamReply)(nil), // 11: StartStreamReply + (*EndStreamRequest)(nil), // 12: EndStreamRequest + (*EndStreamReply)(nil), // 13: EndStreamReply + (*GetBackendInfoRequest)(nil), // 14: GetBackendInfoRequest + (*GetBackendInfoReply)(nil), // 15: GetBackendInfoReply + (*RestartRequest)(nil), // 16: RestartRequest + (*RestartReply)(nil), // 17: RestartReply + (*OBSOLETE_FetchConfigRequest)(nil), // 18: OBSOLETE_FetchConfigRequest + (*OBSOLETE_FetchConfigReply)(nil), // 19: OBSOLETE_FetchConfigReply + (*OBSOLETE_GetGitInfoRequest)(nil), // 20: OBSOLETE_GetGitInfoRequest + (*OBSOLETE_GetGitInfoReply)(nil), // 21: OBSOLETE_GetGitInfoReply + (*OBSOLETE_GitReloginRequest)(nil), // 22: OBSOLETE_GitReloginRequest + (*OBSOLETE_GitReloginReply)(nil), // 23: OBSOLETE_GitReloginReply +} +var file_streamd_proto_depIdxs = []int32{ + 0, // 0: StreamD.GetConfig:input_type -> GetConfigRequest + 2, // 1: StreamD.SetConfig:input_type -> SetConfigRequest + 4, // 2: StreamD.SaveConfig:input_type -> SaveConfigRequest + 6, // 3: StreamD.ResetCache:input_type -> ResetCacheRequest + 8, // 4: StreamD.InitCache:input_type -> InitCacheRequest + 10, // 5: StreamD.StartStream:input_type -> StartStreamRequest + 12, // 6: StreamD.EndStream:input_type -> EndStreamRequest + 14, // 7: StreamD.GetBackendInfo:input_type -> GetBackendInfoRequest + 16, // 8: StreamD.Restart:input_type -> RestartRequest + 18, // 9: StreamD.OBSOLETE_FetchConfig:input_type -> OBSOLETE_FetchConfigRequest + 20, // 10: StreamD.OBSOLETE_GitInfo:input_type -> OBSOLETE_GetGitInfoRequest + 22, // 11: StreamD.OBSOLETE_GitRelogin:input_type -> OBSOLETE_GitReloginRequest + 1, // 12: StreamD.GetConfig:output_type -> GetConfigReply + 3, // 13: StreamD.SetConfig:output_type -> SetConfigReply + 5, // 14: StreamD.SaveConfig:output_type -> SaveConfigReply + 7, // 15: StreamD.ResetCache:output_type -> ResetCacheReply + 9, // 16: StreamD.InitCache:output_type -> InitCacheReply + 11, // 17: StreamD.StartStream:output_type -> StartStreamReply + 13, // 18: StreamD.EndStream:output_type -> EndStreamReply + 15, // 19: StreamD.GetBackendInfo:output_type -> GetBackendInfoReply + 17, // 20: StreamD.Restart:output_type -> RestartReply + 19, // 21: StreamD.OBSOLETE_FetchConfig:output_type -> OBSOLETE_FetchConfigReply + 21, // 22: StreamD.OBSOLETE_GitInfo:output_type -> OBSOLETE_GetGitInfoReply + 23, // 23: StreamD.OBSOLETE_GitRelogin:output_type -> OBSOLETE_GitReloginReply + 12, // [12:24] is the sub-list for method output_type + 0, // [0:12] 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_streamd_proto_init() } +func file_streamd_proto_init() { + if File_streamd_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_streamd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetConfigReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SaveConfigReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetCacheRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetCacheReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitCacheRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitCacheReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartStreamReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EndStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EndStreamReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBackendInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBackendInfoReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RestartRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RestartReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OBSOLETE_FetchConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OBSOLETE_FetchConfigReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OBSOLETE_GetGitInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OBSOLETE_GetGitInfoReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OBSOLETE_GitReloginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_streamd_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OBSOLETE_GitReloginReply); 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_streamd_proto_rawDesc, + NumEnums: 0, + NumMessages: 24, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_streamd_proto_goTypes, + DependencyIndexes: file_streamd_proto_depIdxs, + MessageInfos: file_streamd_proto_msgTypes, + }.Build() + File_streamd_proto = out.File + file_streamd_proto_rawDesc = nil + file_streamd_proto_goTypes = nil + file_streamd_proto_depIdxs = nil +} diff --git a/pkg/streamd/grpc/go/streamd_grpc/streamd_grpc.pb.go b/pkg/streamd/grpc/go/streamd_grpc/streamd_grpc.pb.go new file mode 100644 index 0000000..0cd44de --- /dev/null +++ b/pkg/streamd/grpc/go/streamd_grpc/streamd_grpc.pb.go @@ -0,0 +1,501 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.12 +// source: streamd.proto + +package streamd_grpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StreamDClient is the client API for StreamD service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StreamDClient interface { + GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigReply, error) + SetConfig(ctx context.Context, in *SetConfigRequest, opts ...grpc.CallOption) (*SetConfigReply, error) + SaveConfig(ctx context.Context, in *SaveConfigRequest, opts ...grpc.CallOption) (*SaveConfigReply, error) + ResetCache(ctx context.Context, in *ResetCacheRequest, opts ...grpc.CallOption) (*ResetCacheReply, error) + InitCache(ctx context.Context, in *InitCacheRequest, opts ...grpc.CallOption) (*InitCacheReply, error) + StartStream(ctx context.Context, in *StartStreamRequest, opts ...grpc.CallOption) (*StartStreamReply, error) + EndStream(ctx context.Context, in *EndStreamRequest, opts ...grpc.CallOption) (*EndStreamReply, error) + GetBackendInfo(ctx context.Context, in *GetBackendInfoRequest, opts ...grpc.CallOption) (*GetBackendInfoReply, error) + Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error) + OBSOLETE_FetchConfig(ctx context.Context, in *OBSOLETE_FetchConfigRequest, opts ...grpc.CallOption) (*OBSOLETE_FetchConfigReply, error) + OBSOLETE_GitInfo(ctx context.Context, in *OBSOLETE_GetGitInfoRequest, opts ...grpc.CallOption) (*OBSOLETE_GetGitInfoReply, error) + OBSOLETE_GitRelogin(ctx context.Context, in *OBSOLETE_GitReloginRequest, opts ...grpc.CallOption) (*OBSOLETE_GitReloginReply, error) +} + +type streamDClient struct { + cc grpc.ClientConnInterface +} + +func NewStreamDClient(cc grpc.ClientConnInterface) StreamDClient { + return &streamDClient{cc} +} + +func (c *streamDClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigReply, error) { + out := new(GetConfigReply) + err := c.cc.Invoke(ctx, "/StreamD/GetConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) SetConfig(ctx context.Context, in *SetConfigRequest, opts ...grpc.CallOption) (*SetConfigReply, error) { + out := new(SetConfigReply) + err := c.cc.Invoke(ctx, "/StreamD/SetConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) SaveConfig(ctx context.Context, in *SaveConfigRequest, opts ...grpc.CallOption) (*SaveConfigReply, error) { + out := new(SaveConfigReply) + err := c.cc.Invoke(ctx, "/StreamD/SaveConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) ResetCache(ctx context.Context, in *ResetCacheRequest, opts ...grpc.CallOption) (*ResetCacheReply, error) { + out := new(ResetCacheReply) + err := c.cc.Invoke(ctx, "/StreamD/ResetCache", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) InitCache(ctx context.Context, in *InitCacheRequest, opts ...grpc.CallOption) (*InitCacheReply, error) { + out := new(InitCacheReply) + err := c.cc.Invoke(ctx, "/StreamD/InitCache", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) StartStream(ctx context.Context, in *StartStreamRequest, opts ...grpc.CallOption) (*StartStreamReply, error) { + out := new(StartStreamReply) + err := c.cc.Invoke(ctx, "/StreamD/StartStream", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) EndStream(ctx context.Context, in *EndStreamRequest, opts ...grpc.CallOption) (*EndStreamReply, error) { + out := new(EndStreamReply) + err := c.cc.Invoke(ctx, "/StreamD/EndStream", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) GetBackendInfo(ctx context.Context, in *GetBackendInfoRequest, opts ...grpc.CallOption) (*GetBackendInfoReply, error) { + out := new(GetBackendInfoReply) + err := c.cc.Invoke(ctx, "/StreamD/GetBackendInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error) { + out := new(RestartReply) + err := c.cc.Invoke(ctx, "/StreamD/Restart", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) OBSOLETE_FetchConfig(ctx context.Context, in *OBSOLETE_FetchConfigRequest, opts ...grpc.CallOption) (*OBSOLETE_FetchConfigReply, error) { + out := new(OBSOLETE_FetchConfigReply) + err := c.cc.Invoke(ctx, "/StreamD/OBSOLETE_FetchConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) OBSOLETE_GitInfo(ctx context.Context, in *OBSOLETE_GetGitInfoRequest, opts ...grpc.CallOption) (*OBSOLETE_GetGitInfoReply, error) { + out := new(OBSOLETE_GetGitInfoReply) + err := c.cc.Invoke(ctx, "/StreamD/OBSOLETE_GitInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamDClient) OBSOLETE_GitRelogin(ctx context.Context, in *OBSOLETE_GitReloginRequest, opts ...grpc.CallOption) (*OBSOLETE_GitReloginReply, error) { + out := new(OBSOLETE_GitReloginReply) + err := c.cc.Invoke(ctx, "/StreamD/OBSOLETE_GitRelogin", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StreamDServer is the server API for StreamD service. +// All implementations must embed UnimplementedStreamDServer +// for forward compatibility +type StreamDServer interface { + GetConfig(context.Context, *GetConfigRequest) (*GetConfigReply, error) + SetConfig(context.Context, *SetConfigRequest) (*SetConfigReply, error) + SaveConfig(context.Context, *SaveConfigRequest) (*SaveConfigReply, error) + ResetCache(context.Context, *ResetCacheRequest) (*ResetCacheReply, error) + InitCache(context.Context, *InitCacheRequest) (*InitCacheReply, error) + StartStream(context.Context, *StartStreamRequest) (*StartStreamReply, error) + EndStream(context.Context, *EndStreamRequest) (*EndStreamReply, error) + GetBackendInfo(context.Context, *GetBackendInfoRequest) (*GetBackendInfoReply, error) + Restart(context.Context, *RestartRequest) (*RestartReply, error) + OBSOLETE_FetchConfig(context.Context, *OBSOLETE_FetchConfigRequest) (*OBSOLETE_FetchConfigReply, error) + OBSOLETE_GitInfo(context.Context, *OBSOLETE_GetGitInfoRequest) (*OBSOLETE_GetGitInfoReply, error) + OBSOLETE_GitRelogin(context.Context, *OBSOLETE_GitReloginRequest) (*OBSOLETE_GitReloginReply, error) + mustEmbedUnimplementedStreamDServer() +} + +// UnimplementedStreamDServer must be embedded to have forward compatible implementations. +type UnimplementedStreamDServer struct { +} + +func (UnimplementedStreamDServer) GetConfig(context.Context, *GetConfigRequest) (*GetConfigReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented") +} +func (UnimplementedStreamDServer) SetConfig(context.Context, *SetConfigRequest) (*SetConfigReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetConfig not implemented") +} +func (UnimplementedStreamDServer) SaveConfig(context.Context, *SaveConfigRequest) (*SaveConfigReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method SaveConfig not implemented") +} +func (UnimplementedStreamDServer) ResetCache(context.Context, *ResetCacheRequest) (*ResetCacheReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResetCache not implemented") +} +func (UnimplementedStreamDServer) InitCache(context.Context, *InitCacheRequest) (*InitCacheReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitCache not implemented") +} +func (UnimplementedStreamDServer) StartStream(context.Context, *StartStreamRequest) (*StartStreamReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartStream not implemented") +} +func (UnimplementedStreamDServer) EndStream(context.Context, *EndStreamRequest) (*EndStreamReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method EndStream not implemented") +} +func (UnimplementedStreamDServer) GetBackendInfo(context.Context, *GetBackendInfoRequest) (*GetBackendInfoReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBackendInfo not implemented") +} +func (UnimplementedStreamDServer) Restart(context.Context, *RestartRequest) (*RestartReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Restart not implemented") +} +func (UnimplementedStreamDServer) OBSOLETE_FetchConfig(context.Context, *OBSOLETE_FetchConfigRequest) (*OBSOLETE_FetchConfigReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method OBSOLETE_FetchConfig not implemented") +} +func (UnimplementedStreamDServer) OBSOLETE_GitInfo(context.Context, *OBSOLETE_GetGitInfoRequest) (*OBSOLETE_GetGitInfoReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method OBSOLETE_GitInfo not implemented") +} +func (UnimplementedStreamDServer) OBSOLETE_GitRelogin(context.Context, *OBSOLETE_GitReloginRequest) (*OBSOLETE_GitReloginReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method OBSOLETE_GitRelogin not implemented") +} +func (UnimplementedStreamDServer) mustEmbedUnimplementedStreamDServer() {} + +// UnsafeStreamDServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StreamDServer will +// result in compilation errors. +type UnsafeStreamDServer interface { + mustEmbedUnimplementedStreamDServer() +} + +func RegisterStreamDServer(s grpc.ServiceRegistrar, srv StreamDServer) { + s.RegisterService(&StreamD_ServiceDesc, srv) +} + +func _StreamD_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).GetConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/GetConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).GetConfig(ctx, req.(*GetConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_SetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).SetConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/SetConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).SetConfig(ctx, req.(*SetConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_SaveConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).SaveConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/SaveConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).SaveConfig(ctx, req.(*SaveConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_ResetCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResetCacheRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).ResetCache(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/ResetCache", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).ResetCache(ctx, req.(*ResetCacheRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_InitCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitCacheRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).InitCache(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/InitCache", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).InitCache(ctx, req.(*InitCacheRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_StartStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartStreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).StartStream(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/StartStream", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).StartStream(ctx, req.(*StartStreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_EndStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EndStreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).EndStream(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/EndStream", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).EndStream(ctx, req.(*EndStreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_GetBackendInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBackendInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).GetBackendInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/GetBackendInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).GetBackendInfo(ctx, req.(*GetBackendInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_Restart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RestartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).Restart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/Restart", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).Restart(ctx, req.(*RestartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_OBSOLETE_FetchConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OBSOLETE_FetchConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).OBSOLETE_FetchConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/OBSOLETE_FetchConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).OBSOLETE_FetchConfig(ctx, req.(*OBSOLETE_FetchConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_OBSOLETE_GitInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OBSOLETE_GetGitInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).OBSOLETE_GitInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/OBSOLETE_GitInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).OBSOLETE_GitInfo(ctx, req.(*OBSOLETE_GetGitInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamD_OBSOLETE_GitRelogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OBSOLETE_GitReloginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamDServer).OBSOLETE_GitRelogin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/StreamD/OBSOLETE_GitRelogin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamDServer).OBSOLETE_GitRelogin(ctx, req.(*OBSOLETE_GitReloginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// StreamD_ServiceDesc is the grpc.ServiceDesc for StreamD service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StreamD_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "StreamD", + HandlerType: (*StreamDServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetConfig", + Handler: _StreamD_GetConfig_Handler, + }, + { + MethodName: "SetConfig", + Handler: _StreamD_SetConfig_Handler, + }, + { + MethodName: "SaveConfig", + Handler: _StreamD_SaveConfig_Handler, + }, + { + MethodName: "ResetCache", + Handler: _StreamD_ResetCache_Handler, + }, + { + MethodName: "InitCache", + Handler: _StreamD_InitCache_Handler, + }, + { + MethodName: "StartStream", + Handler: _StreamD_StartStream_Handler, + }, + { + MethodName: "EndStream", + Handler: _StreamD_EndStream_Handler, + }, + { + MethodName: "GetBackendInfo", + Handler: _StreamD_GetBackendInfo_Handler, + }, + { + MethodName: "Restart", + Handler: _StreamD_Restart_Handler, + }, + { + MethodName: "OBSOLETE_FetchConfig", + Handler: _StreamD_OBSOLETE_FetchConfig_Handler, + }, + { + MethodName: "OBSOLETE_GitInfo", + Handler: _StreamD_OBSOLETE_GitInfo_Handler, + }, + { + MethodName: "OBSOLETE_GitRelogin", + Handler: _StreamD_OBSOLETE_GitRelogin_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "streamd.proto", +} diff --git a/pkg/streamd/grpc/streamd.proto b/pkg/streamd/grpc/streamd.proto new file mode 100644 index 0000000..ae50f2b --- /dev/null +++ b/pkg/streamd/grpc/streamd.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +option go_package = "go/streamd_grpc"; + +service StreamD { + rpc GetConfig(GetConfigRequest) returns (GetConfigReply) {} + rpc SetConfig(SetConfigRequest) returns (SetConfigReply) {} + rpc SaveConfig(SaveConfigRequest) returns (SaveConfigReply) {} + rpc ResetCache(ResetCacheRequest) returns (ResetCacheReply) {} + rpc InitCache(InitCacheRequest) returns (InitCacheReply) {} + rpc StartStream(StartStreamRequest) returns (StartStreamReply) {} + rpc EndStream(EndStreamRequest) returns (EndStreamReply) {} + rpc GetBackendInfo(GetBackendInfoRequest) returns (GetBackendInfoReply) {} + rpc Restart(RestartRequest) returns (RestartReply) {} + + rpc OBSOLETE_FetchConfig(OBSOLETE_FetchConfigRequest) returns (OBSOLETE_FetchConfigReply) {} + rpc OBSOLETE_GitInfo(OBSOLETE_GetGitInfoRequest) returns (OBSOLETE_GetGitInfoReply) {} + rpc OBSOLETE_GitRelogin(OBSOLETE_GitReloginRequest) returns (OBSOLETE_GitReloginReply) {} +} + +message GetConfigRequest {} +message GetConfigReply { + string config = 1; +} +message SetConfigRequest { + string config = 1; +} +message SetConfigReply {} +message SaveConfigRequest {} +message SaveConfigReply {} +message ResetCacheRequest {} +message ResetCacheReply {} +message InitCacheRequest {} +message InitCacheReply {} +message StartStreamRequest { + string platID = 1; + string title = 2; + string description = 3; + string profile = 4; +} +message StartStreamReply {} +message EndStreamRequest { + string platID = 1; +} +message EndStreamReply {} +message GetBackendInfoRequest { + string platID = 1; +} +message GetBackendInfoReply { + bool isInitialized = 1; + string data = 2; +} +message RestartRequest {} +message RestartReply {} + +message OBSOLETE_FetchConfigRequest {} +message OBSOLETE_FetchConfigReply {} +message OBSOLETE_GetGitInfoRequest {} +message OBSOLETE_GetGitInfoReply { + bool isInitialized = 1; +} +message OBSOLETE_GitReloginRequest {} +message OBSOLETE_GitReloginReply {} + diff --git a/pkg/streamd/server/grpc.go b/pkg/streamd/server/grpc.go new file mode 100644 index 0000000..b88fb2d --- /dev/null +++ b/pkg/streamd/server/grpc.go @@ -0,0 +1,213 @@ +package server + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/xaionaro-go/streamctl/pkg/streamcontrol" + "github.com/xaionaro-go/streamctl/pkg/streamcontrol/obs" + "github.com/xaionaro-go/streamctl/pkg/streamcontrol/twitch" + "github.com/xaionaro-go/streamctl/pkg/streamcontrol/youtube" + "github.com/xaionaro-go/streamctl/pkg/streamd/api" + "github.com/xaionaro-go/streamctl/pkg/streamd/config" + "github.com/xaionaro-go/streamctl/pkg/streamd/grpc/go/streamd_grpc" +) + +type GRPCServer struct { + streamd_grpc.StreamDServer + StreamD api.StreamD +} + +var _ streamd_grpc.StreamDServer = (*GRPCServer)(nil) + +func NewGRPCServer(streamd api.StreamD) *GRPCServer { + return &GRPCServer{ + StreamD: streamd, + } +} + +func (grpc *GRPCServer) GetConfig( + ctx context.Context, + req *streamd_grpc.GetConfigRequest, +) (*streamd_grpc.GetConfigReply, error) { + config, err := grpc.StreamD.GetConfig(ctx) + if err != nil { + return nil, fmt.Errorf("unable to get the config: %w", err) + } + b, err := json.Marshal(config) + if err != nil { + return nil, fmt.Errorf("unable to serialize the config: %w", err) + } + return &streamd_grpc.GetConfigReply{ + Config: string(b), + }, nil +} + +func (grpc *GRPCServer) SetConfig( + ctx context.Context, + req *streamd_grpc.SetConfigRequest, +) (*streamd_grpc.SetConfigReply, error) { + var config config.Config + err := json.Unmarshal([]byte(req.Config), &config) + if err != nil { + return nil, fmt.Errorf("unable to unserialize the config: %w", err) + } + + err = grpc.StreamD.SetConfig(ctx, &config) + if err != nil { + return nil, fmt.Errorf("unable to set the config: %w", err) + } + + return &streamd_grpc.SetConfigReply{}, nil +} + +func (grpc *GRPCServer) SaveConfig( + ctx context.Context, + req *streamd_grpc.SaveConfigRequest, +) (*streamd_grpc.SaveConfigReply, error) { + err := grpc.StreamD.SaveConfig(ctx) + if err != nil { + return nil, fmt.Errorf("unable to save the config: %w", err) + } + return &streamd_grpc.SaveConfigReply{}, nil +} + +func (grpc *GRPCServer) ResetCache( + ctx context.Context, + req *streamd_grpc.ResetCacheRequest, +) (*streamd_grpc.ResetCacheReply, error) { + err := grpc.StreamD.ResetCache(ctx) + if err != nil { + return nil, fmt.Errorf("unable to reset the cache: %w", err) + } + return &streamd_grpc.ResetCacheReply{}, nil +} + +func (grpc *GRPCServer) InitCache( + ctx context.Context, + req *streamd_grpc.InitCacheRequest, +) (*streamd_grpc.InitCacheReply, error) { + err := grpc.StreamD.InitCache(ctx) + if err != nil { + return nil, fmt.Errorf("unable to init the cache: %w", err) + } + return &streamd_grpc.InitCacheReply{}, nil +} + +func (grpc *GRPCServer) StartStream( + ctx context.Context, + req *streamd_grpc.StartStreamRequest, +) (*streamd_grpc.StartStreamReply, error) { + var profile streamcontrol.AbstractStreamProfile + var err error + platID := streamcontrol.PlatformName(req.GetPlatID()) + switch platID { + case obs.ID: + profile = &obs.StreamProfile{} + case twitch.ID: + profile = &twitch.StreamProfile{} + case youtube.ID: + profile = &youtube.StreamProfile{} + default: + return nil, fmt.Errorf("unexpected platform ID: '%s'", platID) + } + err = json.Unmarshal([]byte(req.GetProfile()), &profile) + if err != nil { + return nil, fmt.Errorf("unable to unserialize the profile: %w", err) + } + + err = grpc.StreamD.StartStream( + ctx, + platID, + req.GetTitle(), + req.GetDescription(), + profile, + ) + if err != nil { + return nil, fmt.Errorf("unable to start the stream: %w", err) + } + + return &streamd_grpc.StartStreamReply{}, nil +} + +func (grpc *GRPCServer) EndStream( + ctx context.Context, + req *streamd_grpc.EndStreamRequest, +) (*streamd_grpc.EndStreamReply, error) { + err := grpc.StreamD.EndStream(ctx, streamcontrol.PlatformName(req.GetPlatID())) + if err != nil { + return nil, fmt.Errorf("unable to end the stream: %w", err) + } + return &streamd_grpc.EndStreamReply{}, nil +} + +func (grpc *GRPCServer) GetBackendInfo( + ctx context.Context, + req *streamd_grpc.GetBackendInfoRequest, +) (*streamd_grpc.GetBackendInfoReply, error) { + platID := streamcontrol.PlatformName(req.GetPlatID()) + isEnabled, err := grpc.StreamD.IsBackendEnabled(ctx, platID) + if err != nil { + return nil, fmt.Errorf("unable to check if the backend is enabled: %w", err) + } + data, err := grpc.StreamD.GetBackendData(ctx, platID) + if err != nil { + return nil, fmt.Errorf("unable to get the backend info: %w", err) + } + dataSerialized, err := json.Marshal(data) + if err != nil { + return nil, fmt.Errorf("unable to serialize the backend info: %w", err) + } + + return &streamd_grpc.GetBackendInfoReply{ + IsInitialized: isEnabled, + Data: string(dataSerialized), + }, nil +} + +func (grpc *GRPCServer) Restart( + ctx context.Context, + req *streamd_grpc.RestartRequest, +) (*streamd_grpc.RestartReply, error) { + err := grpc.StreamD.Restart(ctx) + if err != nil { + return nil, fmt.Errorf("unable to restart: %w", err) + } + return &streamd_grpc.RestartReply{}, nil +} + +func (grpc *GRPCServer) OBSOLETE_FetchConfig( + ctx context.Context, + req *streamd_grpc.OBSOLETE_FetchConfigRequest, +) (*streamd_grpc.OBSOLETE_FetchConfigReply, error) { + err := grpc.StreamD.FetchConfig(ctx) + if err != nil { + return nil, fmt.Errorf("unable to fetch the config: %w", err) + } + return &streamd_grpc.OBSOLETE_FetchConfigReply{}, nil +} + +func (grpc *GRPCServer) OBSOLETE_GitInfo( + ctx context.Context, + req *streamd_grpc.OBSOLETE_GetGitInfoRequest, +) (*streamd_grpc.OBSOLETE_GetGitInfoReply, error) { + isEnabled, err := grpc.StreamD.IsGITInitialized(ctx) + if err != nil { + return nil, fmt.Errorf("unable to get the git info: %w", err) + } + return &streamd_grpc.OBSOLETE_GetGitInfoReply{ + IsInitialized: isEnabled, + }, nil +} + +func (grpc *GRPCServer) OBSOLETE_GitRelogin( + ctx context.Context, + req *streamd_grpc.OBSOLETE_GitReloginRequest, +) (*streamd_grpc.OBSOLETE_GitReloginReply, error) { + err := grpc.StreamD.GitRelogin(ctx) + if err != nil { + return nil, fmt.Errorf("unable to relogin: %w", err) + } + return &streamd_grpc.OBSOLETE_GitReloginReply{}, nil +} diff --git a/pkg/streamd/streamd.go b/pkg/streamd/streamd.go index a29e7a5..0274086 100644 --- a/pkg/streamd/streamd.go +++ b/pkg/streamd/streamd.go @@ -401,3 +401,8 @@ func (d *StreamD) GetBackendData(ctx context.Context, platID streamcontrol.Platf return nil, fmt.Errorf("unexpected platform ID '%s'", platID) } } + +func (d *StreamD) Restart(ctx context.Context) error { + d.UI.Restart(ctx, "A restart was requested") + return nil +}