From cad47aec5ca9aa01bb0c2df3fb596022955f56a3 Mon Sep 17 00:00:00 2001 From: pggiroro Date: Wed, 2 Jul 2025 21:48:28 +0800 Subject: [PATCH] feat: send alarminfo through hook --- alarm.go | 20 +- api.go | 113 ++ pb/auth.pb.gw.go | 160 +-- pb/global.pb.go | 613 +++++++--- pb/global.pb.gw.go | 2523 ++++++++++++++---------------------------- pb/global.proto | 38 + pb/global_grpc.pb.go | 38 + pkg/config/types.go | 9 + plugin.go | 136 ++- puller.go | 29 +- pusher.go | 27 +- recoder.go | 27 +- server.go | 9 +- transformer.go | 23 +- 14 files changed, 1692 insertions(+), 2073 deletions(-) diff --git a/alarm.go b/alarm.go index 4709d8c..a247c0b 100644 --- a/alarm.go +++ b/alarm.go @@ -6,15 +6,17 @@ import ( // AlarmInfo 报警信息实体,用于存储到数据库 type AlarmInfo struct { - ID uint `gorm:"primaryKey;autoIncrement" json:"id"` // 主键,自增ID - ServerInfo string `gorm:"type:varchar(255);not null" json:"server_info"` // 服务器信息 - StreamName string `gorm:"type:varchar(255);index" json:"stream_name"` // 流名称 - StreamPath string `gorm:"type:varchar(500)" json:"stream_path"` // 流的streampath - AlarmDesc string `gorm:"type:varchar(500);not null" json:"alarm_desc"` // 报警描述 - AlarmType int `gorm:"not null;index" json:"alarm_type"` // 报警类型(对应之前定义的常量) - IsSent bool `gorm:"default:false" json:"is_sent"` // 是否已成功发送 - CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"` // 创建时间,报警时间 - UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"` // 更新时间 + ID uint `gorm:"primaryKey;autoIncrement" json:"id"` // 主键,自增ID + ServerInfo string `gorm:"type:varchar(255);not null" json:"serverInfo"` // 服务器信息 + StreamName string `gorm:"type:varchar(255);index" json:"streamName"` // 流名称 + StreamPath string `gorm:"type:varchar(500)" json:"streamPath"` // 流的streampath + AlarmName string `gorm:"type:varchar(255);not null" json:"alarmName"` // 报警名称 + AlarmDesc string `gorm:"type:varchar(500);not null" json:"alarmDesc"` // 报警描述 + AlarmType int `gorm:"not null;index" json:"alarmType"` // 报警类型(对应之前定义的常量) + IsSent bool `gorm:"default:false" json:"isSent"` // 是否已成功发送 + CreatedAt time.Time `gorm:"autoCreateTime" json:"createdAt"` // 创建时间,报警时间 + UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updatedAt"` // 更新时间 + FilePath string `gorm:"type:varchar(255)" json:"filePath"` // 文件路径 } // TableName 指定表名 diff --git a/api.go b/api.go index 490c1cd..4435a09 100644 --- a/api.go +++ b/api.go @@ -942,3 +942,116 @@ func (s *Server) GetTransformList(ctx context.Context, req *emptypb.Empty) (res }) return } + +func (s *Server) GetAlarmList(ctx context.Context, req *pb.AlarmListRequest) (res *pb.AlarmListResponse, err error) { + // 初始化响应对象 + res = &pb.AlarmListResponse{ + Code: 0, + Message: "success", + PageNum: req.PageNum, + PageSize: req.PageSize, + } + + // 检查数据库连接是否可用 + if s.DB == nil { + res.Code = 500 + res.Message = "数据库连接不可用" + return res, nil + } + + // 构建查询条件 + query := s.DB.Model(&AlarmInfo{}) + + // 添加时间范围过滤 + startTime, endTime, err := util.TimeRangeQueryParse(url.Values{ + "range": []string{req.Range}, + "start": []string{req.Start}, + "end": []string{req.End}, + }) + if err == nil { + if !startTime.IsZero() { + query = query.Where("created_at >= ?", startTime) + } + if !endTime.IsZero() { + query = query.Where("created_at <= ?", endTime) + } + } + + // 添加告警类型过滤 + if req.AlarmType != 0 { + query = query.Where("alarm_type = ?", req.AlarmType) + } + + // 添加 StreamPath 过滤 + if req.StreamPath != "" { + if strings.Contains(req.StreamPath, "*") { + // 支持通配符搜索 + query = query.Where("stream_path LIKE ?", strings.ReplaceAll(req.StreamPath, "*", "%")) + } else { + query = query.Where("stream_path = ?", req.StreamPath) + } + } + + // 添加 StreamName 过滤 + if req.StreamName != "" { + if strings.Contains(req.StreamName, "*") { + // 支持通配符搜索 + query = query.Where("stream_name LIKE ?", strings.ReplaceAll(req.StreamName, "*", "%")) + } else { + query = query.Where("stream_name = ?", req.StreamName) + } + } + + // 计算总记录数 + var total int64 + if err = query.Count(&total).Error; err != nil { + res.Code = 500 + res.Message = "查询告警信息总数失败: " + err.Error() + return res, nil + } + res.Total = int32(total) + + // 如果没有记录,直接返回 + if total == 0 { + return res, nil + } + + // 处理分页参数 + if req.PageNum <= 0 { + req.PageNum = 1 + } + if req.PageSize <= 0 { + req.PageSize = 10 + } + + // 查询分页数据 + var alarmInfoList []AlarmInfo + offset := (req.PageNum - 1) * req.PageSize + if err = query.Order("created_at DESC"). + Offset(int(offset)). + Limit(int(req.PageSize)). + Find(&alarmInfoList).Error; err != nil { + res.Code = 500 + res.Message = "查询告警信息失败: " + err.Error() + return res, nil + } + + // 转换为 protobuf 格式 + res.Data = make([]*pb.AlarmInfo, len(alarmInfoList)) + for i, alarm := range alarmInfoList { + res.Data[i] = &pb.AlarmInfo{ + Id: uint32(alarm.ID), + ServerInfo: alarm.ServerInfo, + StreamName: alarm.StreamName, + StreamPath: alarm.StreamPath, + AlarmDesc: alarm.AlarmDesc, + AlarmType: int32(alarm.AlarmType), + IsSent: alarm.IsSent, + CreatedAt: timestamppb.New(alarm.CreatedAt), + UpdatedAt: timestamppb.New(alarm.UpdatedAt), + FilePath: alarm.FilePath, + } + } + + return res, nil +} diff --git a/pb/auth.pb.gw.go b/pb/auth.pb.gw.go index e7f75d6..7e43475 100644 --- a/pb/auth.pb.gw.go +++ b/pb/auth.pb.gw.go @@ -10,6 +10,7 @@ package pb import ( "context" + "errors" "io" "net/http" @@ -24,116 +25,110 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_Auth_Login_0(ctx context.Context, marshaler runtime.Marshaler, client AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LoginRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq LoginRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Login(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Auth_Login_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LoginRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq LoginRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Login(ctx, &protoReq) return msg, metadata, err - } func request_Auth_Logout_0(ctx context.Context, marshaler runtime.Marshaler, client AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LogoutRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq LogoutRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Logout(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Auth_Logout_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LogoutRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq LogoutRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Logout(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_Auth_GetUserInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_Auth_GetUserInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_Auth_GetUserInfo_0(ctx context.Context, marshaler runtime.Marshaler, client AuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UserInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq UserInfoRequest + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Auth_GetUserInfo_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetUserInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Auth_GetUserInfo_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UserInfoRequest - var metadata runtime.ServerMetadata - + var ( + protoReq UserInfoRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Auth_GetUserInfo_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetUserInfo(ctx, &protoReq) return msg, metadata, err - } // RegisterAuthHandlerServer registers the http handlers for service Auth to "mux". // UnaryRPC :call AuthServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServer) error { - - mux.Handle("POST", pattern_Auth_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Auth_Login_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, "/pb.Auth/Login", runtime.WithHTTPPathPattern("/api/auth/login")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Auth/Login", runtime.WithHTTPPathPattern("/api/auth/login")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -145,20 +140,15 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Auth_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Auth_Logout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Auth_Logout_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, "/pb.Auth/Logout", runtime.WithHTTPPathPattern("/api/auth/logout")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Auth/Logout", runtime.WithHTTPPathPattern("/api/auth/logout")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -170,20 +160,15 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Auth_Logout_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Auth_GetUserInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Auth_GetUserInfo_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, "/pb.Auth/GetUserInfo", runtime.WithHTTPPathPattern("/api/auth/userinfo")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.Auth/GetUserInfo", runtime.WithHTTPPathPattern("/api/auth/userinfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -195,9 +180,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Auth_GetUserInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -206,25 +189,24 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve // RegisterAuthHandlerFromEndpoint is same as RegisterAuthHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterAuthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterAuthHandler(ctx, mux, conn) } @@ -238,16 +220,13 @@ func RegisterAuthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc. // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AuthClient" to call the correct interceptors. +// "AuthClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthClient) error { - - mux.Handle("POST", pattern_Auth_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Auth_Login_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, "/pb.Auth/Login", runtime.WithHTTPPathPattern("/api/auth/login")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.Auth/Login", runtime.WithHTTPPathPattern("/api/auth/login")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -258,18 +237,13 @@ func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Auth_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Auth_Logout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Auth_Logout_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, "/pb.Auth/Logout", runtime.WithHTTPPathPattern("/api/auth/logout")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.Auth/Logout", runtime.WithHTTPPathPattern("/api/auth/logout")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -280,18 +254,13 @@ func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Auth_Logout_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Auth_GetUserInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Auth_GetUserInfo_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, "/pb.Auth/GetUserInfo", runtime.WithHTTPPathPattern("/api/auth/userinfo")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/pb.Auth/GetUserInfo", runtime.WithHTTPPathPattern("/api/auth/userinfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -302,26 +271,19 @@ func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Auth_GetUserInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_Auth_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "auth", "login"}, "")) - - pattern_Auth_Logout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "auth", "logout"}, "")) - + pattern_Auth_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "auth", "login"}, "")) + pattern_Auth_Logout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "auth", "logout"}, "")) pattern_Auth_GetUserInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "auth", "userinfo"}, "")) ) var ( - forward_Auth_Login_0 = runtime.ForwardResponseMessage - - forward_Auth_Logout_0 = runtime.ForwardResponseMessage - + forward_Auth_Login_0 = runtime.ForwardResponseMessage + forward_Auth_Logout_0 = runtime.ForwardResponseMessage forward_Auth_GetUserInfo_0 = runtime.ForwardResponseMessage ) diff --git a/pb/global.pb.go b/pb/global.pb.go index a48a902..8d1a696 100644 --- a/pb/global.pb.go +++ b/pb/global.pb.go @@ -4770,6 +4770,306 @@ func (x *ReqRecordCatalog) GetType() string { return "" } +type AlarmInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ServerInfo string `protobuf:"bytes,2,opt,name=serverInfo,proto3" json:"serverInfo,omitempty"` + StreamName string `protobuf:"bytes,3,opt,name=streamName,proto3" json:"streamName,omitempty"` + StreamPath string `protobuf:"bytes,4,opt,name=streamPath,proto3" json:"streamPath,omitempty"` + AlarmDesc string `protobuf:"bytes,5,opt,name=alarmDesc,proto3" json:"alarmDesc,omitempty"` + AlarmType int32 `protobuf:"varint,6,opt,name=alarmType,proto3" json:"alarmType,omitempty"` + IsSent bool `protobuf:"varint,7,opt,name=isSent,proto3" json:"isSent,omitempty"` + FilePath string `protobuf:"bytes,8,opt,name=filePath,proto3" json:"filePath,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AlarmInfo) Reset() { + *x = AlarmInfo{} + mi := &file_global_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AlarmInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AlarmInfo) ProtoMessage() {} + +func (x *AlarmInfo) ProtoReflect() protoreflect.Message { + mi := &file_global_proto_msgTypes[66] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AlarmInfo.ProtoReflect.Descriptor instead. +func (*AlarmInfo) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{66} +} + +func (x *AlarmInfo) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AlarmInfo) GetServerInfo() string { + if x != nil { + return x.ServerInfo + } + return "" +} + +func (x *AlarmInfo) GetStreamName() string { + if x != nil { + return x.StreamName + } + return "" +} + +func (x *AlarmInfo) GetStreamPath() string { + if x != nil { + return x.StreamPath + } + return "" +} + +func (x *AlarmInfo) GetAlarmDesc() string { + if x != nil { + return x.AlarmDesc + } + return "" +} + +func (x *AlarmInfo) GetAlarmType() int32 { + if x != nil { + return x.AlarmType + } + return 0 +} + +func (x *AlarmInfo) GetIsSent() bool { + if x != nil { + return x.IsSent + } + return false +} + +func (x *AlarmInfo) GetFilePath() string { + if x != nil { + return x.FilePath + } + return "" +} + +func (x *AlarmInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *AlarmInfo) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type AlarmListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PageNum int32 `protobuf:"varint,1,opt,name=pageNum,proto3" json:"pageNum,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Range string `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"` + Start string `protobuf:"bytes,4,opt,name=start,proto3" json:"start,omitempty"` + End string `protobuf:"bytes,5,opt,name=end,proto3" json:"end,omitempty"` + AlarmType int32 `protobuf:"varint,6,opt,name=alarmType,proto3" json:"alarmType,omitempty"` + StreamPath string `protobuf:"bytes,7,opt,name=streamPath,proto3" json:"streamPath,omitempty"` + StreamName string `protobuf:"bytes,8,opt,name=streamName,proto3" json:"streamName,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AlarmListRequest) Reset() { + *x = AlarmListRequest{} + mi := &file_global_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AlarmListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AlarmListRequest) ProtoMessage() {} + +func (x *AlarmListRequest) ProtoReflect() protoreflect.Message { + mi := &file_global_proto_msgTypes[67] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AlarmListRequest.ProtoReflect.Descriptor instead. +func (*AlarmListRequest) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{67} +} + +func (x *AlarmListRequest) GetPageNum() int32 { + if x != nil { + return x.PageNum + } + return 0 +} + +func (x *AlarmListRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *AlarmListRequest) GetRange() string { + if x != nil { + return x.Range + } + return "" +} + +func (x *AlarmListRequest) GetStart() string { + if x != nil { + return x.Start + } + return "" +} + +func (x *AlarmListRequest) GetEnd() string { + if x != nil { + return x.End + } + return "" +} + +func (x *AlarmListRequest) GetAlarmType() int32 { + if x != nil { + return x.AlarmType + } + return 0 +} + +func (x *AlarmListRequest) GetStreamPath() string { + if x != nil { + return x.StreamPath + } + return "" +} + +func (x *AlarmListRequest) GetStreamName() string { + if x != nil { + return x.StreamName + } + return "" +} + +type AlarmListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Total int32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` + PageNum int32 `protobuf:"varint,4,opt,name=pageNum,proto3" json:"pageNum,omitempty"` + PageSize int32 `protobuf:"varint,5,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Data []*AlarmInfo `protobuf:"bytes,6,rep,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AlarmListResponse) Reset() { + *x = AlarmListResponse{} + mi := &file_global_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AlarmListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AlarmListResponse) ProtoMessage() {} + +func (x *AlarmListResponse) ProtoReflect() protoreflect.Message { + mi := &file_global_proto_msgTypes[68] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AlarmListResponse.ProtoReflect.Descriptor instead. +func (*AlarmListResponse) Descriptor() ([]byte, []int) { + return file_global_proto_rawDescGZIP(), []int{68} +} + +func (x *AlarmListResponse) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *AlarmListResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *AlarmListResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *AlarmListResponse) GetPageNum() int32 { + if x != nil { + return x.PageNum + } + return 0 +} + +func (x *AlarmListResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *AlarmListResponse) GetData() []*AlarmInfo { + if x != nil { + return x.Data + } + return nil +} + var File_global_proto protoreflect.FileDescriptor const file_global_proto_rawDesc = "" + @@ -5251,7 +5551,45 @@ const file_global_proto_rawDesc = "" + "\amessage\x18\x02 \x01(\tR\amessage\x12&\n" + "\x04data\x18\x03 \x03(\v2\x12.global.RecordFileR\x04data\"&\n" + "\x10ReqRecordCatalog\x12\x12\n" + - "\x04type\x18\x01 \x01(\tR\x04type2\xba\"\n" + + "\x04type\x18\x01 \x01(\tR\x04type\"\xdf\x02\n" + + "\tAlarmInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\rR\x02id\x12\x1e\n" + + "\n" + + "serverInfo\x18\x02 \x01(\tR\n" + + "serverInfo\x12\x1e\n" + + "\n" + + "streamName\x18\x03 \x01(\tR\n" + + "streamName\x12\x1e\n" + + "\n" + + "streamPath\x18\x04 \x01(\tR\n" + + "streamPath\x12\x1c\n" + + "\talarmDesc\x18\x05 \x01(\tR\talarmDesc\x12\x1c\n" + + "\talarmType\x18\x06 \x01(\x05R\talarmType\x12\x16\n" + + "\x06isSent\x18\a \x01(\bR\x06isSent\x12\x1a\n" + + "\bfilePath\x18\b \x01(\tR\bfilePath\x128\n" + + "\tcreatedAt\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x128\n" + + "\tupdatedAt\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\xe4\x01\n" + + "\x10AlarmListRequest\x12\x18\n" + + "\apageNum\x18\x01 \x01(\x05R\apageNum\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x14\n" + + "\x05range\x18\x03 \x01(\tR\x05range\x12\x14\n" + + "\x05start\x18\x04 \x01(\tR\x05start\x12\x10\n" + + "\x03end\x18\x05 \x01(\tR\x03end\x12\x1c\n" + + "\talarmType\x18\x06 \x01(\x05R\talarmType\x12\x1e\n" + + "\n" + + "streamPath\x18\a \x01(\tR\n" + + "streamPath\x12\x1e\n" + + "\n" + + "streamName\x18\b \x01(\tR\n" + + "streamName\"\xb4\x01\n" + + "\x11AlarmListResponse\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" + + "\x05total\x18\x03 \x01(\x05R\x05total\x12\x18\n" + + "\apageNum\x18\x04 \x01(\x05R\apageNum\x12\x1a\n" + + "\bpageSize\x18\x05 \x01(\x05R\bpageSize\x12%\n" + + "\x04data\x18\x06 \x03(\v2\x11.global.AlarmInfoR\x04data2\x98#\n" + "\x03api\x12P\n" + "\aSysInfo\x12\x16.google.protobuf.Empty\x1a\x17.global.SysInfoResponse\"\x14\x82\xd3\xe4\x93\x02\x0e\x12\f/api/sysinfo\x12i\n" + "\x0fDisabledPlugins\x12\x16.google.protobuf.Empty\x1a\x1f.global.DisabledPluginsResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\x12\x15/api/plugins/disabled\x12P\n" + @@ -5297,7 +5635,8 @@ const file_global_proto_rawDesc = "" + "\rGetRecordList\x12\x15.global.ReqRecordList\x1a\x1a.global.RecordResponseList\"/\x82\xd3\xe4\x93\x02)\x12'/api/record/{type}/list/{streamPath=**}\x12\x83\x01\n" + "\x12GetEventRecordList\x12\x15.global.ReqRecordList\x1a\x1f.global.EventRecordResponseList\"5\x82\xd3\xe4\x93\x02/\x12-/api/record/{type}/event/list/{streamPath=**}\x12i\n" + "\x10GetRecordCatalog\x12\x18.global.ReqRecordCatalog\x1a\x17.global.ResponseCatalog\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/api/record/{type}/catalog\x12u\n" + - "\fDeleteRecord\x12\x17.global.ReqRecordDelete\x1a\x16.global.ResponseDelete\"4\x82\xd3\xe4\x93\x02.:\x01*\")/api/record/{type}/delete/{streamPath=**}B\x10Z\x0em7s.live/v5/pbb\x06proto3" + "\fDeleteRecord\x12\x17.global.ReqRecordDelete\x1a\x16.global.ResponseDelete\"4\x82\xd3\xe4\x93\x02.:\x01*\")/api/record/{type}/delete/{streamPath=**}\x12\\\n" + + "\fGetAlarmList\x12\x18.global.AlarmListRequest\x1a\x19.global.AlarmListResponse\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/api/alarm/listB\x10Z\x0em7s.live/v5/pbb\x06proto3" var ( file_global_proto_rawDescOnce sync.Once @@ -5311,7 +5650,7 @@ func file_global_proto_rawDescGZIP() []byte { return file_global_proto_rawDescData } -var file_global_proto_msgTypes = make([]protoimpl.MessageInfo, 73) +var file_global_proto_msgTypes = make([]protoimpl.MessageInfo, 76) var file_global_proto_goTypes = []any{ (*DisabledPluginsResponse)(nil), // 0: global.DisabledPluginsResponse (*GetConfigRequest)(nil), // 1: global.GetConfigRequest @@ -5379,170 +5718,178 @@ var file_global_proto_goTypes = []any{ (*ReqRecordDelete)(nil), // 63: global.ReqRecordDelete (*ResponseDelete)(nil), // 64: global.ResponseDelete (*ReqRecordCatalog)(nil), // 65: global.ReqRecordCatalog - nil, // 66: global.Formily.PropertiesEntry - nil, // 67: global.Formily.ComponentPropsEntry - nil, // 68: global.FormilyResponse.PropertiesEntry - nil, // 69: global.PluginInfo.DescriptionEntry - nil, // 70: global.TaskTreeData.DescriptionEntry - nil, // 71: global.StreamWaitListResponse.ListEntry - nil, // 72: global.TrackSnapShotData.ReaderEntry - (*timestamppb.Timestamp)(nil), // 73: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 74: google.protobuf.Duration - (*anypb.Any)(nil), // 75: google.protobuf.Any - (*emptypb.Empty)(nil), // 76: google.protobuf.Empty + (*AlarmInfo)(nil), // 66: global.AlarmInfo + (*AlarmListRequest)(nil), // 67: global.AlarmListRequest + (*AlarmListResponse)(nil), // 68: global.AlarmListResponse + nil, // 69: global.Formily.PropertiesEntry + nil, // 70: global.Formily.ComponentPropsEntry + nil, // 71: global.FormilyResponse.PropertiesEntry + nil, // 72: global.PluginInfo.DescriptionEntry + nil, // 73: global.TaskTreeData.DescriptionEntry + nil, // 74: global.StreamWaitListResponse.ListEntry + nil, // 75: global.TrackSnapShotData.ReaderEntry + (*timestamppb.Timestamp)(nil), // 76: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 77: google.protobuf.Duration + (*anypb.Any)(nil), // 78: google.protobuf.Any + (*emptypb.Empty)(nil), // 79: google.protobuf.Empty } var file_global_proto_depIdxs = []int32{ 12, // 0: global.DisabledPluginsResponse.data:type_name -> global.PluginInfo - 66, // 1: global.Formily.properties:type_name -> global.Formily.PropertiesEntry - 67, // 2: global.Formily.componentProps:type_name -> global.Formily.ComponentPropsEntry - 68, // 3: global.FormilyResponse.properties:type_name -> global.FormilyResponse.PropertiesEntry + 69, // 1: global.Formily.properties:type_name -> global.Formily.PropertiesEntry + 70, // 2: global.Formily.componentProps:type_name -> global.Formily.ComponentPropsEntry + 71, // 3: global.FormilyResponse.properties:type_name -> global.FormilyResponse.PropertiesEntry 4, // 4: global.GetConfigResponse.data:type_name -> global.ConfigData 10, // 5: global.SummaryResponse.memory:type_name -> global.Usage 10, // 6: global.SummaryResponse.hardDisk:type_name -> global.Usage 9, // 7: global.SummaryResponse.netWork:type_name -> global.NetWorkInfo - 69, // 8: global.PluginInfo.description:type_name -> global.PluginInfo.DescriptionEntry - 73, // 9: global.SysInfoData.startTime:type_name -> google.protobuf.Timestamp + 72, // 8: global.PluginInfo.description:type_name -> global.PluginInfo.DescriptionEntry + 76, // 9: global.SysInfoData.startTime:type_name -> google.protobuf.Timestamp 12, // 10: global.SysInfoData.plugins:type_name -> global.PluginInfo 13, // 11: global.SysInfoResponse.data:type_name -> global.SysInfoData - 73, // 12: global.TaskTreeData.startTime:type_name -> google.protobuf.Timestamp - 70, // 13: global.TaskTreeData.description:type_name -> global.TaskTreeData.DescriptionEntry + 76, // 12: global.TaskTreeData.startTime:type_name -> google.protobuf.Timestamp + 73, // 13: global.TaskTreeData.description:type_name -> global.TaskTreeData.DescriptionEntry 15, // 14: global.TaskTreeData.children:type_name -> global.TaskTreeData 15, // 15: global.TaskTreeData.blocked:type_name -> global.TaskTreeData 15, // 16: global.TaskTreeResponse.data:type_name -> global.TaskTreeData 22, // 17: global.StreamListResponse.data:type_name -> global.StreamInfo - 71, // 18: global.StreamWaitListResponse.list:type_name -> global.StreamWaitListResponse.ListEntry + 74, // 18: global.StreamWaitListResponse.list:type_name -> global.StreamWaitListResponse.ListEntry 22, // 19: global.StreamInfoResponse.data:type_name -> global.StreamInfo 28, // 20: global.StreamInfo.audioTrack:type_name -> global.AudioTrackInfo 31, // 21: global.StreamInfo.videoTrack:type_name -> global.VideoTrackInfo - 73, // 22: global.StreamInfo.startTime:type_name -> google.protobuf.Timestamp - 74, // 23: global.StreamInfo.bufferTime:type_name -> google.protobuf.Duration + 76, // 22: global.StreamInfo.startTime:type_name -> google.protobuf.Timestamp + 77, // 23: global.StreamInfo.bufferTime:type_name -> google.protobuf.Duration 23, // 24: global.StreamInfo.recording:type_name -> global.RecordingDetail - 74, // 25: global.RecordingDetail.fragment:type_name -> google.protobuf.Duration - 73, // 26: global.TrackSnapShot.writeTime:type_name -> google.protobuf.Timestamp + 77, // 25: global.RecordingDetail.fragment:type_name -> google.protobuf.Duration + 76, // 26: global.TrackSnapShot.writeTime:type_name -> google.protobuf.Timestamp 24, // 27: global.TrackSnapShot.wrap:type_name -> global.Wrap 26, // 28: global.MemoryBlockGroup.list:type_name -> global.MemoryBlock 25, // 29: global.TrackSnapShotData.ring:type_name -> global.TrackSnapShot - 72, // 30: global.TrackSnapShotData.reader:type_name -> global.TrackSnapShotData.ReaderEntry + 75, // 30: global.TrackSnapShotData.reader:type_name -> global.TrackSnapShotData.ReaderEntry 27, // 31: global.TrackSnapShotData.memory:type_name -> global.MemoryBlockGroup 29, // 32: global.TrackSnapShotResponse.data:type_name -> global.TrackSnapShotData - 73, // 33: global.SubscriberSnapShot.startTime:type_name -> google.protobuf.Timestamp + 76, // 33: global.SubscriberSnapShot.startTime:type_name -> google.protobuf.Timestamp 37, // 34: global.SubscriberSnapShot.audioReader:type_name -> global.RingReaderSnapShot 37, // 35: global.SubscriberSnapShot.videoReader:type_name -> global.RingReaderSnapShot - 74, // 36: global.SubscriberSnapShot.bufferTime:type_name -> google.protobuf.Duration + 77, // 36: global.SubscriberSnapShot.bufferTime:type_name -> google.protobuf.Duration 38, // 37: global.SubscribersResponse.data:type_name -> global.SubscriberSnapShot 41, // 38: global.PullProxyListResponse.data:type_name -> global.PullProxyInfo - 73, // 39: global.PullProxyInfo.createTime:type_name -> google.protobuf.Timestamp - 73, // 40: global.PullProxyInfo.updateTime:type_name -> google.protobuf.Timestamp - 74, // 41: global.PullProxyInfo.recordFragment:type_name -> google.protobuf.Duration - 73, // 42: global.PushProxyInfo.createTime:type_name -> google.protobuf.Timestamp - 73, // 43: global.PushProxyInfo.updateTime:type_name -> google.protobuf.Timestamp + 76, // 39: global.PullProxyInfo.createTime:type_name -> google.protobuf.Timestamp + 76, // 40: global.PullProxyInfo.updateTime:type_name -> google.protobuf.Timestamp + 77, // 41: global.PullProxyInfo.recordFragment:type_name -> google.protobuf.Duration + 76, // 42: global.PushProxyInfo.createTime:type_name -> google.protobuf.Timestamp + 76, // 43: global.PushProxyInfo.updateTime:type_name -> google.protobuf.Timestamp 42, // 44: global.PushProxyListResponse.data:type_name -> global.PushProxyInfo 45, // 45: global.StreamAliasListResponse.data:type_name -> global.StreamAlias - 73, // 46: global.Recording.startTime:type_name -> google.protobuf.Timestamp + 76, // 46: global.Recording.startTime:type_name -> google.protobuf.Timestamp 49, // 47: global.RecordingListResponse.data:type_name -> global.Recording - 73, // 48: global.PushInfo.startTime:type_name -> google.protobuf.Timestamp + 76, // 48: global.PushInfo.startTime:type_name -> google.protobuf.Timestamp 51, // 49: global.PushListResponse.data:type_name -> global.PushInfo 54, // 50: global.TransformListResponse.data:type_name -> global.Transform - 73, // 51: global.RecordFile.startTime:type_name -> google.protobuf.Timestamp - 73, // 52: global.RecordFile.endTime:type_name -> google.protobuf.Timestamp - 73, // 53: global.EventRecordFile.startTime:type_name -> google.protobuf.Timestamp - 73, // 54: global.EventRecordFile.endTime:type_name -> google.protobuf.Timestamp + 76, // 51: global.RecordFile.startTime:type_name -> google.protobuf.Timestamp + 76, // 52: global.RecordFile.endTime:type_name -> google.protobuf.Timestamp + 76, // 53: global.EventRecordFile.startTime:type_name -> google.protobuf.Timestamp + 76, // 54: global.EventRecordFile.endTime:type_name -> google.protobuf.Timestamp 57, // 55: global.RecordResponseList.data:type_name -> global.RecordFile 58, // 56: global.EventRecordResponseList.data:type_name -> global.EventRecordFile - 73, // 57: global.Catalog.startTime:type_name -> google.protobuf.Timestamp - 73, // 58: global.Catalog.endTime:type_name -> google.protobuf.Timestamp + 76, // 57: global.Catalog.startTime:type_name -> google.protobuf.Timestamp + 76, // 58: global.Catalog.endTime:type_name -> google.protobuf.Timestamp 61, // 59: global.ResponseCatalog.data:type_name -> global.Catalog 57, // 60: global.ResponseDelete.data:type_name -> global.RecordFile - 2, // 61: global.Formily.PropertiesEntry.value:type_name -> global.Formily - 75, // 62: global.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any - 2, // 63: global.FormilyResponse.PropertiesEntry.value:type_name -> global.Formily - 76, // 64: global.api.SysInfo:input_type -> google.protobuf.Empty - 76, // 65: global.api.DisabledPlugins:input_type -> google.protobuf.Empty - 76, // 66: global.api.Summary:input_type -> google.protobuf.Empty - 33, // 67: global.api.Shutdown:input_type -> global.RequestWithId - 33, // 68: global.api.Restart:input_type -> global.RequestWithId - 76, // 69: global.api.TaskTree:input_type -> google.protobuf.Empty - 34, // 70: global.api.StopTask:input_type -> global.RequestWithId64 - 34, // 71: global.api.RestartTask:input_type -> global.RequestWithId64 - 17, // 72: global.api.StreamList:input_type -> global.StreamListRequest - 76, // 73: global.api.WaitList:input_type -> google.protobuf.Empty - 20, // 74: global.api.StreamInfo:input_type -> global.StreamSnapRequest - 20, // 75: global.api.PauseStream:input_type -> global.StreamSnapRequest - 20, // 76: global.api.ResumeStream:input_type -> global.StreamSnapRequest - 47, // 77: global.api.SetStreamSpeed:input_type -> global.SetStreamSpeedRequest - 48, // 78: global.api.SeekStream:input_type -> global.SeekStreamRequest - 36, // 79: global.api.GetSubscribers:input_type -> global.SubscribersRequest - 20, // 80: global.api.AudioTrackSnap:input_type -> global.StreamSnapRequest - 20, // 81: global.api.VideoTrackSnap:input_type -> global.StreamSnapRequest - 35, // 82: global.api.ChangeSubscribe:input_type -> global.ChangeSubscribeRequest - 76, // 83: global.api.GetStreamAlias:input_type -> google.protobuf.Empty - 44, // 84: global.api.SetStreamAlias:input_type -> global.SetStreamAliasRequest - 20, // 85: global.api.StopPublish:input_type -> global.StreamSnapRequest - 33, // 86: global.api.StopSubscribe:input_type -> global.RequestWithId - 76, // 87: global.api.GetConfigFile:input_type -> google.protobuf.Empty - 7, // 88: global.api.UpdateConfigFile:input_type -> global.UpdateConfigFileRequest - 1, // 89: global.api.GetConfig:input_type -> global.GetConfigRequest - 1, // 90: global.api.GetFormily:input_type -> global.GetConfigRequest - 76, // 91: global.api.GetPullProxyList:input_type -> google.protobuf.Empty - 41, // 92: global.api.AddPullProxy:input_type -> global.PullProxyInfo - 33, // 93: global.api.RemovePullProxy:input_type -> global.RequestWithId - 41, // 94: global.api.UpdatePullProxy:input_type -> global.PullProxyInfo - 76, // 95: global.api.GetPushProxyList:input_type -> google.protobuf.Empty - 42, // 96: global.api.AddPushProxy:input_type -> global.PushProxyInfo - 33, // 97: global.api.RemovePushProxy:input_type -> global.RequestWithId - 42, // 98: global.api.UpdatePushProxy:input_type -> global.PushProxyInfo - 76, // 99: global.api.GetRecording:input_type -> google.protobuf.Empty - 76, // 100: global.api.GetTransformList:input_type -> google.protobuf.Empty - 56, // 101: global.api.GetRecordList:input_type -> global.ReqRecordList - 56, // 102: global.api.GetEventRecordList:input_type -> global.ReqRecordList - 65, // 103: global.api.GetRecordCatalog:input_type -> global.ReqRecordCatalog - 63, // 104: global.api.DeleteRecord:input_type -> global.ReqRecordDelete - 14, // 105: global.api.SysInfo:output_type -> global.SysInfoResponse - 0, // 106: global.api.DisabledPlugins:output_type -> global.DisabledPluginsResponse - 11, // 107: global.api.Summary:output_type -> global.SummaryResponse - 32, // 108: global.api.Shutdown:output_type -> global.SuccessResponse - 32, // 109: global.api.Restart:output_type -> global.SuccessResponse - 16, // 110: global.api.TaskTree:output_type -> global.TaskTreeResponse - 32, // 111: global.api.StopTask:output_type -> global.SuccessResponse - 32, // 112: global.api.RestartTask:output_type -> global.SuccessResponse - 18, // 113: global.api.StreamList:output_type -> global.StreamListResponse - 19, // 114: global.api.WaitList:output_type -> global.StreamWaitListResponse - 21, // 115: global.api.StreamInfo:output_type -> global.StreamInfoResponse - 32, // 116: global.api.PauseStream:output_type -> global.SuccessResponse - 32, // 117: global.api.ResumeStream:output_type -> global.SuccessResponse - 32, // 118: global.api.SetStreamSpeed:output_type -> global.SuccessResponse - 32, // 119: global.api.SeekStream:output_type -> global.SuccessResponse - 39, // 120: global.api.GetSubscribers:output_type -> global.SubscribersResponse - 30, // 121: global.api.AudioTrackSnap:output_type -> global.TrackSnapShotResponse - 30, // 122: global.api.VideoTrackSnap:output_type -> global.TrackSnapShotResponse - 32, // 123: global.api.ChangeSubscribe:output_type -> global.SuccessResponse - 46, // 124: global.api.GetStreamAlias:output_type -> global.StreamAliasListResponse - 32, // 125: global.api.SetStreamAlias:output_type -> global.SuccessResponse - 32, // 126: global.api.StopPublish:output_type -> global.SuccessResponse - 32, // 127: global.api.StopSubscribe:output_type -> global.SuccessResponse - 5, // 128: global.api.GetConfigFile:output_type -> global.GetConfigFileResponse - 32, // 129: global.api.UpdateConfigFile:output_type -> global.SuccessResponse - 6, // 130: global.api.GetConfig:output_type -> global.GetConfigResponse - 6, // 131: global.api.GetFormily:output_type -> global.GetConfigResponse - 40, // 132: global.api.GetPullProxyList:output_type -> global.PullProxyListResponse - 32, // 133: global.api.AddPullProxy:output_type -> global.SuccessResponse - 32, // 134: global.api.RemovePullProxy:output_type -> global.SuccessResponse - 32, // 135: global.api.UpdatePullProxy:output_type -> global.SuccessResponse - 43, // 136: global.api.GetPushProxyList:output_type -> global.PushProxyListResponse - 32, // 137: global.api.AddPushProxy:output_type -> global.SuccessResponse - 32, // 138: global.api.RemovePushProxy:output_type -> global.SuccessResponse - 32, // 139: global.api.UpdatePushProxy:output_type -> global.SuccessResponse - 50, // 140: global.api.GetRecording:output_type -> global.RecordingListResponse - 55, // 141: global.api.GetTransformList:output_type -> global.TransformListResponse - 59, // 142: global.api.GetRecordList:output_type -> global.RecordResponseList - 60, // 143: global.api.GetEventRecordList:output_type -> global.EventRecordResponseList - 62, // 144: global.api.GetRecordCatalog:output_type -> global.ResponseCatalog - 64, // 145: global.api.DeleteRecord:output_type -> global.ResponseDelete - 105, // [105:146] is the sub-list for method output_type - 64, // [64:105] is the sub-list for method input_type - 64, // [64:64] is the sub-list for extension type_name - 64, // [64:64] is the sub-list for extension extendee - 0, // [0:64] is the sub-list for field type_name + 76, // 61: global.AlarmInfo.createdAt:type_name -> google.protobuf.Timestamp + 76, // 62: global.AlarmInfo.updatedAt:type_name -> google.protobuf.Timestamp + 66, // 63: global.AlarmListResponse.data:type_name -> global.AlarmInfo + 2, // 64: global.Formily.PropertiesEntry.value:type_name -> global.Formily + 78, // 65: global.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any + 2, // 66: global.FormilyResponse.PropertiesEntry.value:type_name -> global.Formily + 79, // 67: global.api.SysInfo:input_type -> google.protobuf.Empty + 79, // 68: global.api.DisabledPlugins:input_type -> google.protobuf.Empty + 79, // 69: global.api.Summary:input_type -> google.protobuf.Empty + 33, // 70: global.api.Shutdown:input_type -> global.RequestWithId + 33, // 71: global.api.Restart:input_type -> global.RequestWithId + 79, // 72: global.api.TaskTree:input_type -> google.protobuf.Empty + 34, // 73: global.api.StopTask:input_type -> global.RequestWithId64 + 34, // 74: global.api.RestartTask:input_type -> global.RequestWithId64 + 17, // 75: global.api.StreamList:input_type -> global.StreamListRequest + 79, // 76: global.api.WaitList:input_type -> google.protobuf.Empty + 20, // 77: global.api.StreamInfo:input_type -> global.StreamSnapRequest + 20, // 78: global.api.PauseStream:input_type -> global.StreamSnapRequest + 20, // 79: global.api.ResumeStream:input_type -> global.StreamSnapRequest + 47, // 80: global.api.SetStreamSpeed:input_type -> global.SetStreamSpeedRequest + 48, // 81: global.api.SeekStream:input_type -> global.SeekStreamRequest + 36, // 82: global.api.GetSubscribers:input_type -> global.SubscribersRequest + 20, // 83: global.api.AudioTrackSnap:input_type -> global.StreamSnapRequest + 20, // 84: global.api.VideoTrackSnap:input_type -> global.StreamSnapRequest + 35, // 85: global.api.ChangeSubscribe:input_type -> global.ChangeSubscribeRequest + 79, // 86: global.api.GetStreamAlias:input_type -> google.protobuf.Empty + 44, // 87: global.api.SetStreamAlias:input_type -> global.SetStreamAliasRequest + 20, // 88: global.api.StopPublish:input_type -> global.StreamSnapRequest + 33, // 89: global.api.StopSubscribe:input_type -> global.RequestWithId + 79, // 90: global.api.GetConfigFile:input_type -> google.protobuf.Empty + 7, // 91: global.api.UpdateConfigFile:input_type -> global.UpdateConfigFileRequest + 1, // 92: global.api.GetConfig:input_type -> global.GetConfigRequest + 1, // 93: global.api.GetFormily:input_type -> global.GetConfigRequest + 79, // 94: global.api.GetPullProxyList:input_type -> google.protobuf.Empty + 41, // 95: global.api.AddPullProxy:input_type -> global.PullProxyInfo + 33, // 96: global.api.RemovePullProxy:input_type -> global.RequestWithId + 41, // 97: global.api.UpdatePullProxy:input_type -> global.PullProxyInfo + 79, // 98: global.api.GetPushProxyList:input_type -> google.protobuf.Empty + 42, // 99: global.api.AddPushProxy:input_type -> global.PushProxyInfo + 33, // 100: global.api.RemovePushProxy:input_type -> global.RequestWithId + 42, // 101: global.api.UpdatePushProxy:input_type -> global.PushProxyInfo + 79, // 102: global.api.GetRecording:input_type -> google.protobuf.Empty + 79, // 103: global.api.GetTransformList:input_type -> google.protobuf.Empty + 56, // 104: global.api.GetRecordList:input_type -> global.ReqRecordList + 56, // 105: global.api.GetEventRecordList:input_type -> global.ReqRecordList + 65, // 106: global.api.GetRecordCatalog:input_type -> global.ReqRecordCatalog + 63, // 107: global.api.DeleteRecord:input_type -> global.ReqRecordDelete + 67, // 108: global.api.GetAlarmList:input_type -> global.AlarmListRequest + 14, // 109: global.api.SysInfo:output_type -> global.SysInfoResponse + 0, // 110: global.api.DisabledPlugins:output_type -> global.DisabledPluginsResponse + 11, // 111: global.api.Summary:output_type -> global.SummaryResponse + 32, // 112: global.api.Shutdown:output_type -> global.SuccessResponse + 32, // 113: global.api.Restart:output_type -> global.SuccessResponse + 16, // 114: global.api.TaskTree:output_type -> global.TaskTreeResponse + 32, // 115: global.api.StopTask:output_type -> global.SuccessResponse + 32, // 116: global.api.RestartTask:output_type -> global.SuccessResponse + 18, // 117: global.api.StreamList:output_type -> global.StreamListResponse + 19, // 118: global.api.WaitList:output_type -> global.StreamWaitListResponse + 21, // 119: global.api.StreamInfo:output_type -> global.StreamInfoResponse + 32, // 120: global.api.PauseStream:output_type -> global.SuccessResponse + 32, // 121: global.api.ResumeStream:output_type -> global.SuccessResponse + 32, // 122: global.api.SetStreamSpeed:output_type -> global.SuccessResponse + 32, // 123: global.api.SeekStream:output_type -> global.SuccessResponse + 39, // 124: global.api.GetSubscribers:output_type -> global.SubscribersResponse + 30, // 125: global.api.AudioTrackSnap:output_type -> global.TrackSnapShotResponse + 30, // 126: global.api.VideoTrackSnap:output_type -> global.TrackSnapShotResponse + 32, // 127: global.api.ChangeSubscribe:output_type -> global.SuccessResponse + 46, // 128: global.api.GetStreamAlias:output_type -> global.StreamAliasListResponse + 32, // 129: global.api.SetStreamAlias:output_type -> global.SuccessResponse + 32, // 130: global.api.StopPublish:output_type -> global.SuccessResponse + 32, // 131: global.api.StopSubscribe:output_type -> global.SuccessResponse + 5, // 132: global.api.GetConfigFile:output_type -> global.GetConfigFileResponse + 32, // 133: global.api.UpdateConfigFile:output_type -> global.SuccessResponse + 6, // 134: global.api.GetConfig:output_type -> global.GetConfigResponse + 6, // 135: global.api.GetFormily:output_type -> global.GetConfigResponse + 40, // 136: global.api.GetPullProxyList:output_type -> global.PullProxyListResponse + 32, // 137: global.api.AddPullProxy:output_type -> global.SuccessResponse + 32, // 138: global.api.RemovePullProxy:output_type -> global.SuccessResponse + 32, // 139: global.api.UpdatePullProxy:output_type -> global.SuccessResponse + 43, // 140: global.api.GetPushProxyList:output_type -> global.PushProxyListResponse + 32, // 141: global.api.AddPushProxy:output_type -> global.SuccessResponse + 32, // 142: global.api.RemovePushProxy:output_type -> global.SuccessResponse + 32, // 143: global.api.UpdatePushProxy:output_type -> global.SuccessResponse + 50, // 144: global.api.GetRecording:output_type -> global.RecordingListResponse + 55, // 145: global.api.GetTransformList:output_type -> global.TransformListResponse + 59, // 146: global.api.GetRecordList:output_type -> global.RecordResponseList + 60, // 147: global.api.GetEventRecordList:output_type -> global.EventRecordResponseList + 62, // 148: global.api.GetRecordCatalog:output_type -> global.ResponseCatalog + 64, // 149: global.api.DeleteRecord:output_type -> global.ResponseDelete + 68, // 150: global.api.GetAlarmList:output_type -> global.AlarmListResponse + 109, // [109:151] is the sub-list for method output_type + 67, // [67:109] is the sub-list for method input_type + 67, // [67:67] is the sub-list for extension type_name + 67, // [67:67] is the sub-list for extension extendee + 0, // [0:67] is the sub-list for field type_name } func init() { file_global_proto_init() } @@ -5556,7 +5903,7 @@ func file_global_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_global_proto_rawDesc), len(file_global_proto_rawDesc)), NumEnums: 0, - NumMessages: 73, + NumMessages: 76, NumExtensions: 0, NumServices: 1, }, diff --git a/pb/global.pb.gw.go b/pb/global.pb.gw.go index 9b08874..cdd0e48 100644 --- a/pb/global.pb.gw.go +++ b/pb/global.pb.gw.go @@ -10,6 +10,7 @@ package pb import ( "context" + "errors" "io" "net/http" @@ -25,1926 +26,1556 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_Api_SysInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.SysInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_SysInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.SysInfo(ctx, &protoReq) return msg, metadata, err - } func request_Api_DisabledPlugins_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.DisabledPlugins(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_DisabledPlugins_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.DisabledPlugins(ctx, &protoReq) return msg, metadata, err - } func request_Api_Summary_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.Summary(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_Summary_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.Summary(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_Api_Shutdown_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_Api_Shutdown_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_Api_Shutdown_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 - + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_Shutdown_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Shutdown(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_Shutdown_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId - var metadata runtime.ServerMetadata - + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_Shutdown_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Shutdown(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_Api_Restart_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_Api_Restart_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_Api_Restart_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 - + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_Restart_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Restart(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_Restart_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId - var metadata runtime.ServerMetadata - + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_Restart_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Restart(ctx, &protoReq) return msg, metadata, err - } func request_Api_TaskTree_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.TaskTree(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_TaskTree_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.TaskTree(ctx, &protoReq) return msg, metadata, err - } func request_Api_StopTask_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId64 - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq RequestWithId64 + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["id"] + io.Copy(io.Discard, req.Body) + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.StopTask(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_StopTask_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId64 - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq RequestWithId64 + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.StopTask(ctx, &protoReq) return msg, metadata, err - } func request_Api_RestartTask_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId64 - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq RequestWithId64 + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["id"] + io.Copy(io.Discard, req.Body) + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.RestartTask(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_RestartTask_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId64 - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq RequestWithId64 + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.RestartTask(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_Api_StreamList_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) +var filter_Api_StreamList_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} func request_Api_StreamList_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamListRequest - var metadata runtime.ServerMetadata - + var ( + protoReq StreamListRequest + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_StreamList_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.StreamList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_StreamList_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamListRequest - var metadata runtime.ServerMetadata - + var ( + protoReq StreamListRequest + metadata runtime.ServerMetadata + ) if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_StreamList_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.StreamList(ctx, &protoReq) return msg, metadata, err - } func request_Api_WaitList_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.WaitList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_WaitList_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.WaitList(ctx, &protoReq) return msg, metadata, err - } func request_Api_StreamInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["streamPath"] + io.Copy(io.Discard, req.Body) + 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.StreamInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_StreamInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["streamPath"] + 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.StreamInfo(ctx, &protoReq) return msg, metadata, err - } func request_Api_PauseStream_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.PauseStream(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_PauseStream_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.PauseStream(ctx, &protoReq) return msg, metadata, err - } func request_Api_ResumeStream_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.ResumeStream(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_ResumeStream_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.ResumeStream(ctx, &protoReq) return msg, metadata, err - } func request_Api_SetStreamSpeed_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SetStreamSpeedRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq SetStreamSpeedRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.SetStreamSpeed(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_SetStreamSpeed_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SetStreamSpeedRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq SetStreamSpeedRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.SetStreamSpeed(ctx, &protoReq) return msg, metadata, err - } func request_Api_SeekStream_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SeekStreamRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq SeekStreamRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.SeekStream(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_SeekStream_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SeekStreamRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq SeekStreamRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.SeekStream(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_Api_GetSubscribers_0 = &utilities.DoubleArray{Encoding: map[string]int{"streamPath": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) +var filter_Api_GetSubscribers_0 = &utilities.DoubleArray{Encoding: map[string]int{"streamPath": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} func request_Api_GetSubscribers_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SubscribersRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq SubscribersRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["streamPath"] + io.Copy(io.Discard, req.Body) + 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) } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_GetSubscribers_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetSubscribers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetSubscribers_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SubscribersRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq SubscribersRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["streamPath"] + 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) } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_GetSubscribers_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetSubscribers(ctx, &protoReq) return msg, metadata, err - } func request_Api_AudioTrackSnap_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["streamPath"] + io.Copy(io.Discard, req.Body) + 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.AudioTrackSnap(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_AudioTrackSnap_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["streamPath"] + 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.AudioTrackSnap(ctx, &protoReq) return msg, metadata, err - } func request_Api_VideoTrackSnap_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["streamPath"] + io.Copy(io.Discard, req.Body) + 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.VideoTrackSnap(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_VideoTrackSnap_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["streamPath"] + 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.VideoTrackSnap(ctx, &protoReq) return msg, metadata, err - } func request_Api_ChangeSubscribe_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangeSubscribeRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ChangeSubscribeRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", 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.ChangeSubscribe(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_ChangeSubscribe_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ChangeSubscribeRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ChangeSubscribeRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", 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.ChangeSubscribe(ctx, &protoReq) return msg, metadata, err - } func request_Api_GetStreamAlias_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.GetStreamAlias(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetStreamAlias_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.GetStreamAlias(ctx, &protoReq) return msg, metadata, err - } 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 { + var ( + protoReq SetStreamAliasRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", 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 { + var ( + protoReq SetStreamAliasRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.SetStreamAlias(ctx, &protoReq) return msg, metadata, err - } func request_Api_StopPublish_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.StopPublish(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_StopPublish_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StreamSnapRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq StreamSnapRequest + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["streamPath"] + 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.StopPublish(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 - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.StopSubscribe(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_StopSubscribe_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.StopSubscribe(ctx, &protoReq) return msg, metadata, err - } func request_Api_GetConfigFile_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.GetConfigFile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetConfigFile_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.GetConfigFile(ctx, &protoReq) return msg, metadata, err - } func request_Api_UpdateConfigFile_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateConfigFileRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Content); err != nil && err != io.EOF { + var ( + protoReq UpdateConfigFileRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Content); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.UpdateConfigFile(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_UpdateConfigFile_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateConfigFileRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Content); err != nil && err != io.EOF { + var ( + protoReq UpdateConfigFileRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Content); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.UpdateConfigFile(ctx, &protoReq) return msg, metadata, err - } func request_Api_GetConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, 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 + protoReq GetConfigRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["name"] + io.Copy(io.Discard, req.Body) + 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_Api_GetConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, 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 + protoReq GetConfigRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["name"] + 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_Api_GetFormily_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, 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 + protoReq GetConfigRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["name"] + io.Copy(io.Discard, req.Body) + 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_Api_GetFormily_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, 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 + protoReq GetConfigRequest + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["name"] + 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_Api_GetPullProxyList_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.GetPullProxyList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetPullProxyList_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.GetPullProxyList(ctx, &protoReq) return msg, metadata, err - } func request_Api_GetPullProxyList_1(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.GetPullProxyList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetPullProxyList_1(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.GetPullProxyList(ctx, &protoReq) return msg, metadata, err - } func request_Api_AddPullProxy_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PullProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PullProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.AddPullProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_AddPullProxy_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PullProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PullProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.AddPullProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_AddPullProxy_1(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PullProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PullProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.AddPullProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_AddPullProxy_1(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PullProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PullProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.AddPullProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_RemovePullProxy_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 - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.RemovePullProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_RemovePullProxy_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.RemovePullProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_RemovePullProxy_1(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 - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.RemovePullProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_RemovePullProxy_1(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.RemovePullProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_UpdatePullProxy_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PullProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PullProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.UpdatePullProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_UpdatePullProxy_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PullProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PullProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.UpdatePullProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_UpdatePullProxy_1(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PullProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PullProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.UpdatePullProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_UpdatePullProxy_1(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PullProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PullProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.UpdatePullProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_GetPushProxyList_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.GetPushProxyList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetPushProxyList_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.GetPushProxyList(ctx, &protoReq) return msg, metadata, err - } func request_Api_AddPushProxy_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PushProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PushProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.AddPushProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_AddPushProxy_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PushProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PushProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.AddPushProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_RemovePushProxy_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 - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := client.RemovePushProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_RemovePushProxy_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RequestWithId - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RequestWithId + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] + val, ok := pathParams["id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") } - protoReq.Id, err = runtime.Uint32(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - msg, err := server.RemovePushProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_UpdatePushProxy_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PushProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PushProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.UpdatePushProxy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_UpdatePushProxy_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PushProxyInfo - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq PushProxyInfo + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.UpdatePushProxy(ctx, &protoReq) return msg, metadata, err - } func request_Api_GetRecording_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.GetRecording(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetRecording_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.GetRecording(ctx, &protoReq) return msg, metadata, err - } func request_Api_GetTransformList_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) msg, err := client.GetTransformList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetTransformList_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) msg, err := server.GetTransformList(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_Api_GetRecordList_0 = &utilities.DoubleArray{Encoding: map[string]int{"type": 0, "streamPath": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) +var filter_Api_GetRecordList_0 = &utilities.DoubleArray{Encoding: map[string]int{"type": 0, "streamPath": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} func request_Api_GetRecordList_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReqRecordList - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ReqRecordList + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["type"] + io.Copy(io.Discard, req.Body) + val, ok := pathParams["type"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "type") } - protoReq.Type, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "type", 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) } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_GetRecordList_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetRecordList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetRecordList_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReqRecordList - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ReqRecordList + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["type"] + val, ok := pathParams["type"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "type") } - protoReq.Type, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "type", 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) } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_GetRecordList_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetRecordList(ctx, &protoReq) return msg, metadata, err - } -var ( - filter_Api_GetEventRecordList_0 = &utilities.DoubleArray{Encoding: map[string]int{"type": 0, "streamPath": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) +var filter_Api_GetEventRecordList_0 = &utilities.DoubleArray{Encoding: map[string]int{"type": 0, "streamPath": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} func request_Api_GetEventRecordList_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReqRecordList - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ReqRecordList + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["type"] + io.Copy(io.Discard, req.Body) + val, ok := pathParams["type"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "type") } - protoReq.Type, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "type", 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) } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_GetEventRecordList_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetEventRecordList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetEventRecordList_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReqRecordList - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ReqRecordList + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["type"] + val, ok := pathParams["type"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "type") } - protoReq.Type, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "type", 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) } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_GetEventRecordList_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetEventRecordList(ctx, &protoReq) return msg, metadata, err - } func request_Api_GetRecordCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReqRecordCatalog - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ReqRecordCatalog + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["type"] + io.Copy(io.Discard, req.Body) + val, ok := pathParams["type"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "type") } - protoReq.Type, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "type", err) } - msg, err := client.GetRecordCatalog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_GetRecordCatalog_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReqRecordCatalog - var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err + protoReq ReqRecordCatalog + metadata runtime.ServerMetadata + err error ) - - val, ok = pathParams["type"] + val, ok := pathParams["type"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "type") } - protoReq.Type, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "type", err) } - msg, err := server.GetRecordCatalog(ctx, &protoReq) return msg, metadata, err - } func request_Api_DeleteRecord_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReqRecordDelete - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ReqRecordDelete + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["type"] + val, ok := pathParams["type"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "type") } - protoReq.Type, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "type", 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.DeleteRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_Api_DeleteRecord_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ReqRecordDelete - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ReqRecordDelete + metadata runtime.ServerMetadata + err error + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["type"] + val, ok := pathParams["type"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "type") } - protoReq.Type, err = runtime.String(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "type", 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.DeleteRecord(ctx, &protoReq) return msg, metadata, err +} +var filter_Api_GetAlarmList_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + +func request_Api_GetAlarmList_0(ctx context.Context, marshaler runtime.Marshaler, client ApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq AlarmListRequest + metadata runtime.ServerMetadata + ) + io.Copy(io.Discard, req.Body) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_GetAlarmList_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.GetAlarmList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Api_GetAlarmList_0(ctx context.Context, marshaler runtime.Marshaler, server ApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var ( + protoReq AlarmListRequest + metadata runtime.ServerMetadata + ) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Api_GetAlarmList_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.GetAlarmList(ctx, &protoReq) + return msg, metadata, err } // RegisterApiHandlerServer registers the http handlers for service Api to "mux". // UnaryRPC :call ApiServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterApiHandlerFromEndpoint instead. +// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ApiServer) error { - - mux.Handle("GET", pattern_Api_SysInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_SysInfo_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/SysInfo", runtime.WithHTTPPathPattern("/api/sysinfo")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/SysInfo", runtime.WithHTTPPathPattern("/api/sysinfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1956,20 +1587,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_SysInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_DisabledPlugins_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_DisabledPlugins_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/DisabledPlugins", runtime.WithHTTPPathPattern("/api/plugins/disabled")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/DisabledPlugins", runtime.WithHTTPPathPattern("/api/plugins/disabled")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1981,20 +1607,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_DisabledPlugins_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_Summary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_Summary_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/Summary", runtime.WithHTTPPathPattern("/api/summary")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/Summary", runtime.WithHTTPPathPattern("/api/summary")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2006,20 +1627,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_Summary_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_Shutdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_Shutdown_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/Shutdown", runtime.WithHTTPPathPattern("/api/shutdown")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/Shutdown", runtime.WithHTTPPathPattern("/api/shutdown")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2031,20 +1647,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_Shutdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_Restart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_Restart_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/Restart", runtime.WithHTTPPathPattern("/api/restart")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/Restart", runtime.WithHTTPPathPattern("/api/restart")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2056,20 +1667,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_Restart_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_TaskTree_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_TaskTree_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/TaskTree", runtime.WithHTTPPathPattern("/api/task/tree")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/TaskTree", runtime.WithHTTPPathPattern("/api/task/tree")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2081,20 +1687,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_TaskTree_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_StopTask_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_StopTask_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/StopTask", runtime.WithHTTPPathPattern("/api/task/stop/{id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/StopTask", runtime.WithHTTPPathPattern("/api/task/stop/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2106,20 +1707,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StopTask_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_RestartTask_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_RestartTask_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/RestartTask", runtime.WithHTTPPathPattern("/api/task/restart/{id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/RestartTask", runtime.WithHTTPPathPattern("/api/task/restart/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2131,20 +1727,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_RestartTask_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_StreamList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_StreamList_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/StreamList", runtime.WithHTTPPathPattern("/api/stream/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/StreamList", runtime.WithHTTPPathPattern("/api/stream/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2156,20 +1747,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StreamList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_WaitList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_WaitList_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/WaitList", runtime.WithHTTPPathPattern("/api/stream/waitlist")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/WaitList", runtime.WithHTTPPathPattern("/api/stream/waitlist")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2181,20 +1767,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_WaitList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_StreamInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_StreamInfo_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/StreamInfo", runtime.WithHTTPPathPattern("/api/stream/info/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/StreamInfo", runtime.WithHTTPPathPattern("/api/stream/info/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2206,20 +1787,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StreamInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_PauseStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_PauseStream_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/PauseStream", runtime.WithHTTPPathPattern("/api/stream/pause/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/PauseStream", runtime.WithHTTPPathPattern("/api/stream/pause/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2231,20 +1807,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_PauseStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_ResumeStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_ResumeStream_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/ResumeStream", runtime.WithHTTPPathPattern("/api/stream/resume/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/ResumeStream", runtime.WithHTTPPathPattern("/api/stream/resume/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2256,20 +1827,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_ResumeStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_SetStreamSpeed_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_SetStreamSpeed_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/SetStreamSpeed", runtime.WithHTTPPathPattern("/api/stream/speed/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/SetStreamSpeed", runtime.WithHTTPPathPattern("/api/stream/speed/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2281,20 +1847,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_SetStreamSpeed_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_SeekStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_SeekStream_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/SeekStream", runtime.WithHTTPPathPattern("/api/stream/seek/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/SeekStream", runtime.WithHTTPPathPattern("/api/stream/seek/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2306,20 +1867,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_SeekStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetSubscribers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetSubscribers_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/GetSubscribers", runtime.WithHTTPPathPattern("/api/subscribers/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetSubscribers", runtime.WithHTTPPathPattern("/api/subscribers/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2331,20 +1887,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetSubscribers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_AudioTrackSnap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_AudioTrackSnap_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/AudioTrackSnap", runtime.WithHTTPPathPattern("/api/audiotrack/snap/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/AudioTrackSnap", runtime.WithHTTPPathPattern("/api/audiotrack/snap/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2356,20 +1907,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_AudioTrackSnap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_VideoTrackSnap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_VideoTrackSnap_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/VideoTrackSnap", runtime.WithHTTPPathPattern("/api/videotrack/snap/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/VideoTrackSnap", runtime.WithHTTPPathPattern("/api/videotrack/snap/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2381,20 +1927,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_VideoTrackSnap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_ChangeSubscribe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_ChangeSubscribe_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/ChangeSubscribe", runtime.WithHTTPPathPattern("/api/subscribe/change/{id}/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/ChangeSubscribe", runtime.WithHTTPPathPattern("/api/subscribe/change/{id}/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2406,20 +1947,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_ChangeSubscribe_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetStreamAlias_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetStreamAlias_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/GetStreamAlias", runtime.WithHTTPPathPattern("/api/stream/alias/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetStreamAlias", runtime.WithHTTPPathPattern("/api/stream/alias/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2431,20 +1967,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetStreamAlias_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_SetStreamAlias_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, 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")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/SetStreamAlias", runtime.WithHTTPPathPattern("/api/stream/alias")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2456,20 +1987,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server 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_StopPublish_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_StopPublish_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/StopPublish", runtime.WithHTTPPathPattern("/api/stream/stop/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/StopPublish", runtime.WithHTTPPathPattern("/api/stream/stop/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2481,20 +2007,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StopPublish_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) { + mux.Handle(http.MethodPost, pattern_Api_StopSubscribe_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/StopSubscribe", runtime.WithHTTPPathPattern("/api/subscribe/stop/{id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/StopSubscribe", runtime.WithHTTPPathPattern("/api/subscribe/stop/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2506,20 +2027,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StopSubscribe_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetConfigFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetConfigFile_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/GetConfigFile", runtime.WithHTTPPathPattern("/api/config/file")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetConfigFile", runtime.WithHTTPPathPattern("/api/config/file")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2531,20 +2047,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetConfigFile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_UpdateConfigFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_UpdateConfigFile_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/UpdateConfigFile", runtime.WithHTTPPathPattern("/api/config/file/update")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/UpdateConfigFile", runtime.WithHTTPPathPattern("/api/config/file/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2556,20 +2067,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_UpdateConfigFile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_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, "/global.Api/GetConfig", runtime.WithHTTPPathPattern("/api/config/get/{name}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetConfig", runtime.WithHTTPPathPattern("/api/config/get/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2581,20 +2087,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetFormily_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_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, "/global.Api/GetFormily", runtime.WithHTTPPathPattern("/api/config/formily/{name}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetFormily", runtime.WithHTTPPathPattern("/api/config/formily/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2606,20 +2107,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetFormily_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetPullProxyList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetPullProxyList_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/GetPullProxyList", runtime.WithHTTPPathPattern("/api/proxy/pull/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetPullProxyList", runtime.WithHTTPPathPattern("/api/proxy/pull/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2631,20 +2127,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetPullProxyList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetPullProxyList_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetPullProxyList_1, 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/GetPullProxyList", runtime.WithHTTPPathPattern("/api/device/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetPullProxyList", runtime.WithHTTPPathPattern("/api/device/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2656,20 +2147,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetPullProxyList_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_AddPullProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_AddPullProxy_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/AddPullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/add")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/AddPullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2681,20 +2167,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_AddPullProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_AddPullProxy_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_AddPullProxy_1, 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/AddPullProxy", runtime.WithHTTPPathPattern("/api/device/add")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/AddPullProxy", runtime.WithHTTPPathPattern("/api/device/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2706,20 +2187,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_AddPullProxy_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_RemovePullProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_RemovePullProxy_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/RemovePullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/remove/{id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/RemovePullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/remove/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2731,20 +2207,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_RemovePullProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_RemovePullProxy_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_RemovePullProxy_1, 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/RemovePullProxy", runtime.WithHTTPPathPattern("/api/device/remove/{id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/RemovePullProxy", runtime.WithHTTPPathPattern("/api/device/remove/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2756,20 +2227,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_RemovePullProxy_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_UpdatePullProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_UpdatePullProxy_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/UpdatePullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/update")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/UpdatePullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2781,20 +2247,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_UpdatePullProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_UpdatePullProxy_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_UpdatePullProxy_1, 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/UpdatePullProxy", runtime.WithHTTPPathPattern("/api/device/update")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/UpdatePullProxy", runtime.WithHTTPPathPattern("/api/device/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2806,20 +2267,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_UpdatePullProxy_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetPushProxyList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetPushProxyList_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/GetPushProxyList", runtime.WithHTTPPathPattern("/api/proxy/push/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetPushProxyList", runtime.WithHTTPPathPattern("/api/proxy/push/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2831,20 +2287,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetPushProxyList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_AddPushProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_AddPushProxy_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/AddPushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/add")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/AddPushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2856,20 +2307,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_AddPushProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_RemovePushProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_RemovePushProxy_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/RemovePushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/remove/{id}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/RemovePushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/remove/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2881,20 +2327,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_RemovePushProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_UpdatePushProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_UpdatePushProxy_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/UpdatePushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/update")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/UpdatePushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2906,20 +2347,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_UpdatePushProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetRecording_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetRecording_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/GetRecording", runtime.WithHTTPPathPattern("/api/record/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetRecording", runtime.WithHTTPPathPattern("/api/record/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2931,20 +2367,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetRecording_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetTransformList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetTransformList_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/GetTransformList", runtime.WithHTTPPathPattern("/api/transform/list")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetTransformList", runtime.WithHTTPPathPattern("/api/transform/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2956,20 +2387,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetTransformList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetRecordList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetRecordList_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/GetRecordList", runtime.WithHTTPPathPattern("/api/record/{type}/list/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetRecordList", runtime.WithHTTPPathPattern("/api/record/{type}/list/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2981,20 +2407,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetRecordList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetEventRecordList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetEventRecordList_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/GetEventRecordList", runtime.WithHTTPPathPattern("/api/record/{type}/event/list/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetEventRecordList", runtime.WithHTTPPathPattern("/api/record/{type}/event/list/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3006,20 +2427,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetEventRecordList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetRecordCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetRecordCatalog_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/GetRecordCatalog", runtime.WithHTTPPathPattern("/api/record/{type}/catalog")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetRecordCatalog", runtime.WithHTTPPathPattern("/api/record/{type}/catalog")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3031,20 +2447,15 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetRecordCatalog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_DeleteRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_DeleteRecord_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/DeleteRecord", runtime.WithHTTPPathPattern("/api/record/{type}/delete/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/DeleteRecord", runtime.WithHTTPPathPattern("/api/record/{type}/delete/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3056,9 +2467,27 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_DeleteRecord_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - + }) + mux.Handle(http.MethodGet, pattern_Api_GetAlarmList_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) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/global.Api/GetAlarmList", runtime.WithHTTPPathPattern("/api/alarm/list")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Api_GetAlarmList_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_GetAlarmList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) return nil @@ -3067,25 +2496,24 @@ func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server // RegisterApiHandlerFromEndpoint is same as RegisterApiHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() - return RegisterApiHandler(ctx, mux, conn) } @@ -3099,16 +2527,13 @@ func RegisterApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.C // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ApiClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ApiClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ApiClient" to call the correct interceptors. +// "ApiClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ApiClient) error { - - mux.Handle("GET", pattern_Api_SysInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_SysInfo_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/SysInfo", runtime.WithHTTPPathPattern("/api/sysinfo")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/SysInfo", runtime.WithHTTPPathPattern("/api/sysinfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3119,18 +2544,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_SysInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_DisabledPlugins_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_DisabledPlugins_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/DisabledPlugins", runtime.WithHTTPPathPattern("/api/plugins/disabled")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/DisabledPlugins", runtime.WithHTTPPathPattern("/api/plugins/disabled")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3141,18 +2561,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_DisabledPlugins_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_Summary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_Summary_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/Summary", runtime.WithHTTPPathPattern("/api/summary")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/Summary", runtime.WithHTTPPathPattern("/api/summary")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3163,18 +2578,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_Summary_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_Shutdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_Shutdown_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/Shutdown", runtime.WithHTTPPathPattern("/api/shutdown")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/Shutdown", runtime.WithHTTPPathPattern("/api/shutdown")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3185,18 +2595,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_Shutdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_Restart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_Restart_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/Restart", runtime.WithHTTPPathPattern("/api/restart")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/Restart", runtime.WithHTTPPathPattern("/api/restart")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3207,18 +2612,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_Restart_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_TaskTree_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_TaskTree_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/TaskTree", runtime.WithHTTPPathPattern("/api/task/tree")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/TaskTree", runtime.WithHTTPPathPattern("/api/task/tree")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3229,18 +2629,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_TaskTree_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_StopTask_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_StopTask_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/StopTask", runtime.WithHTTPPathPattern("/api/task/stop/{id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/StopTask", runtime.WithHTTPPathPattern("/api/task/stop/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3251,18 +2646,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StopTask_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_RestartTask_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_RestartTask_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/RestartTask", runtime.WithHTTPPathPattern("/api/task/restart/{id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/RestartTask", runtime.WithHTTPPathPattern("/api/task/restart/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3273,18 +2663,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_RestartTask_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_StreamList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_StreamList_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/StreamList", runtime.WithHTTPPathPattern("/api/stream/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/StreamList", runtime.WithHTTPPathPattern("/api/stream/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3295,18 +2680,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StreamList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_WaitList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_WaitList_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/WaitList", runtime.WithHTTPPathPattern("/api/stream/waitlist")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/WaitList", runtime.WithHTTPPathPattern("/api/stream/waitlist")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3317,18 +2697,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_WaitList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_StreamInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_StreamInfo_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/StreamInfo", runtime.WithHTTPPathPattern("/api/stream/info/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/StreamInfo", runtime.WithHTTPPathPattern("/api/stream/info/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3339,18 +2714,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StreamInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_PauseStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_PauseStream_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/PauseStream", runtime.WithHTTPPathPattern("/api/stream/pause/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/PauseStream", runtime.WithHTTPPathPattern("/api/stream/pause/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3361,18 +2731,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_PauseStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_ResumeStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_ResumeStream_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/ResumeStream", runtime.WithHTTPPathPattern("/api/stream/resume/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/ResumeStream", runtime.WithHTTPPathPattern("/api/stream/resume/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3383,18 +2748,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_ResumeStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_SetStreamSpeed_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_SetStreamSpeed_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/SetStreamSpeed", runtime.WithHTTPPathPattern("/api/stream/speed/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/SetStreamSpeed", runtime.WithHTTPPathPattern("/api/stream/speed/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3405,18 +2765,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_SetStreamSpeed_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_SeekStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_SeekStream_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/SeekStream", runtime.WithHTTPPathPattern("/api/stream/seek/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/SeekStream", runtime.WithHTTPPathPattern("/api/stream/seek/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3427,18 +2782,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_SeekStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetSubscribers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetSubscribers_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/GetSubscribers", runtime.WithHTTPPathPattern("/api/subscribers/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetSubscribers", runtime.WithHTTPPathPattern("/api/subscribers/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3449,18 +2799,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetSubscribers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_AudioTrackSnap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_AudioTrackSnap_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/AudioTrackSnap", runtime.WithHTTPPathPattern("/api/audiotrack/snap/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/AudioTrackSnap", runtime.WithHTTPPathPattern("/api/audiotrack/snap/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3471,18 +2816,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_AudioTrackSnap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_VideoTrackSnap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_VideoTrackSnap_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/VideoTrackSnap", runtime.WithHTTPPathPattern("/api/videotrack/snap/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/VideoTrackSnap", runtime.WithHTTPPathPattern("/api/videotrack/snap/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3493,18 +2833,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_VideoTrackSnap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_ChangeSubscribe_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_ChangeSubscribe_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/ChangeSubscribe", runtime.WithHTTPPathPattern("/api/subscribe/change/{id}/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/ChangeSubscribe", runtime.WithHTTPPathPattern("/api/subscribe/change/{id}/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3515,18 +2850,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_ChangeSubscribe_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetStreamAlias_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetStreamAlias_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/GetStreamAlias", runtime.WithHTTPPathPattern("/api/stream/alias/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetStreamAlias", runtime.WithHTTPPathPattern("/api/stream/alias/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3537,18 +2867,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetStreamAlias_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_SetStreamAlias_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, 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")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/SetStreamAlias", runtime.WithHTTPPathPattern("/api/stream/alias")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3559,18 +2884,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client 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_StopPublish_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_StopPublish_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/StopPublish", runtime.WithHTTPPathPattern("/api/stream/stop/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/StopPublish", runtime.WithHTTPPathPattern("/api/stream/stop/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3581,18 +2901,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StopPublish_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) { + mux.Handle(http.MethodPost, pattern_Api_StopSubscribe_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/StopSubscribe", runtime.WithHTTPPathPattern("/api/subscribe/stop/{id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/StopSubscribe", runtime.WithHTTPPathPattern("/api/subscribe/stop/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3603,18 +2918,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_StopSubscribe_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetConfigFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetConfigFile_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/GetConfigFile", runtime.WithHTTPPathPattern("/api/config/file")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetConfigFile", runtime.WithHTTPPathPattern("/api/config/file")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3625,18 +2935,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetConfigFile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_UpdateConfigFile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_UpdateConfigFile_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/UpdateConfigFile", runtime.WithHTTPPathPattern("/api/config/file/update")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/UpdateConfigFile", runtime.WithHTTPPathPattern("/api/config/file/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3647,18 +2952,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_UpdateConfigFile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_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, "/global.Api/GetConfig", runtime.WithHTTPPathPattern("/api/config/get/{name}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetConfig", runtime.WithHTTPPathPattern("/api/config/get/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3669,18 +2969,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetFormily_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_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, "/global.Api/GetFormily", runtime.WithHTTPPathPattern("/api/config/formily/{name}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetFormily", runtime.WithHTTPPathPattern("/api/config/formily/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3691,18 +2986,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetFormily_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetPullProxyList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetPullProxyList_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/GetPullProxyList", runtime.WithHTTPPathPattern("/api/proxy/pull/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetPullProxyList", runtime.WithHTTPPathPattern("/api/proxy/pull/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3713,18 +3003,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetPullProxyList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetPullProxyList_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetPullProxyList_1, 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/GetPullProxyList", runtime.WithHTTPPathPattern("/api/device/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetPullProxyList", runtime.WithHTTPPathPattern("/api/device/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3735,18 +3020,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetPullProxyList_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_AddPullProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_AddPullProxy_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/AddPullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/add")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/AddPullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3757,18 +3037,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_AddPullProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_AddPullProxy_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_AddPullProxy_1, 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/AddPullProxy", runtime.WithHTTPPathPattern("/api/device/add")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/AddPullProxy", runtime.WithHTTPPathPattern("/api/device/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3779,18 +3054,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_AddPullProxy_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_RemovePullProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_RemovePullProxy_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/RemovePullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/remove/{id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/RemovePullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/remove/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3801,18 +3071,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_RemovePullProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_RemovePullProxy_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_RemovePullProxy_1, 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/RemovePullProxy", runtime.WithHTTPPathPattern("/api/device/remove/{id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/RemovePullProxy", runtime.WithHTTPPathPattern("/api/device/remove/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3823,18 +3088,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_RemovePullProxy_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_UpdatePullProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_UpdatePullProxy_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/UpdatePullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/update")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/UpdatePullProxy", runtime.WithHTTPPathPattern("/api/proxy/pull/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3845,18 +3105,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_UpdatePullProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_UpdatePullProxy_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_UpdatePullProxy_1, 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/UpdatePullProxy", runtime.WithHTTPPathPattern("/api/device/update")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/UpdatePullProxy", runtime.WithHTTPPathPattern("/api/device/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3867,18 +3122,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_UpdatePullProxy_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetPushProxyList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetPushProxyList_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/GetPushProxyList", runtime.WithHTTPPathPattern("/api/proxy/push/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetPushProxyList", runtime.WithHTTPPathPattern("/api/proxy/push/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3889,18 +3139,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetPushProxyList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_AddPushProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_AddPushProxy_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/AddPushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/add")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/AddPushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/add")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3911,18 +3156,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_AddPushProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_RemovePushProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_RemovePushProxy_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/RemovePushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/remove/{id}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/RemovePushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/remove/{id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3933,18 +3173,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_RemovePushProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_UpdatePushProxy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_UpdatePushProxy_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/UpdatePushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/update")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/UpdatePushProxy", runtime.WithHTTPPathPattern("/api/proxy/push/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3955,18 +3190,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_UpdatePushProxy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetRecording_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetRecording_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/GetRecording", runtime.WithHTTPPathPattern("/api/record/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetRecording", runtime.WithHTTPPathPattern("/api/record/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3977,18 +3207,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetRecording_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetTransformList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetTransformList_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/GetTransformList", runtime.WithHTTPPathPattern("/api/transform/list")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetTransformList", runtime.WithHTTPPathPattern("/api/transform/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3999,18 +3224,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetTransformList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetRecordList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetRecordList_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/GetRecordList", runtime.WithHTTPPathPattern("/api/record/{type}/list/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetRecordList", runtime.WithHTTPPathPattern("/api/record/{type}/list/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4021,18 +3241,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetRecordList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetEventRecordList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetEventRecordList_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/GetEventRecordList", runtime.WithHTTPPathPattern("/api/record/{type}/event/list/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetEventRecordList", runtime.WithHTTPPathPattern("/api/record/{type}/event/list/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4043,18 +3258,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetEventRecordList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("GET", pattern_Api_GetRecordCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodGet, pattern_Api_GetRecordCatalog_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/GetRecordCatalog", runtime.WithHTTPPathPattern("/api/record/{type}/catalog")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetRecordCatalog", runtime.WithHTTPPathPattern("/api/record/{type}/catalog")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4065,18 +3275,13 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_GetRecordCatalog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_Api_DeleteRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_Api_DeleteRecord_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/DeleteRecord", runtime.WithHTTPPathPattern("/api/record/{type}/delete/{streamPath=**}")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/DeleteRecord", runtime.WithHTTPPathPattern("/api/record/{type}/delete/{streamPath=**}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -4087,194 +3292,122 @@ func RegisterApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Api_DeleteRecord_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - + mux.Handle(http.MethodGet, pattern_Api_GetAlarmList_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) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/global.Api/GetAlarmList", runtime.WithHTTPPathPattern("/api/alarm/list")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Api_GetAlarmList_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_GetAlarmList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) return nil } var ( - pattern_Api_SysInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "sysinfo"}, "")) - - pattern_Api_DisabledPlugins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "plugins", "disabled"}, "")) - - pattern_Api_Summary_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "summary"}, "")) - - pattern_Api_Shutdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "shutdown"}, "")) - - pattern_Api_Restart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "restart"}, "")) - - pattern_Api_TaskTree_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "task", "tree"}, "")) - - pattern_Api_StopTask_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "task", "stop", "id"}, "")) - - pattern_Api_RestartTask_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "task", "restart", "id"}, "")) - - pattern_Api_StreamList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "stream", "list"}, "")) - - pattern_Api_WaitList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "stream", "waitlist"}, "")) - - pattern_Api_StreamInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "info", "streamPath"}, "")) - - pattern_Api_PauseStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "pause", "streamPath"}, "")) - - pattern_Api_ResumeStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "resume", "streamPath"}, "")) - - pattern_Api_SetStreamSpeed_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "speed", "streamPath"}, "")) - - pattern_Api_SeekStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "seek", "streamPath"}, "")) - - pattern_Api_GetSubscribers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 3, 0, 4, 1, 5, 2}, []string{"api", "subscribers", "streamPath"}, "")) - - pattern_Api_AudioTrackSnap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "audiotrack", "snap", "streamPath"}, "")) - - pattern_Api_VideoTrackSnap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "videotrack", "snap", "streamPath"}, "")) - - 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_GetStreamAlias_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "stream", "alias", "list"}, "")) - - pattern_Api_SetStreamAlias_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "stream", "alias"}, "")) - - pattern_Api_StopPublish_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "stop", "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_GetConfigFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "config", "file"}, "")) - - pattern_Api_UpdateConfigFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "config", "file", "update"}, "")) - - 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"}, "")) - - pattern_Api_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_Api_GetPullProxyList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "pull", "list"}, "")) - - pattern_Api_GetPullProxyList_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "device", "list"}, "")) - - pattern_Api_AddPullProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "pull", "add"}, "")) - - pattern_Api_AddPullProxy_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "device", "add"}, "")) - - pattern_Api_RemovePullProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"api", "proxy", "pull", "remove", "id"}, "")) - - pattern_Api_RemovePullProxy_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "device", "remove", "id"}, "")) - - pattern_Api_UpdatePullProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "pull", "update"}, "")) - - pattern_Api_UpdatePullProxy_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "device", "update"}, "")) - - pattern_Api_GetPushProxyList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "push", "list"}, "")) - - pattern_Api_AddPushProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "push", "add"}, "")) - - pattern_Api_RemovePushProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"api", "proxy", "push", "remove", "id"}, "")) - - pattern_Api_UpdatePushProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "push", "update"}, "")) - - pattern_Api_GetRecording_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "record", "list"}, "")) - - pattern_Api_GetTransformList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "transform", "list"}, "")) - - pattern_Api_GetRecordList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 3, 0, 4, 1, 5, 4}, []string{"api", "record", "type", "list", "streamPath"}, "")) - + pattern_Api_SysInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "sysinfo"}, "")) + pattern_Api_DisabledPlugins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "plugins", "disabled"}, "")) + pattern_Api_Summary_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "summary"}, "")) + pattern_Api_Shutdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "shutdown"}, "")) + pattern_Api_Restart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"api", "restart"}, "")) + pattern_Api_TaskTree_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "task", "tree"}, "")) + pattern_Api_StopTask_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "task", "stop", "id"}, "")) + pattern_Api_RestartTask_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "task", "restart", "id"}, "")) + pattern_Api_StreamList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "stream", "list"}, "")) + pattern_Api_WaitList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "stream", "waitlist"}, "")) + pattern_Api_StreamInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "info", "streamPath"}, "")) + pattern_Api_PauseStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "pause", "streamPath"}, "")) + pattern_Api_ResumeStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "resume", "streamPath"}, "")) + pattern_Api_SetStreamSpeed_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "speed", "streamPath"}, "")) + pattern_Api_SeekStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "seek", "streamPath"}, "")) + pattern_Api_GetSubscribers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 3, 0, 4, 1, 5, 2}, []string{"api", "subscribers", "streamPath"}, "")) + pattern_Api_AudioTrackSnap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "audiotrack", "snap", "streamPath"}, "")) + pattern_Api_VideoTrackSnap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "videotrack", "snap", "streamPath"}, "")) + 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_GetStreamAlias_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "stream", "alias", "list"}, "")) + pattern_Api_SetStreamAlias_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "stream", "alias"}, "")) + pattern_Api_StopPublish_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"api", "stream", "stop", "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_GetConfigFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "config", "file"}, "")) + pattern_Api_UpdateConfigFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "config", "file", "update"}, "")) + 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"}, "")) + pattern_Api_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_Api_GetPullProxyList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "pull", "list"}, "")) + pattern_Api_GetPullProxyList_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "device", "list"}, "")) + pattern_Api_AddPullProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "pull", "add"}, "")) + pattern_Api_AddPullProxy_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "device", "add"}, "")) + pattern_Api_RemovePullProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"api", "proxy", "pull", "remove", "id"}, "")) + pattern_Api_RemovePullProxy_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "device", "remove", "id"}, "")) + pattern_Api_UpdatePullProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "pull", "update"}, "")) + pattern_Api_UpdatePullProxy_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "device", "update"}, "")) + pattern_Api_GetPushProxyList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "push", "list"}, "")) + pattern_Api_AddPushProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "push", "add"}, "")) + pattern_Api_RemovePushProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"api", "proxy", "push", "remove", "id"}, "")) + pattern_Api_UpdatePushProxy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "proxy", "push", "update"}, "")) + pattern_Api_GetRecording_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "record", "list"}, "")) + pattern_Api_GetTransformList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "transform", "list"}, "")) + pattern_Api_GetRecordList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 3, 0, 4, 1, 5, 4}, []string{"api", "record", "type", "list", "streamPath"}, "")) pattern_Api_GetEventRecordList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4, 3, 0, 4, 1, 5, 5}, []string{"api", "record", "type", "event", "list", "streamPath"}, "")) - - pattern_Api_GetRecordCatalog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "record", "type", "catalog"}, "")) - - pattern_Api_DeleteRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 3, 0, 4, 1, 5, 4}, []string{"api", "record", "type", "delete", "streamPath"}, "")) + pattern_Api_GetRecordCatalog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"api", "record", "type", "catalog"}, "")) + pattern_Api_DeleteRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 3, 0, 4, 1, 5, 4}, []string{"api", "record", "type", "delete", "streamPath"}, "")) + pattern_Api_GetAlarmList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "alarm", "list"}, "")) ) var ( - forward_Api_SysInfo_0 = runtime.ForwardResponseMessage - - forward_Api_DisabledPlugins_0 = runtime.ForwardResponseMessage - - forward_Api_Summary_0 = runtime.ForwardResponseMessage - - forward_Api_Shutdown_0 = runtime.ForwardResponseMessage - - forward_Api_Restart_0 = runtime.ForwardResponseMessage - - forward_Api_TaskTree_0 = runtime.ForwardResponseMessage - - forward_Api_StopTask_0 = runtime.ForwardResponseMessage - - forward_Api_RestartTask_0 = runtime.ForwardResponseMessage - - forward_Api_StreamList_0 = runtime.ForwardResponseMessage - - forward_Api_WaitList_0 = runtime.ForwardResponseMessage - - forward_Api_StreamInfo_0 = runtime.ForwardResponseMessage - - forward_Api_PauseStream_0 = runtime.ForwardResponseMessage - - forward_Api_ResumeStream_0 = runtime.ForwardResponseMessage - - forward_Api_SetStreamSpeed_0 = runtime.ForwardResponseMessage - - forward_Api_SeekStream_0 = runtime.ForwardResponseMessage - - forward_Api_GetSubscribers_0 = runtime.ForwardResponseMessage - - forward_Api_AudioTrackSnap_0 = runtime.ForwardResponseMessage - - forward_Api_VideoTrackSnap_0 = runtime.ForwardResponseMessage - - forward_Api_ChangeSubscribe_0 = runtime.ForwardResponseMessage - - forward_Api_GetStreamAlias_0 = runtime.ForwardResponseMessage - - forward_Api_SetStreamAlias_0 = runtime.ForwardResponseMessage - - forward_Api_StopPublish_0 = runtime.ForwardResponseMessage - - forward_Api_StopSubscribe_0 = runtime.ForwardResponseMessage - - forward_Api_GetConfigFile_0 = runtime.ForwardResponseMessage - - forward_Api_UpdateConfigFile_0 = runtime.ForwardResponseMessage - - forward_Api_GetConfig_0 = runtime.ForwardResponseMessage - - forward_Api_GetFormily_0 = runtime.ForwardResponseMessage - - forward_Api_GetPullProxyList_0 = runtime.ForwardResponseMessage - - forward_Api_GetPullProxyList_1 = runtime.ForwardResponseMessage - - forward_Api_AddPullProxy_0 = runtime.ForwardResponseMessage - - forward_Api_AddPullProxy_1 = runtime.ForwardResponseMessage - - forward_Api_RemovePullProxy_0 = runtime.ForwardResponseMessage - - forward_Api_RemovePullProxy_1 = runtime.ForwardResponseMessage - - forward_Api_UpdatePullProxy_0 = runtime.ForwardResponseMessage - - forward_Api_UpdatePullProxy_1 = runtime.ForwardResponseMessage - - forward_Api_GetPushProxyList_0 = runtime.ForwardResponseMessage - - forward_Api_AddPushProxy_0 = runtime.ForwardResponseMessage - - forward_Api_RemovePushProxy_0 = runtime.ForwardResponseMessage - - forward_Api_UpdatePushProxy_0 = runtime.ForwardResponseMessage - - forward_Api_GetRecording_0 = runtime.ForwardResponseMessage - - forward_Api_GetTransformList_0 = runtime.ForwardResponseMessage - - forward_Api_GetRecordList_0 = runtime.ForwardResponseMessage - + forward_Api_SysInfo_0 = runtime.ForwardResponseMessage + forward_Api_DisabledPlugins_0 = runtime.ForwardResponseMessage + forward_Api_Summary_0 = runtime.ForwardResponseMessage + forward_Api_Shutdown_0 = runtime.ForwardResponseMessage + forward_Api_Restart_0 = runtime.ForwardResponseMessage + forward_Api_TaskTree_0 = runtime.ForwardResponseMessage + forward_Api_StopTask_0 = runtime.ForwardResponseMessage + forward_Api_RestartTask_0 = runtime.ForwardResponseMessage + forward_Api_StreamList_0 = runtime.ForwardResponseMessage + forward_Api_WaitList_0 = runtime.ForwardResponseMessage + forward_Api_StreamInfo_0 = runtime.ForwardResponseMessage + forward_Api_PauseStream_0 = runtime.ForwardResponseMessage + forward_Api_ResumeStream_0 = runtime.ForwardResponseMessage + forward_Api_SetStreamSpeed_0 = runtime.ForwardResponseMessage + forward_Api_SeekStream_0 = runtime.ForwardResponseMessage + forward_Api_GetSubscribers_0 = runtime.ForwardResponseMessage + forward_Api_AudioTrackSnap_0 = runtime.ForwardResponseMessage + forward_Api_VideoTrackSnap_0 = runtime.ForwardResponseMessage + forward_Api_ChangeSubscribe_0 = runtime.ForwardResponseMessage + forward_Api_GetStreamAlias_0 = runtime.ForwardResponseMessage + forward_Api_SetStreamAlias_0 = runtime.ForwardResponseMessage + forward_Api_StopPublish_0 = runtime.ForwardResponseMessage + forward_Api_StopSubscribe_0 = runtime.ForwardResponseMessage + forward_Api_GetConfigFile_0 = runtime.ForwardResponseMessage + forward_Api_UpdateConfigFile_0 = runtime.ForwardResponseMessage + forward_Api_GetConfig_0 = runtime.ForwardResponseMessage + forward_Api_GetFormily_0 = runtime.ForwardResponseMessage + forward_Api_GetPullProxyList_0 = runtime.ForwardResponseMessage + forward_Api_GetPullProxyList_1 = runtime.ForwardResponseMessage + forward_Api_AddPullProxy_0 = runtime.ForwardResponseMessage + forward_Api_AddPullProxy_1 = runtime.ForwardResponseMessage + forward_Api_RemovePullProxy_0 = runtime.ForwardResponseMessage + forward_Api_RemovePullProxy_1 = runtime.ForwardResponseMessage + forward_Api_UpdatePullProxy_0 = runtime.ForwardResponseMessage + forward_Api_UpdatePullProxy_1 = runtime.ForwardResponseMessage + forward_Api_GetPushProxyList_0 = runtime.ForwardResponseMessage + forward_Api_AddPushProxy_0 = runtime.ForwardResponseMessage + forward_Api_RemovePushProxy_0 = runtime.ForwardResponseMessage + forward_Api_UpdatePushProxy_0 = runtime.ForwardResponseMessage + forward_Api_GetRecording_0 = runtime.ForwardResponseMessage + forward_Api_GetTransformList_0 = runtime.ForwardResponseMessage + forward_Api_GetRecordList_0 = runtime.ForwardResponseMessage forward_Api_GetEventRecordList_0 = runtime.ForwardResponseMessage - - forward_Api_GetRecordCatalog_0 = runtime.ForwardResponseMessage - - forward_Api_DeleteRecord_0 = runtime.ForwardResponseMessage + forward_Api_GetRecordCatalog_0 = runtime.ForwardResponseMessage + forward_Api_DeleteRecord_0 = runtime.ForwardResponseMessage + forward_Api_GetAlarmList_0 = runtime.ForwardResponseMessage ) diff --git a/pb/global.proto b/pb/global.proto index 74cd5f8..2f99d41 100644 --- a/pb/global.proto +++ b/pb/global.proto @@ -245,6 +245,11 @@ service api { body: "*" }; } + rpc GetAlarmList (AlarmListRequest) returns (AlarmListResponse) { + option (google.api.http) = { + get: "/api/alarm/list" + }; + } } message DisabledPluginsResponse { @@ -741,4 +746,37 @@ message ResponseDelete { message ReqRecordCatalog { string type = 1; +} + +message AlarmInfo { + uint32 id = 1; + string serverInfo = 2; + string streamName = 3; + string streamPath = 4; + string alarmDesc = 5; + int32 alarmType = 6; + bool isSent = 7; + string filePath = 8; + google.protobuf.Timestamp createdAt = 9; + google.protobuf.Timestamp updatedAt = 10; +} + +message AlarmListRequest { + int32 pageNum = 1; + int32 pageSize = 2; + string range = 3; + string start = 4; + string end = 5; + int32 alarmType = 6; + string streamPath = 7; + string streamName = 8; +} + +message AlarmListResponse { + int32 code = 1; + string message = 2; + int32 total = 3; + int32 pageNum = 4; + int32 pageSize = 5; + repeated AlarmInfo data = 6; } \ No newline at end of file diff --git a/pb/global_grpc.pb.go b/pb/global_grpc.pb.go index 6d47a43..0c890fe 100644 --- a/pb/global_grpc.pb.go +++ b/pb/global_grpc.pb.go @@ -61,6 +61,7 @@ const ( Api_GetEventRecordList_FullMethodName = "/global.api/GetEventRecordList" Api_GetRecordCatalog_FullMethodName = "/global.api/GetRecordCatalog" Api_DeleteRecord_FullMethodName = "/global.api/DeleteRecord" + Api_GetAlarmList_FullMethodName = "/global.api/GetAlarmList" ) // ApiClient is the client API for Api service. @@ -108,6 +109,7 @@ type ApiClient interface { GetEventRecordList(ctx context.Context, in *ReqRecordList, opts ...grpc.CallOption) (*EventRecordResponseList, error) GetRecordCatalog(ctx context.Context, in *ReqRecordCatalog, opts ...grpc.CallOption) (*ResponseCatalog, error) DeleteRecord(ctx context.Context, in *ReqRecordDelete, opts ...grpc.CallOption) (*ResponseDelete, error) + GetAlarmList(ctx context.Context, in *AlarmListRequest, opts ...grpc.CallOption) (*AlarmListResponse, error) } type apiClient struct { @@ -528,6 +530,16 @@ func (c *apiClient) DeleteRecord(ctx context.Context, in *ReqRecordDelete, opts return out, nil } +func (c *apiClient) GetAlarmList(ctx context.Context, in *AlarmListRequest, opts ...grpc.CallOption) (*AlarmListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AlarmListResponse) + err := c.cc.Invoke(ctx, Api_GetAlarmList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // ApiServer is the server API for Api service. // All implementations must embed UnimplementedApiServer // for forward compatibility. @@ -573,6 +585,7 @@ type ApiServer interface { GetEventRecordList(context.Context, *ReqRecordList) (*EventRecordResponseList, error) GetRecordCatalog(context.Context, *ReqRecordCatalog) (*ResponseCatalog, error) DeleteRecord(context.Context, *ReqRecordDelete) (*ResponseDelete, error) + GetAlarmList(context.Context, *AlarmListRequest) (*AlarmListResponse, error) mustEmbedUnimplementedApiServer() } @@ -706,6 +719,9 @@ func (UnimplementedApiServer) GetRecordCatalog(context.Context, *ReqRecordCatalo func (UnimplementedApiServer) DeleteRecord(context.Context, *ReqRecordDelete) (*ResponseDelete, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteRecord not implemented") } +func (UnimplementedApiServer) GetAlarmList(context.Context, *AlarmListRequest) (*AlarmListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAlarmList not implemented") +} func (UnimplementedApiServer) mustEmbedUnimplementedApiServer() {} func (UnimplementedApiServer) testEmbeddedByValue() {} @@ -1465,6 +1481,24 @@ func _Api_DeleteRecord_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Api_GetAlarmList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AlarmListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ApiServer).GetAlarmList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Api_GetAlarmList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ApiServer).GetAlarmList(ctx, req.(*AlarmListRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Api_ServiceDesc is the grpc.ServiceDesc for Api service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1636,6 +1670,10 @@ var Api_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteRecord", Handler: _Api_DeleteRecord_Handler, }, + { + MethodName: "GetAlarmList", + Handler: _Api_GetAlarmList_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "global.proto", diff --git a/pkg/config/types.go b/pkg/config/types.go index 3017e32..c475083 100755 --- a/pkg/config/types.go +++ b/pkg/config/types.go @@ -44,6 +44,15 @@ const ( AlarmPullRecover = 0x10013 // 拉流恢复 AlarmDiskSpaceFull = 0x10014 // 磁盘空间满,磁盘占有率,超出最大磁盘空间使用率,触发报警。 AlarmStartupRunning = 0x10015 // 启动运行 + AlarmPublishOffline = 0x10016 // 发布者异常,触发一次报警。 + AlarmPublishRecover = 0x10017 // 发布者恢复 + AlarmSubscribeOffline = 0x10018 // 订阅者异常,触发一次报警。 + AlarmSubscribeRecover = 0x10019 // 订阅者恢复 + AlarmPushOffline = 0x10020 // 推流异常,触发一次报警。 + AlarmPushRecover = 0x10021 // 推流恢复 + AlarmTransformOffline = 0x10022 // 转换异常,触发一次报警。 + AlarmTransformRecover = 0x10023 // 转换恢复 + AlarmKeepAliveOnline = 0x10024 // 保活正常,触发一次报警。 ) type ( diff --git a/plugin.go b/plugin.go index 1e00424..319be9f 100644 --- a/plugin.go +++ b/plugin.go @@ -7,6 +7,7 @@ import ( "encoding/hex" "encoding/json" "fmt" + "gopkg.in/yaml.v3" "net" "net/http" "net/url" @@ -25,7 +26,6 @@ import ( gatewayRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" myip "github.com/husanpao/ip" "google.golang.org/grpc" - "gopkg.in/yaml.v3" "gorm.io/gorm" . "m7s.live/v5/pkg" @@ -395,16 +395,8 @@ func (t *WebHookTask) Start() error { return task.ErrTaskComplete } - // 将t.data转换为AlarmInfo格式的JSON - var alarmInfo AlarmInfo - + // 处理AlarmInfo数据 if t.data != nil { - // 先转成JSON,再转成AlarmInfo结构体 - jsonData, err := json.Marshal(t.data) - if err != nil { - return fmt.Errorf("marshal data to json: %w", err) - } - // 获取主机名和IP地址 hostname, err := os.Hostname() if err != nil { @@ -428,26 +420,32 @@ func (t *WebHookTask) Start() error { ipAddr = "unknown" } - // 将jsonData反序列化为map,添加ServerInfo字段,然后重新序列化 - var dataMap map[string]interface{} - if err := json.Unmarshal(jsonData, &dataMap); err == nil { - dataMap["server_info"] = fmt.Sprintf("%s (%s)", hostname, ipAddr) - // 添加ISO格式的createAt字段 - dataMap["createAt"] = time.Now().UTC().Format(time.RFC3339) - if newJsonData, err := json.Marshal(dataMap); err == nil { - jsonData = newJsonData - } + // 直接使用t.data作为AlarmInfo + alarmInfo, ok := t.data.(AlarmInfo) + if !ok { + return fmt.Errorf("data is not of type AlarmInfo") + } + + // 更新服务器信息 + if alarmInfo.ServerInfo == "" { + alarmInfo.ServerInfo = fmt.Sprintf("%s (%s)", hostname, ipAddr) + } + + // 确保时间戳已设置 + if alarmInfo.CreatedAt.IsZero() { + alarmInfo.CreatedAt = time.Now() + } + if alarmInfo.UpdatedAt.IsZero() { + alarmInfo.UpdatedAt = time.Now() + } + + // 将AlarmInfo序列化为JSON + jsonData, err := json.Marshal(alarmInfo) + if err != nil { + return fmt.Errorf("marshal AlarmInfo to json: %w", err) } t.jsonData = jsonData - - err = json.Unmarshal(jsonData, &alarmInfo) - if err != nil { - return fmt.Errorf("unmarshal json to AlarmInfo: %w", err) - } - alarmInfo.CreatedAt = time.Now() - alarmInfo.UpdatedAt = time.Now() - t.alarm = alarmInfo } @@ -635,27 +633,22 @@ func (p *Plugin) PublishWithConfig(ctx context.Context, streamPath string, conf if err == nil { if sender, webhook := p.getHookSender(config.HookOnPublishEnd); sender != nil { publisher.OnDispose(func() { - webhookData := map[string]interface{}{ - "alarmType": config.AlarmPullOffline, - "streamPath": publisher.StreamPath, - "publishId": publisher.ID, - "alarmDesc": publisher.StopReason().Error(), + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnPublishEnd), + AlarmDesc: publisher.StopReason().Error(), + AlarmType: config.AlarmPublishOffline, + StreamPath: publisher.StreamPath, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } if sender, webhook := p.getHookSender(config.HookOnPublishStart); sender != nil { - webhookData := map[string]interface{}{ - "alarmType": config.AlarmPullRecover, - "alarmDesc": config.HookOnPublishStart, - "streamPath": publisher.StreamPath, - "args": publisher.Args, - "publishId": publisher.ID, - "remoteAddr": publisher.RemoteAddr, - "type": publisher.Type, - "pluginName": p.Meta.Name, + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnPublishStart), + AlarmType: config.AlarmPublishRecover, + StreamPath: publisher.StreamPath, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) } } return @@ -698,31 +691,22 @@ func (p *Plugin) SubscribeWithConfig(ctx context.Context, streamPath string, con if err == nil { if sender, webhook := p.getHookSender(config.HookOnSubscribeEnd); sender != nil { subscriber.OnDispose(func() { - webhookData := map[string]interface{}{ - "event": config.HookOnSubscribeEnd, - "streamPath": subscriber.StreamPath, - "subscriberId": subscriber.ID, - "reason": subscriber.StopReason().Error(), - "timestamp": time.Now().Unix(), + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnSubscribeEnd), + AlarmDesc: subscriber.StopReason().Error(), + AlarmType: config.AlarmSubscribeOffline, + StreamPath: subscriber.StreamPath, } - if subscriber.Publisher != nil { - webhookData["publishId"] = subscriber.Publisher.ID - } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } if sender, webhook := p.getHookSender(config.HookOnSubscribeStart); sender != nil { - webhookData := map[string]interface{}{ - "event": config.HookOnSubscribeStart, - "streamPath": subscriber.StreamPath, - "publishId": subscriber.Publisher.ID, - "subscriberId": subscriber.ID, - "remoteAddr": subscriber.RemoteAddr, - "type": subscriber.Type, - "args": subscriber.Args, - "timestamp": time.Now().Unix(), + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnSubscribeStart), + AlarmType: config.AlarmSubscribeRecover, + StreamPath: subscriber.StreamPath, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) } } return @@ -870,15 +854,21 @@ func (t *ServerKeepAliveTask) Tick(now any) { if sender == nil { return } - s := t.plugin.Server - webhookData := map[string]interface{}{ - "event": config.HookOnServerKeepAlive, - "timestamp": time.Now().Unix(), - "streams": s.Streams.Length, - "subscribers": s.Subscribers.Length, - "publisherCount": s.Streams.Length, - "subscriberCount": s.Subscribers.Length, - "uptime": time.Since(s.StartTime).Seconds(), + //s := t.plugin.Server + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnServerKeepAlive), + AlarmType: config.AlarmKeepAliveOnline, + StreamPath: "", } - sender(webhook, webhookData) + sender(webhook, alarmInfo) + //webhookData := map[string]interface{}{ + // "event": config.HookOnServerKeepAlive, + // "timestamp": time.Now().Unix(), + // "streams": s.Streams.Length, + // "subscribers": s.Subscribers.Length, + // "publisherCount": s.Streams.Length, + // "subscriberCount": s.Subscribers.Length, + // "uptime": time.Since(s.StartTime).Seconds(), + //} + //sender(webhook, webhookData) } diff --git a/puller.go b/puller.go index c321620..472cb50 100644 --- a/puller.go +++ b/puller.go @@ -123,31 +123,24 @@ func (p *PullJob) Init(puller IPuller, plugin *Plugin, streamPath string, conf c if sender, webhook := plugin.getHookSender(config.HookOnPullStart); sender != nil { puller.OnStart(func() { - webhookData := map[string]interface{}{ - "alarmDesc": config.HookOnPullStart, - "event": config.HookOnPullStart, - "streamPath": streamPath, - "url": conf.URL, - "args": conf.Args, - "pluginName": plugin.Meta.Name, - "timestamp": time.Now().Unix(), - "alarmType": config.AlarmPullRecover, + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnPullStart), + StreamPath: streamPath, + AlarmType: config.AlarmPullRecover, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } if sender, webhook := plugin.getHookSender(config.HookOnPullEnd); sender != nil { puller.OnDispose(func() { - webhookData := map[string]interface{}{ - "alarmDesc": puller.StopReason().Error(), - "event": config.HookOnPullEnd, - "streamPath": streamPath, - "reason": puller.StopReason().Error(), - "timestamp": time.Now().Unix(), - "alarmType": config.AlarmPullOffline, + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnPullEnd), + AlarmDesc: puller.StopReason().Error(), + StreamPath: streamPath, + AlarmType: config.AlarmPullOffline, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } diff --git a/pusher.go b/pusher.go index c37e7ca..a6803b6 100644 --- a/pusher.go +++ b/pusher.go @@ -1,8 +1,6 @@ package m7s import ( - "time" - "m7s.live/v5/pkg" "m7s.live/v5/pkg/task" @@ -45,26 +43,25 @@ func (p *PushJob) Init(pusher IPusher, plugin *Plugin, streamPath string, conf c pusher.SetRetry(conf.MaxRetry, conf.RetryInterval) if sender, webhook := plugin.getHookSender(config.HookOnPushStart); sender != nil { pusher.OnStart(func() { - webhookData := map[string]interface{}{ - "event": config.HookOnPushStart, - "streamPath": streamPath, - "url": conf.URL, - "pluginName": plugin.Meta.Name, - "timestamp": time.Now().Unix(), + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnPushStart), + AlarmDesc: "start push", + AlarmType: config.AlarmPushRecover, + StreamPath: streamPath, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } if sender, webhook := plugin.getHookSender(config.HookOnPushEnd); sender != nil { pusher.OnDispose(func() { - webhookData := map[string]interface{}{ - "event": config.HookOnPullEnd, - "streamPath": streamPath, - "reason": pusher.StopReason().Error(), - "timestamp": time.Now().Unix(), + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnPushEnd), + AlarmDesc: pusher.StopReason().Error(), + AlarmType: config.AlarmPushOffline, + StreamPath: streamPath, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } plugin.Server.Pushs.Add(p, plugin.Logger.With("pushURL", conf.URL, "streamPath", streamPath)) diff --git a/recoder.go b/recoder.go index e8221a9..fed0d19 100644 --- a/recoder.go +++ b/recoder.go @@ -142,27 +142,26 @@ func (p *RecordJob) Init(recorder IRecorder, plugin *Plugin, streamPath string, recorder.SetRetry(-1, time.Second) if sender, webhook := plugin.getHookSender(config.HookOnRecordStart); sender != nil { recorder.OnStart(func() { - webhookData := map[string]interface{}{ - "event": config.HookOnRecordStart, - "streamPath": streamPath, - "filePath": conf.FilePath, - "pluginName": plugin.Meta.Name, - "timestamp": time.Now().Unix(), + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnRecordStart), + AlarmType: config.AlarmStorageExceptionRecover, + StreamPath: streamPath, + FilePath: conf.FilePath, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } if sender, webhook := plugin.getHookSender(config.HookOnRecordEnd); sender != nil { recorder.OnDispose(func() { - webhookData := map[string]interface{}{ - "event": config.HookOnRecordEnd, - "streamPath": streamPath, - "filePath": conf.FilePath, - "reason": recorder.StopReason().Error(), - "timestamp": time.Now().Unix(), + alarmInfo := AlarmInfo{ + AlarmType: config.AlarmStorageException, + AlarmDesc: recorder.StopReason().Error(), + AlarmName: string(config.HookOnRecordEnd), + StreamPath: streamPath, + FilePath: conf.FilePath, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } diff --git a/server.go b/server.go index 5fae8f2..965848f 100644 --- a/server.go +++ b/server.go @@ -439,12 +439,11 @@ func (s *Server) Start() (err error) { return nil }, "serverStart") if sender, webhook := s.getHookSender(config.HookOnSystemStart); sender != nil { - webhookData := map[string]interface{}{ - "alarmDesc": config.HookOnSystemStart, - "streamPath": "", - "alarmType": config.AlarmStartupRunning, + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnSystemStart), + AlarmType: config.AlarmStartupRunning, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) } return } diff --git a/transformer.go b/transformer.go index 2e8fa11..0ae200c 100644 --- a/transformer.go +++ b/transformer.go @@ -107,24 +107,23 @@ func (p *TransformJob) Init(transformer ITransformer, plugin *Plugin, pub *Publi transformer.SetRetry(-1, time.Second*2) if sender, webhook := plugin.getHookSender(config.HookOnTransformStart); sender != nil { transformer.OnStart(func() { - webhookData := map[string]interface{}{ - "event": config.HookOnTransformStart, - "streamPath": pub.StreamPath, - "pluginName": plugin.Meta.Name, - "timestamp": time.Now().Unix(), + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnTransformStart), + AlarmType: config.AlarmTransformRecover, + StreamPath: pub.StreamPath, } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } if sender, webhook := plugin.getHookSender(config.HookOnTransformEnd); sender != nil { transformer.OnDispose(func() { - webhookData := map[string]interface{}{ - "event": config.HookOnTransformEnd, - "streamPath": pub.StreamPath, - "reason": transformer.StopReason().Error(), - "timestamp": time.Now().Unix(), + alarmInfo := AlarmInfo{ + AlarmName: string(config.HookOnTransformEnd), + AlarmType: config.AlarmTransformOffline, + StreamPath: pub.StreamPath, + AlarmDesc: transformer.StopReason().Error(), } - sender(webhook, webhookData) + sender(webhook, alarmInfo) }) } plugin.Server.Transforms.AddTask(p, plugin.Logger.With("streamPath", pub.StreamPath))