diff --git a/api.go b/api.go index 6e64d1e..19cf199 100644 --- a/api.go +++ b/api.go @@ -2,6 +2,7 @@ package m7s import ( "context" + "encoding/json" "errors" "net" "net/http" @@ -14,8 +15,10 @@ import ( . "github.com/shirou/gopsutil/v3/net" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" + "gopkg.in/yaml.v3" "m7s.live/m7s/v5/pb" "m7s.live/m7s/v5/pkg" + "m7s.live/m7s/v5/pkg/config" "m7s.live/m7s/v5/pkg/util" ) @@ -74,13 +77,29 @@ func (s *Server) StopSubscribe(ctx context.Context, req *pb.StopSubscribeRequest Success: err == nil, }, err } - +// /api/stream/list func (s *Server) StreamList(_ context.Context, req *pb.StreamListRequest) (res *pb.StreamListResponse, err error) { s.Call(func() { var streams []*pb.StreamSummay for _, publisher := range s.Streams.Items { + var tracks []string + var bps int32 + if !publisher.VideoTrack.IsEmpty() { + bps += int32(publisher.VideoTrack.AVTrack.BPS) + tracks = append(tracks, publisher.VideoTrack.FourCC().String()) + } + if !publisher.AudioTrack.IsEmpty() { + bps += int32(publisher.AudioTrack.AVTrack.BPS) + tracks = append(tracks, publisher.AudioTrack.FourCC().String()) + } streams = append(streams, &pb.StreamSummay{ Path: publisher.StreamPath, + State: int32(publisher.State), + StartTime: timestamppb.New(publisher.StartTime), + Subscribers: int32(len(publisher.Subscribers)), + Tracks: tracks, + Bps: bps, + Type: publisher.Plugin.Meta.Name, }) } res = &pb.StreamListResponse{List: streams, Total: int32(s.Streams.Length), PageNum: req.PageNum, PageSize: req.PageSize} @@ -142,3 +161,81 @@ func (s *Server) Summary(context.Context, *emptypb.Empty) (res *pb.SummaryRespon }) return } + +// /api/config/json/{name} +func (s *Server) api_Config_JSON_(rw http.ResponseWriter, r *http.Request) { + name := r.PathValue("name") + var conf *config.Config + if name == "global" { + conf = &s.Config + } else { + p, ok := s.Plugins.Get(name) + if !ok { + http.Error(rw, pkg.ErrNotFound.Error(), http.StatusNotFound) + return + } + conf = &p.Config + } + rw.Header().Set("Content-Type", "application/json") + err := json.NewEncoder(rw).Encode(conf.GetMap()) + if err != nil { + http.Error(rw, err.Error(), http.StatusInternalServerError) + } +} + +func (s *Server) GetConfig(_ context.Context, req *pb.GetConfigRequest) (res *pb.GetConfigResponse, err error) { + res = &pb.GetConfigResponse{} + var conf *config.Config + if req.Name == "global" { + conf = &s.Config + } else { + p, ok := s.Plugins.Get(req.Name) + if !ok { + err = pkg.ErrNotFound + return + } + conf = &p.Config + } + var mm []byte + mm, err = yaml.Marshal(conf.File) + if err != nil { + return + } + res.File = string(mm) + + mm, err = yaml.Marshal(conf.Modify) + if err != nil { + return + } + res.Modified = string(mm) + + mm, err = yaml.Marshal(conf.GetMap()) + if err != nil { + return + } + res.Merged = string(mm) + return +} + +func (s *Server) ModifyConfig(_ context.Context, req *pb.ModifyConfigRequest) (res *pb.ModifyConfigResponse, err error) { + var conf *config.Config + if req.Name == "global" { + conf = &s.Config + defer s.SaveConfig() + } else { + p, ok := s.Plugins.Get(req.Name) + if !ok { + err = pkg.ErrNotFound + return + } + defer p.SaveConfig() + conf = &p.Config + } + var modified map[string]any + err = yaml.Unmarshal([]byte(req.Yaml), &modified) + if err != nil { + return + } + conf.ParseModifyFile(modified) + return +} diff --git a/architecture.jpg b/architecture.jpg new file mode 100644 index 0000000..a4abbe7 Binary files /dev/null and b/architecture.jpg differ diff --git a/pb/global.pb.go b/pb/global.pb.go index ad3ff3a..83dec1b 100644 --- a/pb/global.pb.go +++ b/pb/global.pb.go @@ -10,6 +10,7 @@ import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" emptypb "google.golang.org/protobuf/types/known/emptypb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" @@ -23,6 +24,344 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type GetConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetConfigRequest) Reset() { + *x = GetConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_global_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_global_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_global_proto_rawDescGZIP(), []int{0} +} + +func (x *GetConfigRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type Formily struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Properties map[string]*Formily `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Component string `protobuf:"bytes,3,opt,name=component,proto3" json:"component,omitempty"` + ComponentProps map[string]*anypb.Any `protobuf:"bytes,4,rep,name=componentProps,proto3" json:"componentProps,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Formily) Reset() { + *x = Formily{} + if protoimpl.UnsafeEnabled { + mi := &file_global_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Formily) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Formily) ProtoMessage() {} + +func (x *Formily) ProtoReflect() protoreflect.Message { + mi := &file_global_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 Formily.ProtoReflect.Descriptor instead. +func (*Formily) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{1} +} + +func (x *Formily) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Formily) GetProperties() map[string]*Formily { + if x != nil { + return x.Properties + } + return nil +} + +func (x *Formily) GetComponent() string { + if x != nil { + return x.Component + } + return "" +} + +func (x *Formily) GetComponentProps() map[string]*anypb.Any { + if x != nil { + return x.ComponentProps + } + return nil +} + +type FormilyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Properties map[string]*Formily `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *FormilyResponse) Reset() { + *x = FormilyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_global_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FormilyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormilyResponse) ProtoMessage() {} + +func (x *FormilyResponse) ProtoReflect() protoreflect.Message { + mi := &file_global_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 FormilyResponse.ProtoReflect.Descriptor instead. +func (*FormilyResponse) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{2} +} + +func (x *FormilyResponse) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *FormilyResponse) GetProperties() map[string]*Formily { + if x != nil { + return x.Properties + } + return nil +} + +type GetConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + File string `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"` + Modified string `protobuf:"bytes,2,opt,name=modified,proto3" json:"modified,omitempty"` + Merged string `protobuf:"bytes,3,opt,name=merged,proto3" json:"merged,omitempty"` +} + +func (x *GetConfigResponse) Reset() { + *x = GetConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_global_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConfigResponse) ProtoMessage() {} + +func (x *GetConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_global_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 GetConfigResponse.ProtoReflect.Descriptor instead. +func (*GetConfigResponse) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{3} +} + +func (x *GetConfigResponse) GetFile() string { + if x != nil { + return x.File + } + return "" +} + +func (x *GetConfigResponse) GetModified() string { + if x != nil { + return x.Modified + } + return "" +} + +func (x *GetConfigResponse) GetMerged() string { + if x != nil { + return x.Merged + } + return "" +} + +type ModifyConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` +} + +func (x *ModifyConfigRequest) Reset() { + *x = ModifyConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_global_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModifyConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyConfigRequest) ProtoMessage() {} + +func (x *ModifyConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_global_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 ModifyConfigRequest.ProtoReflect.Descriptor instead. +func (*ModifyConfigRequest) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{4} +} + +func (x *ModifyConfigRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ModifyConfigRequest) GetYaml() string { + if x != nil { + return x.Yaml + } + return "" +} + +type ModifyConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *ModifyConfigResponse) Reset() { + *x = ModifyConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_global_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModifyConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyConfigResponse) ProtoMessage() {} + +func (x *ModifyConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_global_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 ModifyConfigResponse.ProtoReflect.Descriptor instead. +func (*ModifyConfigResponse) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{5} +} + +func (x *ModifyConfigResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + type NetWorkInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -38,7 +377,7 @@ type NetWorkInfo struct { func (x *NetWorkInfo) Reset() { *x = NetWorkInfo{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[0] + mi := &file_global_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -51,7 +390,7 @@ func (x *NetWorkInfo) String() string { func (*NetWorkInfo) ProtoMessage() {} func (x *NetWorkInfo) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[0] + mi := &file_global_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -64,7 +403,7 @@ func (x *NetWorkInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NetWorkInfo.ProtoReflect.Descriptor instead. func (*NetWorkInfo) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{0} + return file_global_proto_rawDescGZIP(), []int{6} } func (x *NetWorkInfo) GetName() string { @@ -116,7 +455,7 @@ type Usage struct { func (x *Usage) Reset() { *x = Usage{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[1] + mi := &file_global_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -129,7 +468,7 @@ func (x *Usage) String() string { func (*Usage) ProtoMessage() {} func (x *Usage) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[1] + mi := &file_global_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -142,7 +481,7 @@ func (x *Usage) ProtoReflect() protoreflect.Message { // Deprecated: Use Usage.ProtoReflect.Descriptor instead. func (*Usage) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{1} + return file_global_proto_rawDescGZIP(), []int{7} } func (x *Usage) GetTotal() uint64 { @@ -189,7 +528,7 @@ type SummaryResponse struct { func (x *SummaryResponse) Reset() { *x = SummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[2] + mi := &file_global_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -202,7 +541,7 @@ func (x *SummaryResponse) String() string { func (*SummaryResponse) ProtoMessage() {} func (x *SummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[2] + mi := &file_global_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -215,7 +554,7 @@ func (x *SummaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SummaryResponse.ProtoReflect.Descriptor instead. func (*SummaryResponse) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{2} + return file_global_proto_rawDescGZIP(), []int{8} } func (x *SummaryResponse) GetAddress() string { @@ -277,7 +616,7 @@ type StreamSummay struct { func (x *StreamSummay) Reset() { *x = StreamSummay{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[3] + mi := &file_global_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -290,7 +629,7 @@ func (x *StreamSummay) String() string { func (*StreamSummay) ProtoMessage() {} func (x *StreamSummay) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[3] + mi := &file_global_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -303,7 +642,7 @@ func (x *StreamSummay) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamSummay.ProtoReflect.Descriptor instead. func (*StreamSummay) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{3} + return file_global_proto_rawDescGZIP(), []int{9} } func (x *StreamSummay) GetPath() string { @@ -368,7 +707,7 @@ type SysInfoResponse struct { func (x *SysInfoResponse) Reset() { *x = SysInfoResponse{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[4] + mi := &file_global_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -381,7 +720,7 @@ func (x *SysInfoResponse) String() string { func (*SysInfoResponse) ProtoMessage() {} func (x *SysInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[4] + mi := &file_global_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -394,7 +733,7 @@ func (x *SysInfoResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SysInfoResponse.ProtoReflect.Descriptor instead. func (*SysInfoResponse) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{4} + return file_global_proto_rawDescGZIP(), []int{10} } func (x *SysInfoResponse) GetStartTime() *timestamppb.Timestamp { @@ -430,7 +769,7 @@ type StreamListRequest struct { func (x *StreamListRequest) Reset() { *x = StreamListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[5] + mi := &file_global_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -443,7 +782,7 @@ func (x *StreamListRequest) String() string { func (*StreamListRequest) ProtoMessage() {} func (x *StreamListRequest) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[5] + mi := &file_global_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -456,7 +795,7 @@ func (x *StreamListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamListRequest.ProtoReflect.Descriptor instead. func (*StreamListRequest) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{5} + return file_global_proto_rawDescGZIP(), []int{11} } func (x *StreamListRequest) GetPageNum() int32 { @@ -487,7 +826,7 @@ type StreamListResponse struct { func (x *StreamListResponse) Reset() { *x = StreamListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[6] + mi := &file_global_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -500,7 +839,7 @@ func (x *StreamListResponse) String() string { func (*StreamListResponse) ProtoMessage() {} func (x *StreamListResponse) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[6] + mi := &file_global_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -513,7 +852,7 @@ func (x *StreamListResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamListResponse.ProtoReflect.Descriptor instead. func (*StreamListResponse) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{6} + return file_global_proto_rawDescGZIP(), []int{12} } func (x *StreamListResponse) GetTotal() int32 { @@ -555,7 +894,7 @@ type StreamSnapRequest struct { func (x *StreamSnapRequest) Reset() { *x = StreamSnapRequest{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[7] + mi := &file_global_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -568,7 +907,7 @@ func (x *StreamSnapRequest) String() string { func (*StreamSnapRequest) ProtoMessage() {} func (x *StreamSnapRequest) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[7] + mi := &file_global_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -581,7 +920,7 @@ func (x *StreamSnapRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamSnapRequest.ProtoReflect.Descriptor instead. func (*StreamSnapRequest) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{7} + return file_global_proto_rawDescGZIP(), []int{13} } func (x *StreamSnapRequest) GetStreamPath() string { @@ -604,7 +943,7 @@ type Wrap struct { func (x *Wrap) Reset() { *x = Wrap{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[8] + mi := &file_global_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -617,7 +956,7 @@ func (x *Wrap) String() string { func (*Wrap) ProtoMessage() {} func (x *Wrap) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[8] + mi := &file_global_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -630,7 +969,7 @@ func (x *Wrap) ProtoReflect() protoreflect.Message { // Deprecated: Use Wrap.ProtoReflect.Descriptor instead. func (*Wrap) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{8} + return file_global_proto_rawDescGZIP(), []int{14} } func (x *Wrap) GetTimestamp() uint32 { @@ -669,7 +1008,7 @@ type TrackSnapShot struct { func (x *TrackSnapShot) Reset() { *x = TrackSnapShot{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[9] + mi := &file_global_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -682,7 +1021,7 @@ func (x *TrackSnapShot) String() string { func (*TrackSnapShot) ProtoMessage() {} func (x *TrackSnapShot) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[9] + mi := &file_global_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -695,7 +1034,7 @@ func (x *TrackSnapShot) ProtoReflect() protoreflect.Message { // Deprecated: Use TrackSnapShot.ProtoReflect.Descriptor instead. func (*TrackSnapShot) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{9} + return file_global_proto_rawDescGZIP(), []int{15} } func (x *TrackSnapShot) GetSequence() uint32 { @@ -745,7 +1084,7 @@ type StreamSnapShot struct { func (x *StreamSnapShot) Reset() { *x = StreamSnapShot{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[10] + mi := &file_global_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -758,7 +1097,7 @@ func (x *StreamSnapShot) String() string { func (*StreamSnapShot) ProtoMessage() {} func (x *StreamSnapShot) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[10] + mi := &file_global_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -771,7 +1110,7 @@ func (x *StreamSnapShot) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamSnapShot.ProtoReflect.Descriptor instead. func (*StreamSnapShot) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{10} + return file_global_proto_rawDescGZIP(), []int{16} } func (x *StreamSnapShot) GetVideoTrack() []*TrackSnapShot { @@ -799,7 +1138,7 @@ type StopSubscribeRequest struct { func (x *StopSubscribeRequest) Reset() { *x = StopSubscribeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[11] + mi := &file_global_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -812,7 +1151,7 @@ func (x *StopSubscribeRequest) String() string { func (*StopSubscribeRequest) ProtoMessage() {} func (x *StopSubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[11] + mi := &file_global_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -825,7 +1164,7 @@ func (x *StopSubscribeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopSubscribeRequest.ProtoReflect.Descriptor instead. func (*StopSubscribeRequest) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{11} + return file_global_proto_rawDescGZIP(), []int{17} } func (x *StopSubscribeRequest) GetId() uint32 { @@ -846,7 +1185,7 @@ type StopSubscribeResponse struct { func (x *StopSubscribeResponse) Reset() { *x = StopSubscribeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[12] + mi := &file_global_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -859,7 +1198,7 @@ func (x *StopSubscribeResponse) String() string { func (*StopSubscribeResponse) ProtoMessage() {} func (x *StopSubscribeResponse) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[12] + mi := &file_global_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -872,7 +1211,7 @@ func (x *StopSubscribeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StopSubscribeResponse.ProtoReflect.Descriptor instead. func (*StopSubscribeResponse) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{12} + return file_global_proto_rawDescGZIP(), []int{18} } func (x *StopSubscribeResponse) GetSuccess() bool { @@ -893,7 +1232,7 @@ type RequestWithId struct { func (x *RequestWithId) Reset() { *x = RequestWithId{} if protoimpl.UnsafeEnabled { - mi := &file_global_proto_msgTypes[13] + mi := &file_global_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -906,7 +1245,7 @@ func (x *RequestWithId) String() string { func (*RequestWithId) ProtoMessage() {} func (x *RequestWithId) ProtoReflect() protoreflect.Message { - mi := &file_global_proto_msgTypes[13] + mi := &file_global_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -919,7 +1258,7 @@ func (x *RequestWithId) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestWithId.ProtoReflect.Descriptor instead. func (*RequestWithId) Descriptor() ([]byte, []int) { - return file_global_proto_rawDescGZIP(), []int{13} + return file_global_proto_rawDescGZIP(), []int{19} } func (x *RequestWithId) GetId() uint32 { @@ -938,147 +1277,217 @@ var file_global_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x91, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x65, 0x6e, - 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x53, 0x70, 0x65, 0x65, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, - 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x74, 0x53, 0x70, - 0x65, 0x65, 0x64, 0x22, 0x5b, 0x0a, 0x05, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x75, 0x73, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, - 0x22, 0xe1, 0x01, 0x0a, 0x0f, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x22, - 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, - 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, - 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x70, 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x63, 0x70, 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, - 0x0a, 0x08, 0x68, 0x61, 0x72, 0x64, 0x44, 0x69, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x68, 0x61, - 0x72, 0x64, 0x44, 0x69, 0x73, 0x6b, 0x12, 0x2a, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x57, 0x6f, 0x72, - 0x6b, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x4e, 0x65, - 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x57, 0x6f, - 0x72, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd2, 0x01, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, - 0x73, 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, 0x38, 0x0a, 0x09, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 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, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x70, 0x73, 0x22, 0x7f, 0x0a, 0x0f, 0x53, 0x79, 0x73, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 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, 0x09, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, - 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x50, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x49, 0x0a, 0x11, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x79, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, - 0x33, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, - 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x50, 0x61, 0x74, 0x68, 0x22, 0x4c, 0x0a, 0x04, 0x57, 0x72, 0x61, 0x70, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x22, 0xa0, 0x01, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, - 0x53, 0x68, 0x6f, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, - 0x0a, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x61, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, - 0x61, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x0a, 0x04, 0x77, 0x72, 0x61, 0x70, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x52, - 0x04, 0x77, 0x72, 0x61, 0x70, 0x22, 0x78, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, - 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, - 0x54, 0x72, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x37, - 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, - 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x0a, 0x61, - 0x75, 0x64, 0x69, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, - 0x68, 0x6f, 0x74, 0x52, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x22, - 0x26, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x70, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x0d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x32, 0xf7, 0x04, 0x0a, 0x06, - 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x79, 0x73, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, - 0x53, 0x79, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x79, - 0x73, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x12, 0x52, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, - 0x12, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, - 0x74, 0x68, 0x49, 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1a, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x14, 0x22, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x68, 0x75, 0x74, 0x64, - 0x6f, 0x77, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x50, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x57, 0x0a, 0x0a, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x12, 0x12, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x6c, - 0x69, 0x73, 0x74, 0x12, 0x63, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, - 0x70, 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, - 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6d, 0x37, 0x73, 0x2e, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x22, 0x28, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x6b, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x19, 0x2e, 0x6d, 0x37, 0x73, 0x2e, - 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, - 0x74, 0x6f, 0x70, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x42, 0x14, 0x5a, 0x12, 0x6d, 0x37, 0x73, 0x2e, 0x6c, 0x69, 0x76, - 0x65, 0x2f, 0x6d, 0x37, 0x73, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x26, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0xe9, 0x02, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x46, 0x6f, 0x72, + 0x6d, 0x69, 0x6c, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x12, 0x48, + 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x46, 0x6f, 0x72, + 0x6d, 0x69, 0x6c, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x50, 0x72, + 0x6f, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x1a, 0x4b, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x22, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, + 0x37, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x57, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb8, + 0x01, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6d, 0x37, 0x73, + 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x4b, 0x0a, 0x0f, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x5b, 0x0a, 0x11, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x69, + 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0x30, 0x0a, 0x14, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x57, + 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x53, 0x70, 0x65, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x73, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x65, 0x64, 0x22, 0x5b, 0x0a, 0x05, 0x55, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, + 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x75, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x22, 0xe1, 0x01, 0x0a, 0x0f, 0x53, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x22, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x55, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x70, + 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x63, 0x70, + 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x08, 0x68, 0x61, 0x72, 0x64, 0x44, 0x69, + 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x55, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x68, 0x61, 0x72, 0x64, 0x44, 0x69, 0x73, 0x6b, 0x12, 0x2a, + 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x4e, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd2, 0x01, 0x0a, + 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 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, 0x38, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, + 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, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x70, + 0x73, 0x22, 0x7f, 0x0a, 0x0f, 0x53, 0x79, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x01, 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, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x49, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, + 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, + 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x87, 0x01, + 0x0a, 0x12, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, + 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x67, + 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x12, 0x25, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x79, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x33, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x22, 0x4c, 0x0a, 0x04, + 0x57, 0x72, 0x61, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa0, 0x01, 0x0a, 0x0d, 0x54, + 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1d, + 0x0a, 0x04, 0x77, 0x72, 0x61, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x6d, + 0x37, 0x73, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x52, 0x04, 0x77, 0x72, 0x61, 0x70, 0x22, 0x78, 0x0a, + 0x0e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x12, + 0x32, 0x0a, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, + 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, + 0x61, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x54, 0x72, 0x61, 0x63, + 0x6b, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, + 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x0a, 0x61, 0x75, 0x64, + 0x69, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x22, 0x26, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x70, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x31, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, + 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x32, 0xa2, 0x07, 0x0a, 0x06, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x4d, + 0x0a, 0x07, 0x53, 0x79, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, + 0x0c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x79, 0x73, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, + 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x52, 0x0a, 0x08, + 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, 0x12, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x73, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x12, 0x50, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x37, + 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, + 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2f, 0x7b, 0x69, + 0x64, 0x7d, 0x12, 0x57, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x63, 0x0a, 0x0a, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x13, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, + 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x73, 0x6e, 0x61, 0x70, + 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, + 0x12, 0x6b, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x12, 0x19, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, + 0x37, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, + 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x6f, 0x70, 0x2f, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x5a, 0x0a, + 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x15, 0x2e, 0x6d, 0x37, 0x73, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, + 0x65, 0x74, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x5f, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x66, 0x6f, 0x72, 0x6d, + 0x69, 0x6c, 0x79, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x6c, 0x0a, 0x0c, 0x4d, 0x6f, + 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x2e, 0x6d, 0x37, 0x73, + 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, + 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x3a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x42, 0x14, 0x5a, 0x12, 0x6d, 0x37, 0x73, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x2f, 0x6d, 0x37, 0x73, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1093,54 +1502,76 @@ func file_global_proto_rawDescGZIP() []byte { return file_global_proto_rawDescData } -var file_global_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_global_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_global_proto_goTypes = []interface{}{ - (*NetWorkInfo)(nil), // 0: m7s.NetWorkInfo - (*Usage)(nil), // 1: m7s.Usage - (*SummaryResponse)(nil), // 2: m7s.SummaryResponse - (*StreamSummay)(nil), // 3: m7s.StreamSummay - (*SysInfoResponse)(nil), // 4: m7s.SysInfoResponse - (*StreamListRequest)(nil), // 5: m7s.StreamListRequest - (*StreamListResponse)(nil), // 6: m7s.StreamListResponse - (*StreamSnapRequest)(nil), // 7: m7s.StreamSnapRequest - (*Wrap)(nil), // 8: m7s.Wrap - (*TrackSnapShot)(nil), // 9: m7s.TrackSnapShot - (*StreamSnapShot)(nil), // 10: m7s.StreamSnapShot - (*StopSubscribeRequest)(nil), // 11: m7s.StopSubscribeRequest - (*StopSubscribeResponse)(nil), // 12: m7s.StopSubscribeResponse - (*RequestWithId)(nil), // 13: m7s.RequestWithId - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 15: google.protobuf.Empty + (*GetConfigRequest)(nil), // 0: m7s.GetConfigRequest + (*Formily)(nil), // 1: m7s.Formily + (*FormilyResponse)(nil), // 2: m7s.FormilyResponse + (*GetConfigResponse)(nil), // 3: m7s.GetConfigResponse + (*ModifyConfigRequest)(nil), // 4: m7s.ModifyConfigRequest + (*ModifyConfigResponse)(nil), // 5: m7s.ModifyConfigResponse + (*NetWorkInfo)(nil), // 6: m7s.NetWorkInfo + (*Usage)(nil), // 7: m7s.Usage + (*SummaryResponse)(nil), // 8: m7s.SummaryResponse + (*StreamSummay)(nil), // 9: m7s.StreamSummay + (*SysInfoResponse)(nil), // 10: m7s.SysInfoResponse + (*StreamListRequest)(nil), // 11: m7s.StreamListRequest + (*StreamListResponse)(nil), // 12: m7s.StreamListResponse + (*StreamSnapRequest)(nil), // 13: m7s.StreamSnapRequest + (*Wrap)(nil), // 14: m7s.Wrap + (*TrackSnapShot)(nil), // 15: m7s.TrackSnapShot + (*StreamSnapShot)(nil), // 16: m7s.StreamSnapShot + (*StopSubscribeRequest)(nil), // 17: m7s.StopSubscribeRequest + (*StopSubscribeResponse)(nil), // 18: m7s.StopSubscribeResponse + (*RequestWithId)(nil), // 19: m7s.RequestWithId + nil, // 20: m7s.Formily.PropertiesEntry + nil, // 21: m7s.Formily.ComponentPropsEntry + nil, // 22: m7s.FormilyResponse.PropertiesEntry + (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp + (*anypb.Any)(nil), // 24: google.protobuf.Any + (*emptypb.Empty)(nil), // 25: google.protobuf.Empty } var file_global_proto_depIdxs = []int32{ - 1, // 0: m7s.SummaryResponse.memory:type_name -> m7s.Usage - 1, // 1: m7s.SummaryResponse.hardDisk:type_name -> m7s.Usage - 0, // 2: m7s.SummaryResponse.netWork:type_name -> m7s.NetWorkInfo - 14, // 3: m7s.StreamSummay.startTime:type_name -> google.protobuf.Timestamp - 14, // 4: m7s.SysInfoResponse.startTime:type_name -> google.protobuf.Timestamp - 3, // 5: m7s.StreamListResponse.list:type_name -> m7s.StreamSummay - 8, // 6: m7s.TrackSnapShot.wrap:type_name -> m7s.Wrap - 9, // 7: m7s.StreamSnapShot.videoTrack:type_name -> m7s.TrackSnapShot - 9, // 8: m7s.StreamSnapShot.audioTrack:type_name -> m7s.TrackSnapShot - 15, // 9: m7s.Global.SysInfo:input_type -> google.protobuf.Empty - 15, // 10: m7s.Global.Summary:input_type -> google.protobuf.Empty - 13, // 11: m7s.Global.Shutdown:input_type -> m7s.RequestWithId - 13, // 12: m7s.Global.Restart:input_type -> m7s.RequestWithId - 5, // 13: m7s.Global.StreamList:input_type -> m7s.StreamListRequest - 7, // 14: m7s.Global.StreamSnap:input_type -> m7s.StreamSnapRequest - 11, // 15: m7s.Global.StopSubscribe:input_type -> m7s.StopSubscribeRequest - 4, // 16: m7s.Global.SysInfo:output_type -> m7s.SysInfoResponse - 2, // 17: m7s.Global.Summary:output_type -> m7s.SummaryResponse - 15, // 18: m7s.Global.Shutdown:output_type -> google.protobuf.Empty - 15, // 19: m7s.Global.Restart:output_type -> google.protobuf.Empty - 6, // 20: m7s.Global.StreamList:output_type -> m7s.StreamListResponse - 10, // 21: m7s.Global.StreamSnap:output_type -> m7s.StreamSnapShot - 12, // 22: m7s.Global.StopSubscribe:output_type -> m7s.StopSubscribeResponse - 16, // [16:23] is the sub-list for method output_type - 9, // [9:16] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 20, // 0: m7s.Formily.properties:type_name -> m7s.Formily.PropertiesEntry + 21, // 1: m7s.Formily.componentProps:type_name -> m7s.Formily.ComponentPropsEntry + 22, // 2: m7s.FormilyResponse.properties:type_name -> m7s.FormilyResponse.PropertiesEntry + 7, // 3: m7s.SummaryResponse.memory:type_name -> m7s.Usage + 7, // 4: m7s.SummaryResponse.hardDisk:type_name -> m7s.Usage + 6, // 5: m7s.SummaryResponse.netWork:type_name -> m7s.NetWorkInfo + 23, // 6: m7s.StreamSummay.startTime:type_name -> google.protobuf.Timestamp + 23, // 7: m7s.SysInfoResponse.startTime:type_name -> google.protobuf.Timestamp + 9, // 8: m7s.StreamListResponse.list:type_name -> m7s.StreamSummay + 14, // 9: m7s.TrackSnapShot.wrap:type_name -> m7s.Wrap + 15, // 10: m7s.StreamSnapShot.videoTrack:type_name -> m7s.TrackSnapShot + 15, // 11: m7s.StreamSnapShot.audioTrack:type_name -> m7s.TrackSnapShot + 1, // 12: m7s.Formily.PropertiesEntry.value:type_name -> m7s.Formily + 24, // 13: m7s.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any + 1, // 14: m7s.FormilyResponse.PropertiesEntry.value:type_name -> m7s.Formily + 25, // 15: m7s.Global.SysInfo:input_type -> google.protobuf.Empty + 25, // 16: m7s.Global.Summary:input_type -> google.protobuf.Empty + 19, // 17: m7s.Global.Shutdown:input_type -> m7s.RequestWithId + 19, // 18: m7s.Global.Restart:input_type -> m7s.RequestWithId + 11, // 19: m7s.Global.StreamList:input_type -> m7s.StreamListRequest + 13, // 20: m7s.Global.StreamSnap:input_type -> m7s.StreamSnapRequest + 17, // 21: m7s.Global.StopSubscribe:input_type -> m7s.StopSubscribeRequest + 0, // 22: m7s.Global.GetConfig:input_type -> m7s.GetConfigRequest + 0, // 23: m7s.Global.GetFormily:input_type -> m7s.GetConfigRequest + 4, // 24: m7s.Global.ModifyConfig:input_type -> m7s.ModifyConfigRequest + 10, // 25: m7s.Global.SysInfo:output_type -> m7s.SysInfoResponse + 8, // 26: m7s.Global.Summary:output_type -> m7s.SummaryResponse + 25, // 27: m7s.Global.Shutdown:output_type -> google.protobuf.Empty + 25, // 28: m7s.Global.Restart:output_type -> google.protobuf.Empty + 12, // 29: m7s.Global.StreamList:output_type -> m7s.StreamListResponse + 16, // 30: m7s.Global.StreamSnap:output_type -> m7s.StreamSnapShot + 18, // 31: m7s.Global.StopSubscribe:output_type -> m7s.StopSubscribeResponse + 3, // 32: m7s.Global.GetConfig:output_type -> m7s.GetConfigResponse + 3, // 33: m7s.Global.GetFormily:output_type -> m7s.GetConfigResponse + 5, // 34: m7s.Global.ModifyConfig:output_type -> m7s.ModifyConfigResponse + 25, // [25:35] is the sub-list for method output_type + 15, // [15:25] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_global_proto_init() } @@ -1150,7 +1581,7 @@ func file_global_proto_init() { } if !protoimpl.UnsafeEnabled { file_global_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetWorkInfo); i { + switch v := v.(*GetConfigRequest); i { case 0: return &v.state case 1: @@ -1162,7 +1593,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Usage); i { + switch v := v.(*Formily); i { case 0: return &v.state case 1: @@ -1174,7 +1605,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SummaryResponse); i { + switch v := v.(*FormilyResponse); i { case 0: return &v.state case 1: @@ -1186,7 +1617,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamSummay); i { + switch v := v.(*GetConfigResponse); i { case 0: return &v.state case 1: @@ -1198,7 +1629,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SysInfoResponse); i { + switch v := v.(*ModifyConfigRequest); i { case 0: return &v.state case 1: @@ -1210,7 +1641,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamListRequest); i { + switch v := v.(*ModifyConfigResponse); i { case 0: return &v.state case 1: @@ -1222,7 +1653,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamListResponse); i { + switch v := v.(*NetWorkInfo); i { case 0: return &v.state case 1: @@ -1234,7 +1665,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamSnapRequest); i { + switch v := v.(*Usage); i { case 0: return &v.state case 1: @@ -1246,7 +1677,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Wrap); i { + switch v := v.(*SummaryResponse); i { case 0: return &v.state case 1: @@ -1258,7 +1689,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TrackSnapShot); i { + switch v := v.(*StreamSummay); i { case 0: return &v.state case 1: @@ -1270,7 +1701,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamSnapShot); i { + switch v := v.(*SysInfoResponse); i { case 0: return &v.state case 1: @@ -1282,7 +1713,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopSubscribeRequest); i { + switch v := v.(*StreamListRequest); i { case 0: return &v.state case 1: @@ -1294,7 +1725,7 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopSubscribeResponse); i { + switch v := v.(*StreamListResponse); i { case 0: return &v.state case 1: @@ -1306,6 +1737,78 @@ func file_global_proto_init() { } } file_global_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamSnapRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_global_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Wrap); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_global_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrackSnapShot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_global_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamSnapShot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_global_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopSubscribeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_global_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopSubscribeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_global_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RequestWithId); i { case 0: return &v.state @@ -1324,7 +1827,7 @@ func file_global_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_global_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 23, NumExtensions: 0, NumServices: 1, }, diff --git a/pb/global.pb.gw.go b/pb/global.pb.gw.go index 87950e1..e7d6cb8 100644 --- a/pb/global.pb.gw.go +++ b/pb/global.pb.gw.go @@ -320,6 +320,170 @@ func local_request_Global_StopSubscribe_0(ctx context.Context, marshaler runtime } +func request_Global_GetConfig_0(ctx context.Context, marshaler runtime.Marshaler, client GlobalClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetConfigRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.GetConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Global_GetConfig_0(ctx context.Context, marshaler runtime.Marshaler, server GlobalServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetConfigRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.GetConfig(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Global_GetFormily_0(ctx context.Context, marshaler runtime.Marshaler, client GlobalClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetConfigRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.GetFormily(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Global_GetFormily_0(ctx context.Context, marshaler runtime.Marshaler, server GlobalServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetConfigRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.GetFormily(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Global_ModifyConfig_0(ctx context.Context, marshaler runtime.Marshaler, client GlobalClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ModifyConfigRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Yaml); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.ModifyConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Global_ModifyConfig_0(ctx context.Context, marshaler runtime.Marshaler, server GlobalServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ModifyConfigRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Yaml); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.ModifyConfig(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterGlobalHandlerServer registers the http handlers for service Global to "mux". // UnaryRPC :call GlobalServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -501,6 +665,81 @@ func RegisterGlobalHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) + mux.Handle("GET", pattern_Global_GetConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/m7s.Global/GetConfig", runtime.WithHTTPPathPattern("/api/config/get/{name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Global_GetConfig_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Global_GetConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Global_GetFormily_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/m7s.Global/GetFormily", runtime.WithHTTPPathPattern("/api/config/formily/{name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Global_GetFormily_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Global_GetFormily_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Global_ModifyConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/m7s.Global/ModifyConfig", runtime.WithHTTPPathPattern("/api/config/modify/{name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Global_ModifyConfig_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Global_ModifyConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -696,6 +935,72 @@ func RegisterGlobalHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) + mux.Handle("GET", pattern_Global_GetConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/m7s.Global/GetConfig", runtime.WithHTTPPathPattern("/api/config/get/{name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Global_GetConfig_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Global_GetConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Global_GetFormily_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/m7s.Global/GetFormily", runtime.WithHTTPPathPattern("/api/config/formily/{name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Global_GetFormily_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Global_GetFormily_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Global_ModifyConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/m7s.Global/ModifyConfig", runtime.WithHTTPPathPattern("/api/config/modify/{name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Global_ModifyConfig_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Global_ModifyConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -713,6 +1018,12 @@ var ( pattern_Global_StreamSnap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "snap", "streamPath"}, "")) pattern_Global_StopSubscribe_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "stop", "subscribe", "id"}, "")) + + pattern_Global_GetConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "config", "get", "name"}, "")) + + pattern_Global_GetFormily_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "config", "formily", "name"}, "")) + + pattern_Global_ModifyConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "config", "modify", "name"}, "")) ) var ( @@ -729,4 +1040,10 @@ var ( forward_Global_StreamSnap_0 = runtime.ForwardResponseMessage forward_Global_StopSubscribe_0 = runtime.ForwardResponseMessage + + forward_Global_GetConfig_0 = runtime.ForwardResponseMessage + + forward_Global_GetFormily_0 = runtime.ForwardResponseMessage + + forward_Global_ModifyConfig_0 = runtime.ForwardResponseMessage ) diff --git a/pb/global.proto b/pb/global.proto index 22d4434..b3b680b 100644 --- a/pb/global.proto +++ b/pb/global.proto @@ -2,6 +2,7 @@ syntax = "proto3"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; package m7s; option go_package="m7s.live/m7s/v5/pb"; @@ -42,6 +43,53 @@ service Global { body: "*" }; } + rpc GetConfig (GetConfigRequest) returns (GetConfigResponse) { + option (google.api.http) = { + get: "/api/config/get/{name}" + }; + } + rpc GetFormily (GetConfigRequest) returns (GetConfigResponse) { + option (google.api.http) = { + get: "/api/config/formily/{name}" + }; + } + rpc ModifyConfig (ModifyConfigRequest) returns (ModifyConfigResponse) { + option (google.api.http) = { + post: "/api/config/modify/{name}" + body: "yaml" + }; + } +} + +message GetConfigRequest { + string name = 1; +} + +message Formily { + string type = 1; + map properties = 2; + string component = 3; + map componentProps = 4; +} + +message FormilyResponse { + string type = 1; + map properties = 2; +} + +message GetConfigResponse { + string file = 1; + string modified = 2; + string merged = 3; +} + +message ModifyConfigRequest { + string name = 1; + string yaml = 2; +} + +message ModifyConfigResponse { + bool success = 1; } message NetWorkInfo { diff --git a/pb/global_grpc.pb.go b/pb/global_grpc.pb.go index 8d18ee3..a8b4b9b 100644 --- a/pb/global_grpc.pb.go +++ b/pb/global_grpc.pb.go @@ -30,6 +30,9 @@ type GlobalClient interface { StreamList(ctx context.Context, in *StreamListRequest, opts ...grpc.CallOption) (*StreamListResponse, error) StreamSnap(ctx context.Context, in *StreamSnapRequest, opts ...grpc.CallOption) (*StreamSnapShot, error) StopSubscribe(ctx context.Context, in *StopSubscribeRequest, opts ...grpc.CallOption) (*StopSubscribeResponse, error) + GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) + GetFormily(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) + ModifyConfig(ctx context.Context, in *ModifyConfigRequest, opts ...grpc.CallOption) (*ModifyConfigResponse, error) } type globalClient struct { @@ -103,6 +106,33 @@ func (c *globalClient) StopSubscribe(ctx context.Context, in *StopSubscribeReque return out, nil } +func (c *globalClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) { + out := new(GetConfigResponse) + err := c.cc.Invoke(ctx, "/m7s.Global/GetConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *globalClient) GetFormily(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) { + out := new(GetConfigResponse) + err := c.cc.Invoke(ctx, "/m7s.Global/GetFormily", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *globalClient) ModifyConfig(ctx context.Context, in *ModifyConfigRequest, opts ...grpc.CallOption) (*ModifyConfigResponse, error) { + out := new(ModifyConfigResponse) + err := c.cc.Invoke(ctx, "/m7s.Global/ModifyConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // GlobalServer is the server API for Global service. // All implementations must embed UnimplementedGlobalServer // for forward compatibility @@ -114,6 +144,9 @@ type GlobalServer interface { StreamList(context.Context, *StreamListRequest) (*StreamListResponse, error) StreamSnap(context.Context, *StreamSnapRequest) (*StreamSnapShot, error) StopSubscribe(context.Context, *StopSubscribeRequest) (*StopSubscribeResponse, error) + GetConfig(context.Context, *GetConfigRequest) (*GetConfigResponse, error) + GetFormily(context.Context, *GetConfigRequest) (*GetConfigResponse, error) + ModifyConfig(context.Context, *ModifyConfigRequest) (*ModifyConfigResponse, error) mustEmbedUnimplementedGlobalServer() } @@ -142,6 +175,15 @@ func (UnimplementedGlobalServer) StreamSnap(context.Context, *StreamSnapRequest) func (UnimplementedGlobalServer) StopSubscribe(context.Context, *StopSubscribeRequest) (*StopSubscribeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StopSubscribe not implemented") } +func (UnimplementedGlobalServer) GetConfig(context.Context, *GetConfigRequest) (*GetConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented") +} +func (UnimplementedGlobalServer) GetFormily(context.Context, *GetConfigRequest) (*GetConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFormily not implemented") +} +func (UnimplementedGlobalServer) ModifyConfig(context.Context, *ModifyConfigRequest) (*ModifyConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModifyConfig not implemented") +} func (UnimplementedGlobalServer) mustEmbedUnimplementedGlobalServer() {} // UnsafeGlobalServer may be embedded to opt out of forward compatibility for this service. @@ -281,6 +323,60 @@ func _Global_StopSubscribe_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Global_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.(GlobalServer).GetConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/m7s.Global/GetConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GlobalServer).GetConfig(ctx, req.(*GetConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Global_GetFormily_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.(GlobalServer).GetFormily(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/m7s.Global/GetFormily", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GlobalServer).GetFormily(ctx, req.(*GetConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Global_ModifyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GlobalServer).ModifyConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/m7s.Global/ModifyConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GlobalServer).ModifyConfig(ctx, req.(*ModifyConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Global_ServiceDesc is the grpc.ServiceDesc for Global service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -316,6 +412,18 @@ var Global_ServiceDesc = grpc.ServiceDesc{ MethodName: "StopSubscribe", Handler: _Global_StopSubscribe_Handler, }, + { + MethodName: "GetConfig", + Handler: _Global_GetConfig_Handler, + }, + { + MethodName: "GetFormily", + Handler: _Global_GetFormily_Handler, + }, + { + MethodName: "ModifyConfig", + Handler: _Global_ModifyConfig_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "global.proto", diff --git a/pkg/avframe.go b/pkg/avframe.go index 02cf931..fb3a385 100644 --- a/pkg/avframe.go +++ b/pkg/avframe.go @@ -50,21 +50,19 @@ type ( DataFrame IDR bool Timestamp time.Duration // 绝对时间戳 - Wraps []IAVFrame // 封装格式 + Wraps []IAVFrame // 封装格式 } AVRing = util.Ring[AVFrame] DataFrame struct { sync.RWMutex `json:"-" yaml:"-"` // 读写锁 discard bool Sequence uint32 // 在一个Track中的序号 - BytesIn int // 输入字节数用于计算BPS WriteTime time.Time // 写入时间,可用于比较两个帧的先后 Raw any `json:"-" yaml:"-"` // 裸格式 } ) func (frame *AVFrame) Reset() { - frame.BytesIn = 0 frame.Timestamp = 0 for _, wrap := range frame.Wraps { wrap.Recycle() diff --git a/pkg/track.go b/pkg/track.go index 283eaff..f36d22f 100644 --- a/pkg/track.go +++ b/pkg/track.go @@ -6,15 +6,19 @@ import ( "reflect" "slices" "sync/atomic" + "time" "m7s.live/m7s/v5/pkg/util" ) type ( Track struct { - *slog.Logger `json:"-" yaml:"-"` - Ready *util.Promise[struct{}] - FrameType reflect.Type + *slog.Logger + Ready *util.Promise[struct{}] + FrameType reflect.Type + bytesIn int + lastBPSTime time.Time + BPS int } DataTrack struct { @@ -62,6 +66,15 @@ func (t *Track) GetKey() reflect.Type { return t.FrameType } +func (t *Track) AddBytesIn(n int) { + t.bytesIn += n + if dur := time.Since(t.lastBPSTime); dur > time.Second { + t.BPS = int(float64(t.bytesIn) / dur.Seconds()) + t.bytesIn = 0 + t.lastBPSTime = time.Now() + } +} + func (t *Track) Trace(msg string, fields ...any) { t.Log(context.TODO(), TraceLevel, msg, fields...) } diff --git a/plugin.go b/plugin.go index 133cd03..145b451 100644 --- a/plugin.go +++ b/plugin.go @@ -93,7 +93,7 @@ func (plugin *PluginMeta) Init(s *Server, userConfig map[string]any) { } } } - s.Plugins = append(s.Plugins, p) + s.Plugins.Add(p) p.Start() } @@ -156,6 +156,10 @@ func (Plugin) nothing() { } +func (p *Plugin) GetKey() string { + return p.Meta.Name +} + func (p *Plugin) GetGlobalCommonConf() *config.Common { return p.server.GetCommonConf() } @@ -179,7 +183,13 @@ func (p *Plugin) assign() { } p.Config.ParseModifyFile(modifyConfig) } - p.registerHandler() + var handlerMap map[string]http.HandlerFunc + if v, ok := p.handler.(interface { + RegisterHandler() map[string]http.HandlerFunc + }); ok { + handlerMap = v.RegisterHandler() + } + p.registerHandler(handlerMap) } func (p *Plugin) Stop(err error) { @@ -293,7 +303,7 @@ func (p *Plugin) Subscribe(streamPath string, options ...any) (subscriber *Subsc return } -func (p *Plugin) registerHandler() { +func (p *Plugin) registerHandler(handlers map[string]http.HandlerFunc) { t := reflect.TypeOf(p.handler) v := reflect.ValueOf(p.handler) // 注册http响应 @@ -308,6 +318,9 @@ func (p *Plugin) registerHandler() { p.handle(patten, http.HandlerFunc(handler)) } } + for patten, handler := range handlers { + p.handle(patten, handler) + } if rootHandler, ok := p.handler.(http.Handler); ok { p.handle("/", rootHandler) } @@ -365,3 +378,22 @@ func (p *Plugin) handle(pattern string, handler http.Handler) { func (p *Plugin) PostToServer(event any) { p.server.PostMessage(event) } + +func (p *Plugin) SaveConfig() (err error) { + _, err = p.server.Call(func() error { + if p.Modify == nil { + os.Remove(p.settingPath()) + return nil + } + file, err := os.OpenFile(p.settingPath(), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0666) + if err == nil { + defer file.Close() + err = yaml.NewEncoder(file).Encode(p.Modify) + } + if err == nil { + p.Info("config saved") + } + return err + }) + return +} diff --git a/plugin/console/index.go b/plugin/console/index.go index e99c3bb..325447f 100644 --- a/plugin/console/index.go +++ b/plugin/console/index.go @@ -100,6 +100,10 @@ func (cfg *ConsolePlugin) OnInit() error { go cfg.ReceiveRequest(s, conn) } } + if !cfg.IsStopped() { + <-time.After(time.Second) + cfg.OnInit() + } }() return err } diff --git a/plugin/webrtc/index.go b/plugin/webrtc/index.go index 3ae8821..204ae74 100644 --- a/plugin/webrtc/index.go +++ b/plugin/webrtc/index.go @@ -235,9 +235,9 @@ func (conf *WebRTCPlugin) Push_(w http.ResponseWriter, r *http.Request) { if len(frame.Packets) == 0 || packet.Timestamp == frame.Packets[0].Timestamp { frame.Packets = append(frame.Packets, &packet) } else { - t := time.Now() + // t := time.Now() publisher.WriteVideo(frame) - fmt.Println("write video", time.Since(t)) + // fmt.Println("write video", time.Since(t)) frame = &mrtp.RTPVideo{} frame.Packets = []*rtp.Packet{&packet} frame.RTPCodecParameters = &codecP diff --git a/publisher.go b/publisher.go index 355efa4..0c2339b 100644 --- a/publisher.go +++ b/publisher.go @@ -151,11 +151,13 @@ func (p *Publisher) writeAV(t *AVTrack, data IAVFrame) { p.baseTs -= ts } frame.Timestamp = max(1, p.baseTs+ts) + bytesIn := frame.Wraps[0].GetSize() + t.AddBytesIn(bytesIn) p.lastTs = frame.Timestamp if p.Enabled(p, TraceLevel) { codec := t.FourCC().String() - size, data := frame.Wraps[0].GetSize(), frame.Wraps[0].String() - p.Trace("write", "seq", frame.Sequence, "ts", frame.Timestamp, "codec", codec, "size", size, "data", data) + data := frame.Wraps[0].String() + p.Trace("write", "seq", frame.Sequence, "ts", frame.Timestamp, "codec", codec, "size", bytesIn, "data", data) } t.Step() p.speedControl(p.Publish.Speed, p.lastTs) diff --git a/scripts/protoc.sh b/scripts/protoc.sh new file mode 100755 index 0000000..8424a94 --- /dev/null +++ b/scripts/protoc.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. \ +--go-grpc_opt=paths=source_relative --grpc-gateway_out=. --grpc-gateway_opt=paths=source_relative ${1}.proto \ No newline at end of file diff --git a/server.go b/server.go index 7c8c86e..d265ae1 100644 --- a/server.go +++ b/server.go @@ -46,7 +46,7 @@ type Server struct { config.Engine ID int eventChan chan any - Plugins []*Plugin + Plugins util.Collection[string, *Plugin] Streams util.Collection[string, *Publisher] Pulls util.Collection[string, *Puller] Pushs util.Collection[string, *Pusher] @@ -152,7 +152,9 @@ func (s *Server) run(ctx context.Context, conf any) (err error) { lv.Set(TraceLevel) } s.LogHandler.SetLevel(lv.Level()) - s.registerHandler() + s.registerHandler(map[string]http.HandlerFunc{ + "/api/config/json/{name}": s.api_Config_JSON_, + }) if httpConf.ListenAddrTLS != "" { s.Info("https listen at ", "addr", httpConf.ListenAddrTLS) @@ -215,7 +217,7 @@ func (s *Server) run(ctx context.Context, conf any) (err error) { for _, subscriber := range s.Subscribers.Items { subscriber.Stop(err) } - for _, p := range s.Plugins { + for _, p := range s.Plugins.Items { p.Stop(err) } httpConf.StopListen() @@ -323,7 +325,7 @@ func (s *Server) eventLoop() { case slog.Handler: s.LogHandler.Add(v) } - for _, plugin := range s.Plugins { + for _, plugin := range s.Plugins.Items { if plugin.Disabled { continue } @@ -434,7 +436,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } fmt.Fprintf(w, "Monibuca Engine %s StartTime:%s\n", Version, s.StartTime) - for _, plugin := range s.Plugins { + for _, plugin := range s.Plugins.Items { fmt.Fprintf(w, "Plugin %s Version:%s\n", plugin.Meta.Name, plugin.Meta.Version) } for _, api := range s.apiList {