From 3d25c08aa12526b957d29bf7c0628b3c8bfcd70a Mon Sep 17 00:00:00 2001 From: langhuihui <178529795@qq.com> Date: Thu, 10 Oct 2024 20:21:02 +0800 Subject: [PATCH] feat: set stream alias --- api.go | 65 ++++-- pb/global.pb.go | 449 ++++++++++++++++++++++--------------- pb/global.pb.gw.go | 111 +++++++++ pb/global.proto | 12 +- pb/global_grpc.pb.go | 36 +++ pkg/task/job.go | 4 +- pkg/task/task.go | 24 +- pkg/track.go | 2 +- plugin/monitor/index.go | 2 +- plugin/srt/pkg/receiver.go | 5 +- server.go | 5 +- subscriber.go | 64 ++++-- transformer.go | 8 +- 13 files changed, 557 insertions(+), 230 deletions(-) diff --git a/api.go b/api.go index b9f248c..f2be56a 100644 --- a/api.go +++ b/api.go @@ -4,10 +4,9 @@ import ( "context" "encoding/json" "errors" - "fmt" - "maps" "net" "net/http" + "regexp" "runtime" "strings" "time" @@ -94,7 +93,7 @@ func (s *Server) api_Stream_AnnexB_(rw http.ResponseWriter, r *http.Request) { } func (s *Server) getStreamInfo(pub *Publisher) (res *pb.StreamInfoResponse, err error) { - tmp, _ := json.Marshal(pub.Description) + tmp, _ := json.Marshal(pub.GetDescriptions()) res = &pb.StreamInfoResponse{ Meta: string(tmp), Path: pub.StreamPath, @@ -149,11 +148,7 @@ func (s *Server) StreamInfo(ctx context.Context, req *pb.StreamSnapRequest) (res func (s *Server) TaskTree(context.Context, *emptypb.Empty) (res *pb.TaskTreeResponse, err error) { var fillData func(m task.ITask) *pb.TaskTreeResponse fillData = func(m task.ITask) (res *pb.TaskTreeResponse) { - res = &pb.TaskTreeResponse{Id: m.GetTaskID(), State: uint32(m.GetState()), Type: uint32(m.GetTaskType()), Owner: m.GetOwnerType(), StartTime: timestamppb.New(m.GetTask().StartTime), Description: maps.Collect(func(yield func(key, value string) bool) { - m.GetTask().Description.Range(func(key, value any) bool { - return yield(key.(string), fmt.Sprintf("%+v", value)) - }) - })} + res = &pb.TaskTreeResponse{Id: m.GetTaskID(), State: uint32(m.GetState()), Type: uint32(m.GetTaskType()), Owner: m.GetOwnerType(), StartTime: timestamppb.New(m.GetTask().StartTime), Description: m.GetDescriptions()} if job, ok := m.(task.IJob); ok { if blockedTask := job.Blocked(); blockedTask != nil { res.Blocked = fillData(blockedTask) @@ -172,12 +167,7 @@ func (s *Server) GetSubscribers(context.Context, *pb.SubscribersRequest) (res *p s.Streams.Call(func() error { var subscribers []*pb.SubscriberSnapShot for subscriber := range s.Subscribers.Range { - metaData := make(task.Description) - subscriber.Description.Range(func(key, value any) bool { - metaData[key.(string)] = value - return true - }) - meta, _ := json.Marshal(metaData) + meta, _ := json.Marshal(subscriber.GetDescriptions()) snap := &pb.SubscriberSnapShot{ Id: subscriber.ID, StartTime: timestamppb.New(subscriber.StartTime), @@ -615,3 +605,50 @@ func (s *Server) RemoveDevice(ctx context.Context, req *pb.RequestWithId) (res * return } + +func (s *Server) SetStreamAlias(ctx context.Context, req *pb.SetStreamAliasRequest) (res *pb.SuccessResponse, err error) { + s.Streams.Call(func() error { + reg := config.Regexp{ + Regexp: regexp.MustCompile(req.Alias), + } + if req.StreamPath != "" { + s.StreamAlias[reg] = req.StreamPath + for publisher := range s.Streams.Range { + if streamPath := reg.Replace(publisher.StreamPath, req.StreamPath); streamPath != "" { + if publisher2, ok := s.Streams.Get(streamPath); ok { + for subscriber := range publisher.Subscribers.Range { + publisher.RemoveSubscriber(subscriber) + subscriber.setAlias(reg, streamPath) + publisher2.AddSubscriber(subscriber) + } + } + } + } + for waitStream := range s.Waiting.Range { + if streamPath := reg.Replace(waitStream.StreamPath, req.StreamPath); streamPath != "" { + if publisher2, ok := s.Streams.Get(streamPath); ok { + for subscriber := range waitStream.Range { + waitStream.Remove(subscriber) + subscriber.setAlias(reg, streamPath) + publisher2.AddSubscriber(subscriber) + } + } + } + } + } else { + for reg := range s.StreamAlias { + if reg.String() == req.Alias { + for subscriber := range s.Subscribers.Range { + if subscriber.AliasKey == reg { + subscriber.removeAlias() + } + } + delete(s.StreamAlias, reg) + break + } + } + } + return nil + }) + return +} diff --git a/pb/global.pb.go b/pb/global.pb.go index 87fa297..69b4aac 100644 --- a/pb/global.pb.go +++ b/pb/global.pb.go @@ -2312,6 +2312,61 @@ func (x *DeviceInfo) GetPullURL() string { return "" } +type SetStreamAliasRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StreamPath string `protobuf:"bytes,1,opt,name=streamPath,proto3" json:"streamPath,omitempty"` + Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"` +} + +func (x *SetStreamAliasRequest) Reset() { + *x = SetStreamAliasRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_global_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetStreamAliasRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetStreamAliasRequest) ProtoMessage() {} + +func (x *SetStreamAliasRequest) ProtoReflect() protoreflect.Message { + mi := &file_global_proto_msgTypes[32] + 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 SetStreamAliasRequest.ProtoReflect.Descriptor instead. +func (*SetStreamAliasRequest) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{32} +} + +func (x *SetStreamAliasRequest) GetStreamPath() string { + if x != nil { + return x.StreamPath + } + return "" +} + +func (x *SetStreamAliasRequest) GetAlias() string { + if x != nil { + return x.Alias + } + return "" +} + var File_global_proto protoreflect.FileDescriptor var file_global_proto_rawDesc = []byte{ @@ -2643,134 +2698,147 @@ var file_global_proto_rawDesc = []byte{ 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x75, 0x6c, 0x6c, 0x55, 0x52, 0x4c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x75, 0x6c, - 0x6c, 0x55, 0x52, 0x4c, 0x32, 0xdb, 0x0f, 0x0a, 0x03, 0x61, 0x70, 0x69, 0x12, 0x50, 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, - 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x50, - 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, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x55, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x15, 0x2e, 0x67, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x53, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x15, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x54, 0x0a, 0x08, - 0x54, 0x61, 0x73, 0x6b, 0x54, 0x72, 0x65, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x6c, 0x55, 0x52, 0x4c, 0x22, 0x4d, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x41, 0x6c, 0x69, 0x61, 0x73, 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, 0x12, 0x14, 0x0a, + 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, + 0x69, 0x61, 0x73, 0x32, 0xd3, 0x10, 0x0a, 0x03, 0x61, 0x70, 0x69, 0x12, 0x50, 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, 0x17, + 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x50, 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, 0x18, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x72, - 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x74, 0x72, - 0x65, 0x65, 0x12, 0x5d, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, + 0x55, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x15, 0x2e, 0x67, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 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, 0x53, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x12, 0x15, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x54, 0x0a, 0x08, 0x54, + 0x61, 0x73, 0x6b, 0x54, 0x72, 0x65, 0x65, 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, + 0x18, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x72, 0x65, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x10, 0x12, 0x0e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x74, 0x72, 0x65, + 0x65, 0x12, 0x5d, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 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, 0x60, 0x0a, 0x08, 0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74, 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, 0x1e, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x77, 0x61, 0x69, 0x74, 0x6c, 0x69, + 0x73, 0x74, 0x12, 0x6d, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 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, 0x60, 0x0a, 0x08, 0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74, 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, 0x1e, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x77, 0x61, 0x69, 0x74, 0x6c, - 0x69, 0x73, 0x74, 0x12, 0x6d, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, - 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x69, 0x6e, - 0x66, 0x6f, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, - 0x2a, 0x7d, 0x12, 0x73, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, - 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x78, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f, - 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x12, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, - 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x54, 0x72, - 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e, 0x61, - 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, - 0x7d, 0x12, 0x78, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, - 0x6e, 0x61, 0x70, 0x12, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, - 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x64, 0x65, - 0x6f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0f, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, - 0x1e, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, + 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x69, 0x6e, 0x66, + 0x6f, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, + 0x7d, 0x12, 0x73, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x72, 0x73, 0x12, 0x1a, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1b, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, + 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x78, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x54, + 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x12, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x54, 0x72, 0x61, + 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, + 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, + 0x12, 0x78, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, + 0x61, 0x70, 0x12, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, + 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x64, 0x65, 0x6f, + 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x1e, + 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, + 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, + 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x76, + 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x41, 0x6c, 0x69, 0x61, 0x73, + 0x12, 0x1d, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, - 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, - 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x01, 0x2a, 0x12, - 0x64, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, - 0x12, 0x15, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, - 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x70, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x60, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x18, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, + 0x22, 0x21, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x61, 0x6c, + 0x69, 0x61, 0x73, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, + 0x2a, 0x2a, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x64, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x17, + 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, + 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, + 0x73, 0x74, 0x6f, 0x70, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x60, 0x0a, 0x09, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x2e, 0x67, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x65, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x18, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x65, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x46, 0x6f, - 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x18, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x47, - 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x6d, - 0x0a, 0x0c, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, - 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 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, 0x12, 0x5d, 0x0a, - 0x0d, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 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, 0x1a, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 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, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x09, - 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x2e, 0x67, 0x6c, 0x6f, 0x62, - 0x61, 0x6c, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x17, 0x2e, - 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, 0x0f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x64, 0x64, 0x3a, - 0x01, 0x2a, 0x12, 0x62, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, - 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x22, 0x17, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x2f, 0x7b, - 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x5a, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, - 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x22, 0x12, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 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, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 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, 0x6d, 0x0a, 0x0c, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1b, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x4d, + 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 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, 0x12, 0x5d, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x4c, 0x69, 0x73, 0x74, 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, 0x1a, 0x2e, + 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 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, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6c, + 0x69, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x12, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, 0x0f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x61, 0x64, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x62, 0x0a, 0x0c, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, + 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1c, 0x22, 0x17, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x5a, 0x0a, + 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x2e, + 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x1a, 0x17, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x17, 0x22, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 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, } var ( @@ -2785,7 +2853,7 @@ func file_global_proto_rawDescGZIP() []byte { return file_global_proto_rawDescData } -var file_global_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_global_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_global_proto_goTypes = []interface{}{ (*GetConfigRequest)(nil), // 0: global.GetConfigRequest (*Formily)(nil), // 1: global.Formily @@ -2819,92 +2887,95 @@ var file_global_proto_goTypes = []interface{}{ (*SubscribersResponse)(nil), // 29: global.SubscribersResponse (*DeviceListResponse)(nil), // 30: global.DeviceListResponse (*DeviceInfo)(nil), // 31: global.DeviceInfo - nil, // 32: global.Formily.PropertiesEntry - nil, // 33: global.Formily.ComponentPropsEntry - nil, // 34: global.FormilyResponse.PropertiesEntry - nil, // 35: global.TaskTreeResponse.DescriptionEntry - nil, // 36: global.StreamWaitListResponse.ListEntry - nil, // 37: global.TrackSnapShotResponse.ReaderEntry - (*timestamppb.Timestamp)(nil), // 38: google.protobuf.Timestamp - (*anypb.Any)(nil), // 39: google.protobuf.Any - (*emptypb.Empty)(nil), // 40: google.protobuf.Empty + (*SetStreamAliasRequest)(nil), // 32: global.SetStreamAliasRequest + nil, // 33: global.Formily.PropertiesEntry + nil, // 34: global.Formily.ComponentPropsEntry + nil, // 35: global.FormilyResponse.PropertiesEntry + nil, // 36: global.TaskTreeResponse.DescriptionEntry + nil, // 37: global.StreamWaitListResponse.ListEntry + nil, // 38: global.TrackSnapShotResponse.ReaderEntry + (*timestamppb.Timestamp)(nil), // 39: google.protobuf.Timestamp + (*anypb.Any)(nil), // 40: google.protobuf.Any + (*emptypb.Empty)(nil), // 41: google.protobuf.Empty } var file_global_proto_depIdxs = []int32{ - 32, // 0: global.Formily.properties:type_name -> global.Formily.PropertiesEntry - 33, // 1: global.Formily.componentProps:type_name -> global.Formily.ComponentPropsEntry - 34, // 2: global.FormilyResponse.properties:type_name -> global.FormilyResponse.PropertiesEntry + 33, // 0: global.Formily.properties:type_name -> global.Formily.PropertiesEntry + 34, // 1: global.Formily.componentProps:type_name -> global.Formily.ComponentPropsEntry + 35, // 2: global.FormilyResponse.properties:type_name -> global.FormilyResponse.PropertiesEntry 6, // 3: global.SummaryResponse.memory:type_name -> global.Usage 6, // 4: global.SummaryResponse.hardDisk:type_name -> global.Usage 5, // 5: global.SummaryResponse.netWork:type_name -> global.NetWorkInfo - 38, // 6: global.SysInfoResponse.startTime:type_name -> google.protobuf.Timestamp + 39, // 6: global.SysInfoResponse.startTime:type_name -> google.protobuf.Timestamp 8, // 7: global.SysInfoResponse.plugins:type_name -> global.PluginInfo - 38, // 8: global.TaskTreeResponse.startTime:type_name -> google.protobuf.Timestamp - 35, // 9: global.TaskTreeResponse.description:type_name -> global.TaskTreeResponse.DescriptionEntry + 39, // 8: global.TaskTreeResponse.startTime:type_name -> google.protobuf.Timestamp + 36, // 9: global.TaskTreeResponse.description:type_name -> global.TaskTreeResponse.DescriptionEntry 10, // 10: global.TaskTreeResponse.children:type_name -> global.TaskTreeResponse 10, // 11: global.TaskTreeResponse.blocked:type_name -> global.TaskTreeResponse 15, // 12: global.StreamListResponse.list:type_name -> global.StreamInfoResponse - 36, // 13: global.StreamWaitListResponse.list:type_name -> global.StreamWaitListResponse.ListEntry + 37, // 13: global.StreamWaitListResponse.list:type_name -> global.StreamWaitListResponse.ListEntry 20, // 14: global.StreamInfoResponse.audioTrack:type_name -> global.AudioTrackInfo 22, // 15: global.StreamInfoResponse.videoTrack:type_name -> global.VideoTrackInfo - 38, // 16: global.StreamInfoResponse.startTime:type_name -> google.protobuf.Timestamp - 38, // 17: global.TrackSnapShot.writeTime:type_name -> google.protobuf.Timestamp + 39, // 16: global.StreamInfoResponse.startTime:type_name -> google.protobuf.Timestamp + 39, // 17: global.TrackSnapShot.writeTime:type_name -> google.protobuf.Timestamp 16, // 18: global.TrackSnapShot.wrap:type_name -> global.Wrap 18, // 19: global.MemoryBlockGroup.list:type_name -> global.MemoryBlock 17, // 20: global.TrackSnapShotResponse.ring:type_name -> global.TrackSnapShot - 37, // 21: global.TrackSnapShotResponse.reader:type_name -> global.TrackSnapShotResponse.ReaderEntry + 38, // 21: global.TrackSnapShotResponse.reader:type_name -> global.TrackSnapShotResponse.ReaderEntry 19, // 22: global.TrackSnapShotResponse.memory:type_name -> global.MemoryBlockGroup - 38, // 23: global.SubscriberSnapShot.startTime:type_name -> google.protobuf.Timestamp + 39, // 23: global.SubscriberSnapShot.startTime:type_name -> google.protobuf.Timestamp 27, // 24: global.SubscriberSnapShot.audioReader:type_name -> global.RingReaderSnapShot 27, // 25: global.SubscriberSnapShot.videoReader:type_name -> global.RingReaderSnapShot 28, // 26: global.SubscribersResponse.list:type_name -> global.SubscriberSnapShot 31, // 27: global.DeviceListResponse.data:type_name -> global.DeviceInfo - 38, // 28: global.DeviceInfo.createTime:type_name -> google.protobuf.Timestamp - 38, // 29: global.DeviceInfo.updateTime:type_name -> google.protobuf.Timestamp + 39, // 28: global.DeviceInfo.createTime:type_name -> google.protobuf.Timestamp + 39, // 29: global.DeviceInfo.updateTime:type_name -> google.protobuf.Timestamp 1, // 30: global.Formily.PropertiesEntry.value:type_name -> global.Formily - 39, // 31: global.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any + 40, // 31: global.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any 1, // 32: global.FormilyResponse.PropertiesEntry.value:type_name -> global.Formily - 40, // 33: global.api.SysInfo:input_type -> google.protobuf.Empty - 40, // 34: global.api.Summary:input_type -> google.protobuf.Empty + 41, // 33: global.api.SysInfo:input_type -> google.protobuf.Empty + 41, // 34: global.api.Summary:input_type -> google.protobuf.Empty 24, // 35: global.api.Shutdown:input_type -> global.RequestWithId 24, // 36: global.api.Restart:input_type -> global.RequestWithId - 40, // 37: global.api.TaskTree:input_type -> google.protobuf.Empty + 41, // 37: global.api.TaskTree:input_type -> google.protobuf.Empty 11, // 38: global.api.StreamList:input_type -> global.StreamListRequest - 40, // 39: global.api.WaitList:input_type -> google.protobuf.Empty + 41, // 39: global.api.WaitList:input_type -> google.protobuf.Empty 14, // 40: global.api.StreamInfo:input_type -> global.StreamSnapRequest 26, // 41: global.api.GetSubscribers:input_type -> global.SubscribersRequest 14, // 42: global.api.AudioTrackSnap:input_type -> global.StreamSnapRequest 14, // 43: global.api.VideoTrackSnap:input_type -> global.StreamSnapRequest 25, // 44: global.api.ChangeSubscribe:input_type -> global.ChangeSubscribeRequest - 24, // 45: global.api.StopSubscribe:input_type -> global.RequestWithId - 0, // 46: global.api.GetConfig:input_type -> global.GetConfigRequest - 0, // 47: global.api.GetFormily:input_type -> global.GetConfigRequest - 4, // 48: global.api.ModifyConfig:input_type -> global.ModifyConfigRequest - 40, // 49: global.api.GetDeviceList:input_type -> google.protobuf.Empty - 31, // 50: global.api.AddDevice:input_type -> global.DeviceInfo - 24, // 51: global.api.RemoveDevice:input_type -> global.RequestWithId - 31, // 52: global.api.UpdateDevice:input_type -> global.DeviceInfo - 9, // 53: global.api.SysInfo:output_type -> global.SysInfoResponse - 7, // 54: global.api.Summary:output_type -> global.SummaryResponse - 40, // 55: global.api.Shutdown:output_type -> google.protobuf.Empty - 40, // 56: global.api.Restart:output_type -> google.protobuf.Empty - 10, // 57: global.api.TaskTree:output_type -> global.TaskTreeResponse - 12, // 58: global.api.StreamList:output_type -> global.StreamListResponse - 13, // 59: global.api.WaitList:output_type -> global.StreamWaitListResponse - 15, // 60: global.api.StreamInfo:output_type -> global.StreamInfoResponse - 29, // 61: global.api.GetSubscribers:output_type -> global.SubscribersResponse - 21, // 62: global.api.AudioTrackSnap:output_type -> global.TrackSnapShotResponse - 21, // 63: global.api.VideoTrackSnap:output_type -> global.TrackSnapShotResponse - 23, // 64: global.api.ChangeSubscribe:output_type -> global.SuccessResponse - 23, // 65: global.api.StopSubscribe:output_type -> global.SuccessResponse - 3, // 66: global.api.GetConfig:output_type -> global.GetConfigResponse - 3, // 67: global.api.GetFormily:output_type -> global.GetConfigResponse - 23, // 68: global.api.ModifyConfig:output_type -> global.SuccessResponse - 30, // 69: global.api.GetDeviceList:output_type -> global.DeviceListResponse - 23, // 70: global.api.AddDevice:output_type -> global.SuccessResponse - 23, // 71: global.api.RemoveDevice:output_type -> global.SuccessResponse - 23, // 72: global.api.UpdateDevice:output_type -> global.SuccessResponse - 53, // [53:73] is the sub-list for method output_type - 33, // [33:53] is the sub-list for method input_type + 32, // 45: global.api.SetStreamAlias:input_type -> global.SetStreamAliasRequest + 24, // 46: global.api.StopSubscribe:input_type -> global.RequestWithId + 0, // 47: global.api.GetConfig:input_type -> global.GetConfigRequest + 0, // 48: global.api.GetFormily:input_type -> global.GetConfigRequest + 4, // 49: global.api.ModifyConfig:input_type -> global.ModifyConfigRequest + 41, // 50: global.api.GetDeviceList:input_type -> google.protobuf.Empty + 31, // 51: global.api.AddDevice:input_type -> global.DeviceInfo + 24, // 52: global.api.RemoveDevice:input_type -> global.RequestWithId + 31, // 53: global.api.UpdateDevice:input_type -> global.DeviceInfo + 9, // 54: global.api.SysInfo:output_type -> global.SysInfoResponse + 7, // 55: global.api.Summary:output_type -> global.SummaryResponse + 41, // 56: global.api.Shutdown:output_type -> google.protobuf.Empty + 41, // 57: global.api.Restart:output_type -> google.protobuf.Empty + 10, // 58: global.api.TaskTree:output_type -> global.TaskTreeResponse + 12, // 59: global.api.StreamList:output_type -> global.StreamListResponse + 13, // 60: global.api.WaitList:output_type -> global.StreamWaitListResponse + 15, // 61: global.api.StreamInfo:output_type -> global.StreamInfoResponse + 29, // 62: global.api.GetSubscribers:output_type -> global.SubscribersResponse + 21, // 63: global.api.AudioTrackSnap:output_type -> global.TrackSnapShotResponse + 21, // 64: global.api.VideoTrackSnap:output_type -> global.TrackSnapShotResponse + 23, // 65: global.api.ChangeSubscribe:output_type -> global.SuccessResponse + 23, // 66: global.api.SetStreamAlias:output_type -> global.SuccessResponse + 23, // 67: global.api.StopSubscribe:output_type -> global.SuccessResponse + 3, // 68: global.api.GetConfig:output_type -> global.GetConfigResponse + 3, // 69: global.api.GetFormily:output_type -> global.GetConfigResponse + 23, // 70: global.api.ModifyConfig:output_type -> global.SuccessResponse + 30, // 71: global.api.GetDeviceList:output_type -> global.DeviceListResponse + 23, // 72: global.api.AddDevice:output_type -> global.SuccessResponse + 23, // 73: global.api.RemoveDevice:output_type -> global.SuccessResponse + 23, // 74: global.api.UpdateDevice:output_type -> global.SuccessResponse + 54, // [54:75] is the sub-list for method output_type + 33, // [33:54] is the sub-list for method input_type 33, // [33:33] is the sub-list for extension type_name 33, // [33:33] is the sub-list for extension extendee 0, // [0:33] is the sub-list for field type_name @@ -3300,6 +3371,18 @@ func file_global_proto_init() { return nil } } + file_global_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetStreamAliasRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3307,7 +3390,7 @@ func file_global_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_global_proto_rawDesc, NumEnums: 0, - NumMessages: 38, + NumMessages: 39, NumExtensions: 0, NumServices: 1, }, diff --git a/pb/global.pb.gw.go b/pb/global.pb.gw.go index 35eea9b..03bdcf2 100644 --- a/pb/global.pb.gw.go +++ b/pb/global.pb.gw.go @@ -550,6 +550,66 @@ func local_request_Api_ChangeSubscribe_0(ctx context.Context, marshaler runtime. } +func request_Api_SetStreamAlias_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetStreamAliasRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); 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["streamPath"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "streamPath") + } + + protoReq.StreamPath, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "streamPath", err) + } + + msg, err := client.SetStreamAlias(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Api_SetStreamAlias_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetStreamAliasRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); 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["streamPath"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "streamPath") + } + + protoReq.StreamPath, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "streamPath", err) + } + + msg, err := server.SetStreamAlias(ctx, &protoReq) + return msg, metadata, err + +} + func request_Api_StopSubscribe_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq RequestWithId var metadata runtime.ServerMetadata @@ -1210,6 +1270,31 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("POST", pattern_Api_SetStreamAlias_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, "/global.Api/SetStreamAlias", runtime.WithHTTPPathPattern("/api/stream/alias/{streamPath=**}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Api_SetStreamAlias_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_Api_SetStreamAlias_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_Api_StopSubscribe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1715,6 +1800,28 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("POST", pattern_Api_SetStreamAlias_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, "/global.Api/SetStreamAlias", runtime.WithHTTPPathPattern("/api/stream/alias/{streamPath=**}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Api_SetStreamAlias_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Api_SetStreamAlias_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_Api_StopSubscribe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1919,6 +2026,8 @@ var ( pattern_Api_ChangeSubscribe_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 3, 0, 4, 1, 5, 4}, []string{"api", "subscribe", "change", "id", "streamPath"}, "")) + pattern_Api_SetStreamAlias_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "alias", "streamPath"}, "")) + pattern_Api_StopSubscribe_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "subscribe", "stop", "id"}, "")) pattern_Api_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"}, "")) @@ -1961,6 +2070,8 @@ var ( forward_Api_ChangeSubscribe_0 = runtime.ForwardResponseMessage + forward_Api_SetStreamAlias_0 = runtime.ForwardResponseMessage + forward_Api_StopSubscribe_0 = runtime.ForwardResponseMessage forward_Api_GetConfig_0 = runtime.ForwardResponseMessage diff --git a/pb/global.proto b/pb/global.proto index 992c7cb..cb06d1e 100644 --- a/pb/global.proto +++ b/pb/global.proto @@ -68,7 +68,12 @@ service api { body: "*" }; } - + rpc SetStreamAlias (SetStreamAliasRequest) returns (SuccessResponse) { + option (google.api.http) = { + post: "/api/stream/alias/{streamPath=**}" + body: "*" + }; + } rpc StopSubscribe (RequestWithId) returns (SuccessResponse) { option (google.api.http) = { post: "/api/subscribe/stop/{id}" @@ -340,4 +345,9 @@ message DeviceInfo { string type = 6; // 设备类型 uint32 status = 7; // 设备状态 string pullURL = 8; // 拉流地址 +} + +message SetStreamAliasRequest { + string streamPath = 1; + string alias = 2; } \ No newline at end of file diff --git a/pb/global_grpc.pb.go b/pb/global_grpc.pb.go index 4edbfd5..91f8ff5 100644 --- a/pb/global_grpc.pb.go +++ b/pb/global_grpc.pb.go @@ -35,6 +35,7 @@ type ApiClient interface { AudioTrackSnap(ctx context.Context, in *StreamSnapRequest, opts ...grpc.CallOption) (*TrackSnapShotResponse, error) VideoTrackSnap(ctx context.Context, in *StreamSnapRequest, opts ...grpc.CallOption) (*TrackSnapShotResponse, error) ChangeSubscribe(ctx context.Context, in *ChangeSubscribeRequest, opts ...grpc.CallOption) (*SuccessResponse, error) + SetStreamAlias(ctx context.Context, in *SetStreamAliasRequest, opts ...grpc.CallOption) (*SuccessResponse, error) StopSubscribe(ctx context.Context, in *RequestWithId, opts ...grpc.CallOption) (*SuccessResponse, error) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) GetFormily(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*GetConfigResponse, error) @@ -161,6 +162,15 @@ func (c *apiClient) ChangeSubscribe(ctx context.Context, in *ChangeSubscribeRequ return out, nil } +func (c *apiClient) SetStreamAlias(ctx context.Context, in *SetStreamAliasRequest, opts ...grpc.CallOption) (*SuccessResponse, error) { + out := new(SuccessResponse) + err := c.cc.Invoke(ctx, "/global.api/SetStreamAlias", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *apiClient) StopSubscribe(ctx context.Context, in *RequestWithId, opts ...grpc.CallOption) (*SuccessResponse, error) { out := new(SuccessResponse) err := c.cc.Invoke(ctx, "/global.api/StopSubscribe", in, out, opts...) @@ -249,6 +259,7 @@ type ApiServer interface { AudioTrackSnap(context.Context, *StreamSnapRequest) (*TrackSnapShotResponse, error) VideoTrackSnap(context.Context, *StreamSnapRequest) (*TrackSnapShotResponse, error) ChangeSubscribe(context.Context, *ChangeSubscribeRequest) (*SuccessResponse, error) + SetStreamAlias(context.Context, *SetStreamAliasRequest) (*SuccessResponse, error) StopSubscribe(context.Context, *RequestWithId) (*SuccessResponse, error) GetConfig(context.Context, *GetConfigRequest) (*GetConfigResponse, error) GetFormily(context.Context, *GetConfigRequest) (*GetConfigResponse, error) @@ -300,6 +311,9 @@ func (UnimplementedApiServer) VideoTrackSnap(context.Context, *StreamSnapRequest func (UnimplementedApiServer) ChangeSubscribe(context.Context, *ChangeSubscribeRequest) (*SuccessResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChangeSubscribe not implemented") } +func (UnimplementedApiServer) SetStreamAlias(context.Context, *SetStreamAliasRequest) (*SuccessResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetStreamAlias not implemented") +} func (UnimplementedApiServer) StopSubscribe(context.Context, *RequestWithId) (*SuccessResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StopSubscribe not implemented") } @@ -553,6 +567,24 @@ func _Api_ChangeSubscribe_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Api_SetStreamAlias_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetStreamAliasRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ApiServer).SetStreamAlias(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/global.api/SetStreamAlias", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ApiServer).SetStreamAlias(ctx, req.(*SetStreamAliasRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Api_StopSubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestWithId) if err := dec(in); err != nil { @@ -752,6 +784,10 @@ var Api_ServiceDesc = grpc.ServiceDesc{ MethodName: "ChangeSubscribe", Handler: _Api_ChangeSubscribe_Handler, }, + { + MethodName: "SetStreamAlias", + Handler: _Api_SetStreamAlias_Handler, + }, { MethodName: "StopSubscribe", Handler: _Api_StopSubscribe_Handler, diff --git a/pkg/task/job.go b/pkg/task/job.go index 18a7234..d2e4d10 100644 --- a/pkg/task/job.go +++ b/pkg/task/job.go @@ -92,9 +92,7 @@ func (mt *Job) AddTask(t ITask, opt ...any) (task *Task) { case context.Context: task.parentCtx = v case Description: - for k, v := range v { - task.Description.Store(k, v) - } + task.SetDescriptions(v) case RetryConfig: task.retry = v case *slog.Logger: diff --git a/pkg/task/task.go b/pkg/task/task.go index 3d5b61c..c9099f2 100644 --- a/pkg/task/task.go +++ b/pkg/task/task.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "log/slog" + "maps" "reflect" "runtime/debug" "strings" @@ -63,6 +64,9 @@ type ( IsStopped() bool GetTaskType() TaskType GetOwnerType() string + GetDescriptions() map[string]string + SetDescription(key string, value any) + SetDescriptions(value Description) SetRetry(maxRetry int, retryInterval time.Duration) Depend(ITask) OnStart(func()) @@ -113,7 +117,7 @@ type ( handler ITask retry RetryConfig afterStartListeners, beforeDisposeListeners, afterDisposeListeners []func() - Description sync.Map + description sync.Map startup, shutdown *util.Promise parent *Job parentCtx context.Context @@ -146,7 +150,7 @@ func (task *Task) GetTaskID() uint32 { return task.ID } func (task *Task) GetOwnerType() string { - if ownerType, ok := task.Description.Load(OwnerTypeKey); ok { + if ownerType, ok := task.description.Load(OwnerTypeKey); ok { return ownerType.(string) } return strings.TrimSuffix(reflect.TypeOf(task.handler).Elem().Name(), "Task") @@ -330,13 +334,25 @@ func (task *Task) reset() { task.startup = util.NewPromise(task.Context) } +func (task *Task) GetDescriptions() map[string]string { + return maps.Collect(func(yield func(key, value string) bool) { + task.description.Range(func(key, value any) bool { + return yield(key.(string), fmt.Sprintf("%+v", value)) + }) + }) +} + func (task *Task) SetDescription(key string, value any) { - task.Description.Store(key, value) + task.description.Store(key, value) +} + +func (task *Task) RemoveDescription(key string) { + task.description.Delete(key) } func (task *Task) SetDescriptions(value Description) { for k, v := range value { - task.Description.Store(k, v) + task.description.Store(k, v) } } diff --git a/pkg/track.go b/pkg/track.go index 9bc7325..57bf58e 100644 --- a/pkg/track.go +++ b/pkg/track.go @@ -54,7 +54,7 @@ func NewAVTrack(args ...any) (t *AVTrack) { case *AVTrack: t.Logger = v.Logger.With("subtrack", t.FrameType.String()) t.RingWriter = v.RingWriter - t.ready = util.NewPromiseWithTimeout(v.ready.Context, time.Second*5) + t.ready = util.NewPromiseWithTimeout(context.TODO(), time.Second*5) case *config.Publish: t.RingWriter = NewRingWriter(v.RingSize) t.BufferRange[0] = v.BufferTime diff --git a/plugin/monitor/index.go b/plugin/monitor/index.go index 49d3c51..e3bfd21 100644 --- a/plugin/monitor/index.go +++ b/plugin/monitor/index.go @@ -38,7 +38,7 @@ func (cfg *MonitorPlugin) saveTask(task task.ITask) { th.TaskType = byte(task.GetTaskType()) th.Reason = task.StopReason().Error() th.Level = task.GetLevel() - b, _ := json.Marshal(task.GetTask().Description) + b, _ := json.Marshal(task.GetDescriptions()) th.Description = string(b) cfg.DB.Create(&th) } diff --git a/plugin/srt/pkg/receiver.go b/plugin/srt/pkg/receiver.go index cc9571c..ef64210 100644 --- a/plugin/srt/pkg/receiver.go +++ b/plugin/srt/pkg/receiver.go @@ -12,7 +12,6 @@ import ( mpegts "m7s.live/m7s/v5/plugin/hls/pkg/ts" ) - type Receiver struct { task.Task Publisher *m7s.Publisher @@ -31,7 +30,9 @@ func (r *Receiver) readPES() { var videoFrame *pkg.AnnexB var err error defer func() { - r.Stop(err) + if err != nil { + r.Stop(err) + } }() for pes := range r.TSStream.PESChan { if r.Err() != nil { diff --git a/server.go b/server.go index 18a2f47..2ec98fb 100644 --- a/server.go +++ b/server.go @@ -124,6 +124,7 @@ func NewServer(conf any) (s *Server) { "arch": sysruntime.GOARCH, "cpus": int32(sysruntime.NumCPU()), }) + s.StreamAlias = make(map[config.Regexp]string) //s.Transforms.PublishEvent = make(chan *Publisher, 10) s.prometheusDesc.init() return @@ -209,7 +210,7 @@ func (s *Server) Start() (err error) { } if configYaml != nil { if err = yaml.Unmarshal(configYaml, &cg); err != nil { - s.Error("parsing yml error:", err) + s.Error("parsing yml", "error", err) } } s.Config.Parse(&s.config, "GLOBAL") @@ -296,7 +297,7 @@ func (s *Server) Start() (err error) { s.Streams.OnStart(func() { s.Streams.AddTask(&CheckSubWaitTimeout{s: s}) }) - s.Transforms.AddTask(&TransformsPublishEvent{Transforms: &s.Transforms}) + // s.Transforms.AddTask(&TransformsPublishEvent{Transforms: &s.Transforms}) s.Info("server started") s.Post(func() error { for plugin := range s.Plugins.Range { diff --git a/subscriber.go b/subscriber.go index 2d681a3..08549cb 100644 --- a/subscriber.go +++ b/subscriber.go @@ -3,7 +3,6 @@ package m7s import ( "encoding/binary" "errors" - "fmt" "net" "net/http" "net/url" @@ -63,6 +62,8 @@ type SubscriberCollection = util.Collection[uint32, *Subscriber] type Subscriber struct { PubSubBase config.Subscribe + AliasStreamPath string + AliasKey config.Regexp Publisher *Publisher waitPublishDone *util.Promise AudioReader, VideoReader *AVRingReader @@ -82,26 +83,59 @@ func createSubscriber(p *Plugin, streamPath string, conf config.Subscribe) *Subs return subscriber } -func (s *Subscriber) Start() (err error) { +func (s *Subscriber) setAlias(key config.Regexp, streamPath string) { + s.AliasKey = key + s.AliasStreamPath = s.StreamPath + s.StreamPath = streamPath + s.SetDescription("streamPath", streamPath) + s.SetDescription("alias", s.AliasStreamPath) +} + +func (s *Subscriber) removeAlias() { server := s.Plugin.Server - server.Subscribers.Add(s) - s.Info("subscribe") + if s.Publisher != nil { + s.Publisher.RemoveSubscriber(s) + } else { + if waitStream, ok := server.Waiting.Get(s.StreamPath); ok { + waitStream.Remove(s) + } + } + s.StreamPath = s.AliasStreamPath + s.AliasStreamPath = "" + s.AliasKey = config.Regexp{} + s.RemoveDescription("alias") + s.SetDescription("streamPath", s.StreamPath) if publisher, ok := server.Streams.Get(s.StreamPath); ok { publisher.AddSubscriber(s) return } else { - for reg, streamPath := range server.StreamAlias { - if g := reg.FindStringSubmatch(s.StreamPath); len(g) > 0 { - for i, gg := range g { - streamPath = strings.ReplaceAll(streamPath, fmt.Sprintf("$%d", i), gg) - } - if publisher, ok = server.Streams.Get(streamPath); ok { - s.SetDescription("alias", streamPath) - publisher.AddSubscriber(s) - return - } - } + if waitStream, ok := server.Waiting.Get(s.StreamPath); ok { + waitStream.Add(s) + } else { + server.createWait(s.StreamPath).Add(s) } + for plugin := range server.Plugins.Range { + plugin.OnSubscribe(s) + } + } +} + +func (s *Subscriber) Start() (err error) { + server := s.Plugin.Server + server.Subscribers.Add(s) + s.Info("subscribe") + + for reg, streamPath := range server.StreamAlias { + if streamPath = reg.Replace(s.StreamPath, streamPath); streamPath != "" { + s.setAlias(reg, streamPath) + break + } + } + + if publisher, ok := server.Streams.Get(s.StreamPath); ok { + publisher.AddSubscriber(s) + return + } else { if waitStream, ok := server.Waiting.Get(s.StreamPath); ok { waitStream.Add(s) } else { diff --git a/transformer.go b/transformer.go index 6bf4ac4..413a5a9 100644 --- a/transformer.go +++ b/transformer.go @@ -40,10 +40,10 @@ type ( util.Collection[string, *TransformedMap] //PublishEvent chan *Publisher } - TransformsPublishEvent struct { - task.ChannelTask - Transforms *Transforms - } + // TransformsPublishEvent struct { + // task.ChannelTask + // Transforms *Transforms + // } ) //func (t *TransformsPublishEvent) GetSignal() any {