Documentation ¶
Overview ¶
Package processor is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterProcessorHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterProcessorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProcessorClient) error
- func RegisterProcessorHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterProcessorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProcessorServer) error
- func RegisterProcessorServer(s grpc.ServiceRegistrar, srv ProcessorServer)
- type CreateReply
- func (*CreateReply) Descriptor() ([]byte, []int)deprecated
- func (x *CreateReply) GetCode() int32
- func (x *CreateReply) GetMessage() string
- func (x *CreateReply) GetProcessor() *ProcessorMeta
- func (*CreateReply) ProtoMessage()
- func (x *CreateReply) ProtoReflect() protoreflect.Message
- func (x *CreateReply) Reset()
- func (x *CreateReply) String() string
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRequest) GetAddr() string
- func (x *CreateRequest) GetAppid() int32
- func (x *CreateRequest) GetState() string
- func (x *CreateRequest) GetWeight() int32
- func (*CreateRequest) ProtoMessage()
- func (x *CreateRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRequest) Reset()
- func (x *CreateRequest) String() string
- type DeleteReply
- type DeleteRequest
- func (*DeleteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteRequest) GetAppid() int32
- func (x *DeleteRequest) GetUuid() int32
- func (*DeleteRequest) ProtoMessage()
- func (x *DeleteRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteRequest) Reset()
- func (x *DeleteRequest) String() string
- type GetReply
- func (*GetReply) Descriptor() ([]byte, []int)deprecated
- func (x *GetReply) GetCode() int32
- func (x *GetReply) GetCount() int32
- func (x *GetReply) GetLimit() int32
- func (x *GetReply) GetMessage() string
- func (x *GetReply) GetPage() int32
- func (x *GetReply) GetProcessors() []*ProcessorMeta
- func (x *GetReply) GetTotal() int32
- func (*GetReply) ProtoMessage()
- func (x *GetReply) ProtoReflect() protoreflect.Message
- func (x *GetReply) Reset()
- func (x *GetReply) String() string
- type GetRequest
- func (*GetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetRequest) GetAddr() string
- func (x *GetRequest) GetAppid() int32
- func (x *GetRequest) GetLimit() int32
- func (x *GetRequest) GetPage() int32
- func (x *GetRequest) GetState() string
- func (x *GetRequest) GetUuid() int32
- func (x *GetRequest) GetWeight() int32
- func (*GetRequest) ProtoMessage()
- func (x *GetRequest) ProtoReflect() protoreflect.Message
- func (x *GetRequest) Reset()
- func (x *GetRequest) String() string
- type ProcessorClient
- type ProcessorMeta
- func (*ProcessorMeta) Descriptor() ([]byte, []int)deprecated
- func (x *ProcessorMeta) GetAddr() string
- func (x *ProcessorMeta) GetAppid() int32
- func (x *ProcessorMeta) GetCreateTime() *timestamppb.Timestamp
- func (x *ProcessorMeta) GetState() string
- func (x *ProcessorMeta) GetTenantId() int32
- func (x *ProcessorMeta) GetUpdateTime() *timestamppb.Timestamp
- func (x *ProcessorMeta) GetUuid() int32
- func (x *ProcessorMeta) GetWeight() int32
- func (*ProcessorMeta) ProtoMessage()
- func (x *ProcessorMeta) ProtoReflect() protoreflect.Message
- func (x *ProcessorMeta) Reset()
- func (x *ProcessorMeta) String() string
- type ProcessorServer
- type Timestamp
- type UnimplementedProcessorServer
- func (UnimplementedProcessorServer) Create(context.Context, *CreateRequest) (*CreateReply, error)
- func (UnimplementedProcessorServer) Delete(context.Context, *DeleteRequest) (*DeleteReply, error)
- func (UnimplementedProcessorServer) Get(context.Context, *GetRequest) (*GetReply, error)
- func (UnimplementedProcessorServer) Update(context.Context, *UpdateRequest) (*UpdateReply, error)
- type UnsafeProcessorServer
- type UpdateReply
- func (*UpdateReply) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateReply) GetCode() int32
- func (x *UpdateReply) GetMessage() string
- func (x *UpdateReply) GetProcessor() *ProcessorMeta
- func (*UpdateReply) ProtoMessage()
- func (x *UpdateReply) ProtoReflect() protoreflect.Message
- func (x *UpdateReply) Reset()
- func (x *UpdateReply) String() string
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateRequest) GetAddr() string
- func (x *UpdateRequest) GetAppid() int32
- func (x *UpdateRequest) GetState() string
- func (x *UpdateRequest) GetUuid() int32
- func (x *UpdateRequest) GetWeight() int32
- func (*UpdateRequest) ProtoMessage()
- func (x *UpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateRequest) Reset()
- func (x *UpdateRequest) String() string
Constants ¶
const ( Processor_Create_FullMethodName = "/service.collector.processor.Processor/Create" Processor_Get_FullMethodName = "/service.collector.processor.Processor/Get" Processor_Delete_FullMethodName = "/service.collector.processor.Processor/Delete" Processor_Update_FullMethodName = "/service.collector.processor.Processor/Update" )
Variables ¶
var E_Http = annotations.E_Http
var File_processor_processor_proto protoreflect.FileDescriptor
var Processor_ServiceDesc = grpc.ServiceDesc{ ServiceName: "service.collector.processor.Processor", HandlerType: (*ProcessorServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _Processor_Create_Handler, }, { MethodName: "Get", Handler: _Processor_Get_Handler, }, { MethodName: "Delete", Handler: _Processor_Delete_Handler, }, { MethodName: "Update", Handler: _Processor_Update_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "processor/processor.proto", }
Processor_ServiceDesc is the grpc.ServiceDesc for Processor service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterProcessorHandler ¶
func RegisterProcessorHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterProcessorHandler registers the http handlers for service Processor to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterProcessorHandlerClient ¶
func RegisterProcessorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProcessorClient) error
RegisterProcessorHandlerClient registers the http handlers for service Processor to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProcessorClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProcessorClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProcessorClient" to call the correct interceptors.
func RegisterProcessorHandlerFromEndpoint ¶
func RegisterProcessorHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterProcessorHandlerFromEndpoint is same as RegisterProcessorHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterProcessorHandlerServer ¶
func RegisterProcessorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProcessorServer) error
RegisterProcessorHandlerServer registers the http handlers for service Processor to "mux". UnaryRPC :call ProcessorServer 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 RegisterProcessorHandlerFromEndpoint instead.
func RegisterProcessorServer ¶
func RegisterProcessorServer(s grpc.ServiceRegistrar, srv ProcessorServer)
Types ¶
type CreateReply ¶
type CreateReply struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Processor *ProcessorMeta `protobuf:"bytes,3,opt,name=processor,proto3" json:"processor,omitempty"` // contains filtered or unexported fields }
func (*CreateReply) Descriptor
deprecated
func (*CreateReply) Descriptor() ([]byte, []int)
Deprecated: Use CreateReply.ProtoReflect.Descriptor instead.
func (*CreateReply) GetCode ¶
func (x *CreateReply) GetCode() int32
func (*CreateReply) GetMessage ¶
func (x *CreateReply) GetMessage() string
func (*CreateReply) GetProcessor ¶
func (x *CreateReply) GetProcessor() *ProcessorMeta
func (*CreateReply) ProtoMessage ¶
func (*CreateReply) ProtoMessage()
func (*CreateReply) ProtoReflect ¶
func (x *CreateReply) ProtoReflect() protoreflect.Message
func (*CreateReply) Reset ¶
func (x *CreateReply) Reset()
func (*CreateReply) String ¶
func (x *CreateReply) String() string
type CreateRequest ¶
type CreateRequest struct { Appid int32 `protobuf:"varint,1,opt,name=appid,proto3" json:"appid,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Weight int32 `protobuf:"varint,3,opt,name=weight,proto3" json:"weight,omitempty"` State string `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"` // contains filtered or unexported fields }
func (*CreateRequest) Descriptor
deprecated
func (*CreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.
func (*CreateRequest) GetAddr ¶
func (x *CreateRequest) GetAddr() string
func (*CreateRequest) GetAppid ¶
func (x *CreateRequest) GetAppid() int32
func (*CreateRequest) GetState ¶
func (x *CreateRequest) GetState() string
func (*CreateRequest) GetWeight ¶
func (x *CreateRequest) GetWeight() int32
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) ProtoReflect ¶
func (x *CreateRequest) ProtoReflect() protoreflect.Message
func (*CreateRequest) Reset ¶
func (x *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (x *CreateRequest) String() string
type DeleteReply ¶
type DeleteReply struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*DeleteReply) Descriptor
deprecated
func (*DeleteReply) Descriptor() ([]byte, []int)
Deprecated: Use DeleteReply.ProtoReflect.Descriptor instead.
func (*DeleteReply) GetCode ¶
func (x *DeleteReply) GetCode() int32
func (*DeleteReply) GetMessage ¶
func (x *DeleteReply) GetMessage() string
func (*DeleteReply) ProtoMessage ¶
func (*DeleteReply) ProtoMessage()
func (*DeleteReply) ProtoReflect ¶
func (x *DeleteReply) ProtoReflect() protoreflect.Message
func (*DeleteReply) Reset ¶
func (x *DeleteReply) Reset()
func (*DeleteReply) String ¶
func (x *DeleteReply) String() string
type DeleteRequest ¶
type DeleteRequest struct { Appid int32 `protobuf:"varint,1,opt,name=appid,proto3" json:"appid,omitempty"` Uuid int32 `protobuf:"varint,2,opt,name=uuid,proto3" json:"uuid,omitempty"` // contains filtered or unexported fields }
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetAppid ¶
func (x *DeleteRequest) GetAppid() int32
func (*DeleteRequest) GetUuid ¶
func (x *DeleteRequest) GetUuid() int32
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type GetReply ¶
type GetReply struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Processors []*ProcessorMeta `protobuf:"bytes,3,rep,name=processors,proto3" json:"processors,omitempty"` Count int32 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` Total int32 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` Page int32 `protobuf:"varint,6,opt,name=page,proto3" json:"page,omitempty"` Limit int32 `protobuf:"varint,7,opt,name=limit,proto3" json:"limit,omitempty"` // contains filtered or unexported fields }
func (*GetReply) Descriptor
deprecated
func (*GetReply) GetMessage ¶
func (*GetReply) GetProcessors ¶
func (x *GetReply) GetProcessors() []*ProcessorMeta
func (*GetReply) ProtoMessage ¶
func (*GetReply) ProtoMessage()
func (*GetReply) ProtoReflect ¶
func (x *GetReply) ProtoReflect() protoreflect.Message
type GetRequest ¶
type GetRequest struct { Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` Appid int32 `protobuf:"varint,3,opt,name=appid,proto3" json:"appid,omitempty"` Uuid int32 `protobuf:"varint,4,opt,name=uuid,proto3" json:"uuid,omitempty"` Addr string `protobuf:"bytes,5,opt,name=addr,proto3" json:"addr,omitempty"` Weight int32 `protobuf:"varint,6,opt,name=weight,proto3" json:"weight,omitempty"` State string `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetAddr ¶
func (x *GetRequest) GetAddr() string
func (*GetRequest) GetAppid ¶
func (x *GetRequest) GetAppid() int32
func (*GetRequest) GetLimit ¶
func (x *GetRequest) GetLimit() int32
func (*GetRequest) GetPage ¶
func (x *GetRequest) GetPage() int32
func (*GetRequest) GetState ¶
func (x *GetRequest) GetState() string
func (*GetRequest) GetUuid ¶
func (x *GetRequest) GetUuid() int32
func (*GetRequest) GetWeight ¶
func (x *GetRequest) GetWeight() int32
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type ProcessorClient ¶
type ProcessorClient interface { Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateReply, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteReply, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateReply, error) }
ProcessorClient is the client API for Processor service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewProcessorClient ¶
func NewProcessorClient(cc grpc.ClientConnInterface) ProcessorClient
type ProcessorMeta ¶
type ProcessorMeta struct { Uuid int32 `protobuf:"varint,1,opt,name=uuid,proto3" json:"uuid,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Weight int32 `protobuf:"varint,3,opt,name=weight,proto3" json:"weight,omitempty"` State string `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` Appid int32 `protobuf:"varint,7,opt,name=appid,proto3" json:"appid,omitempty"` TenantId int32 `protobuf:"varint,8,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` // contains filtered or unexported fields }
func (*ProcessorMeta) Descriptor
deprecated
func (*ProcessorMeta) Descriptor() ([]byte, []int)
Deprecated: Use ProcessorMeta.ProtoReflect.Descriptor instead.
func (*ProcessorMeta) GetAddr ¶
func (x *ProcessorMeta) GetAddr() string
func (*ProcessorMeta) GetAppid ¶
func (x *ProcessorMeta) GetAppid() int32
func (*ProcessorMeta) GetCreateTime ¶
func (x *ProcessorMeta) GetCreateTime() *timestamppb.Timestamp
func (*ProcessorMeta) GetState ¶
func (x *ProcessorMeta) GetState() string
func (*ProcessorMeta) GetTenantId ¶
func (x *ProcessorMeta) GetTenantId() int32
func (*ProcessorMeta) GetUpdateTime ¶
func (x *ProcessorMeta) GetUpdateTime() *timestamppb.Timestamp
func (*ProcessorMeta) GetUuid ¶
func (x *ProcessorMeta) GetUuid() int32
func (*ProcessorMeta) GetWeight ¶
func (x *ProcessorMeta) GetWeight() int32
func (*ProcessorMeta) ProtoMessage ¶
func (*ProcessorMeta) ProtoMessage()
func (*ProcessorMeta) ProtoReflect ¶
func (x *ProcessorMeta) ProtoReflect() protoreflect.Message
func (*ProcessorMeta) Reset ¶
func (x *ProcessorMeta) Reset()
func (*ProcessorMeta) String ¶
func (x *ProcessorMeta) String() string
type ProcessorServer ¶
type ProcessorServer interface { Create(context.Context, *CreateRequest) (*CreateReply, error) Get(context.Context, *GetRequest) (*GetReply, error) Delete(context.Context, *DeleteRequest) (*DeleteReply, error) Update(context.Context, *UpdateRequest) (*UpdateReply, error) // contains filtered or unexported methods }
ProcessorServer is the server API for Processor service. All implementations must embed UnimplementedProcessorServer for forward compatibility
type Timestamp ¶
type Timestamp = timestamppb.Timestamp
type UnimplementedProcessorServer ¶
type UnimplementedProcessorServer struct { }
UnimplementedProcessorServer must be embedded to have forward compatible implementations.
func (UnimplementedProcessorServer) Create ¶
func (UnimplementedProcessorServer) Create(context.Context, *CreateRequest) (*CreateReply, error)
func (UnimplementedProcessorServer) Delete ¶
func (UnimplementedProcessorServer) Delete(context.Context, *DeleteRequest) (*DeleteReply, error)
func (UnimplementedProcessorServer) Get ¶
func (UnimplementedProcessorServer) Get(context.Context, *GetRequest) (*GetReply, error)
func (UnimplementedProcessorServer) Update ¶
func (UnimplementedProcessorServer) Update(context.Context, *UpdateRequest) (*UpdateReply, error)
type UnsafeProcessorServer ¶
type UnsafeProcessorServer interface {
// contains filtered or unexported methods
}
UnsafeProcessorServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProcessorServer will result in compilation errors.
type UpdateReply ¶
type UpdateReply struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Processor *ProcessorMeta `protobuf:"bytes,3,opt,name=processor,proto3" json:"processor,omitempty"` // contains filtered or unexported fields }
func (*UpdateReply) Descriptor
deprecated
func (*UpdateReply) Descriptor() ([]byte, []int)
Deprecated: Use UpdateReply.ProtoReflect.Descriptor instead.
func (*UpdateReply) GetCode ¶
func (x *UpdateReply) GetCode() int32
func (*UpdateReply) GetMessage ¶
func (x *UpdateReply) GetMessage() string
func (*UpdateReply) GetProcessor ¶
func (x *UpdateReply) GetProcessor() *ProcessorMeta
func (*UpdateReply) ProtoMessage ¶
func (*UpdateReply) ProtoMessage()
func (*UpdateReply) ProtoReflect ¶
func (x *UpdateReply) ProtoReflect() protoreflect.Message
func (*UpdateReply) Reset ¶
func (x *UpdateReply) Reset()
func (*UpdateReply) String ¶
func (x *UpdateReply) String() string
type UpdateRequest ¶
type UpdateRequest struct { Appid int32 `protobuf:"varint,1,opt,name=appid,proto3" json:"appid,omitempty"` Uuid int32 `protobuf:"varint,2,opt,name=uuid,proto3" json:"uuid,omitempty"` Addr string `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"` Weight int32 `protobuf:"varint,4,opt,name=weight,proto3" json:"weight,omitempty"` State string `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"` // contains filtered or unexported fields }
func (*UpdateRequest) Descriptor
deprecated
func (*UpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.
func (*UpdateRequest) GetAddr ¶
func (x *UpdateRequest) GetAddr() string
func (*UpdateRequest) GetAppid ¶
func (x *UpdateRequest) GetAppid() int32
func (*UpdateRequest) GetState ¶
func (x *UpdateRequest) GetState() string
func (*UpdateRequest) GetUuid ¶
func (x *UpdateRequest) GetUuid() int32
func (*UpdateRequest) GetWeight ¶
func (x *UpdateRequest) GetWeight() int32
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) ProtoReflect ¶
func (x *UpdateRequest) ProtoReflect() protoreflect.Message
func (*UpdateRequest) Reset ¶
func (x *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (x *UpdateRequest) String() string