Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterConfigServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterConfigServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConfigServiceClient) error
- func RegisterConfigServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterConfigServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigServiceServer) error
- func RegisterConfigServiceServer(s grpc.ServiceRegistrar, srv ConfigServiceServer)
- type ConfigServiceClient
- type ConfigServiceServer
- type GetCfgReq
- type GetCfgRsp
- type SetCfgReq
- type SetCfgRsp
- type UnimplementedConfigServiceServer
- type UnsafeConfigServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_cfg_proto protoreflect.FileDescriptor
Functions ¶
func RegisterConfigServiceHandler ¶
func RegisterConfigServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterConfigServiceHandler registers the http handlers for service ConfigService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterConfigServiceHandlerClient ¶
func RegisterConfigServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConfigServiceClient) error
RegisterConfigServiceHandlerClient registers the http handlers for service ConfigService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ConfigServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ConfigServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ConfigServiceClient" to call the correct interceptors.
func RegisterConfigServiceHandlerFromEndpoint ¶
func RegisterConfigServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterConfigServiceHandlerFromEndpoint is same as RegisterConfigServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterConfigServiceHandlerServer ¶
func RegisterConfigServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigServiceServer) error
RegisterConfigServiceHandlerServer registers the http handlers for service ConfigService to "mux". UnaryRPC :call ConfigServiceServer 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 RegisterConfigServiceHandlerFromEndpoint instead.
func RegisterConfigServiceServer ¶
func RegisterConfigServiceServer(s grpc.ServiceRegistrar, srv ConfigServiceServer)
Types ¶
type ConfigServiceClient ¶
type ConfigServiceClient interface { // 获取配置 GetConfig(ctx context.Context, in *GetCfgReq, opts ...grpc.CallOption) (*GetCfgRsp, error) // 设置配置 SetConfig(ctx context.Context, in *SetCfgReq, opts ...grpc.CallOption) (*SetCfgRsp, error) }
ConfigServiceClient is the client API for ConfigService 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 NewConfigServiceClient ¶
func NewConfigServiceClient(cc grpc.ClientConnInterface) ConfigServiceClient
type ConfigServiceServer ¶
type ConfigServiceServer interface { // 获取配置 GetConfig(context.Context, *GetCfgReq) (*GetCfgRsp, error) // 设置配置 SetConfig(context.Context, *SetCfgReq) (*SetCfgRsp, error) // contains filtered or unexported methods }
ConfigServiceServer is the server API for ConfigService service. All implementations must embed UnimplementedConfigServiceServer for forward compatibility
type GetCfgReq ¶
type GetCfgReq struct { // 请求的配置文件代码 Code string `protobuf:"bytes,1,opt,name=Code,proto3" json:"Code,omitempty"` // contains filtered or unexported fields }
func (*GetCfgReq) Descriptor
deprecated
func (*GetCfgReq) ProtoMessage ¶
func (*GetCfgReq) ProtoMessage()
func (*GetCfgReq) ProtoReflect ¶
func (x *GetCfgReq) ProtoReflect() protoreflect.Message
type GetCfgRsp ¶
type GetCfgRsp struct { Code string `protobuf:"bytes,1,opt,name=Code,proto3" json:"Code,omitempty"` // 请求的配置文件值 Value string `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` // contains filtered or unexported fields }
func (*GetCfgRsp) Descriptor
deprecated
func (*GetCfgRsp) ProtoMessage ¶
func (*GetCfgRsp) ProtoMessage()
func (*GetCfgRsp) ProtoReflect ¶
func (x *GetCfgRsp) ProtoReflect() protoreflect.Message
type SetCfgReq ¶
type SetCfgReq struct { Code string `protobuf:"bytes,1,opt,name=Code,proto3" json:"Code,omitempty"` Value string `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` // contains filtered or unexported fields }
func (*SetCfgReq) Descriptor
deprecated
func (*SetCfgReq) ProtoMessage ¶
func (*SetCfgReq) ProtoMessage()
func (*SetCfgReq) ProtoReflect ¶
func (x *SetCfgReq) ProtoReflect() protoreflect.Message
type SetCfgRsp ¶
type SetCfgRsp struct {
// contains filtered or unexported fields
}
func (*SetCfgRsp) Descriptor
deprecated
func (*SetCfgRsp) ProtoMessage ¶
func (*SetCfgRsp) ProtoMessage()
func (*SetCfgRsp) ProtoReflect ¶
func (x *SetCfgRsp) ProtoReflect() protoreflect.Message
type UnimplementedConfigServiceServer ¶
type UnimplementedConfigServiceServer struct { }
UnimplementedConfigServiceServer must be embedded to have forward compatible implementations.
type UnsafeConfigServiceServer ¶
type UnsafeConfigServiceServer interface {
// contains filtered or unexported methods
}
UnsafeConfigServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ConfigServiceServer will result in compilation errors.