Documentation
¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterTagServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTagServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TagServiceClient) error
- func RegisterTagServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTagServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TagServiceServer) error
- func RegisterTagServiceServer(s *grpc.Server, srv TagServiceServer)
- type Error
- type GetTagListRequest
- func (*GetTagListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetTagListRequest) GetName() string
- func (x *GetTagListRequest) GetState() uint32
- func (*GetTagListRequest) ProtoMessage()
- func (x *GetTagListRequest) ProtoReflect() protoreflect.Message
- func (x *GetTagListRequest) Reset()
- func (x *GetTagListRequest) String() string
- type GetTagListResponse
- func (*GetTagListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetTagListResponse) GetList() []*Tag
- func (x *GetTagListResponse) GetPager() *Pager
- func (*GetTagListResponse) ProtoMessage()
- func (x *GetTagListResponse) ProtoReflect() protoreflect.Message
- func (x *GetTagListResponse) Reset()
- func (x *GetTagListResponse) String() string
- type Pager
- type Tag
- type TagServiceClient
- type TagServiceServer
- type UnimplementedTagServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_common_proto protoreflect.FileDescriptor
var File_tag_proto protoreflect.FileDescriptor
Functions ¶
func RegisterTagServiceHandler ¶
func RegisterTagServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTagServiceHandler registers the http handlers for service TagService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTagServiceHandlerClient ¶
func RegisterTagServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TagServiceClient) error
RegisterTagServiceHandlerClient registers the http handlers for service TagService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TagServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TagServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TagServiceClient" to call the correct interceptors.
func RegisterTagServiceHandlerFromEndpoint ¶
func RegisterTagServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTagServiceHandlerFromEndpoint is same as RegisterTagServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTagServiceHandlerServer ¶
func RegisterTagServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TagServiceServer) error
RegisterTagServiceHandlerServer registers the http handlers for service TagService to "mux". UnaryRPC :call TagServiceServer 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 RegisterTagServiceHandlerFromEndpoint instead.
func RegisterTagServiceServer ¶
func RegisterTagServiceServer(s *grpc.Server, srv TagServiceServer)
Types ¶
type Error ¶
type Error 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"` // 错误消息 Detail *anypb.Any `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"` // 错误详细信息 // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type GetTagListRequest ¶
type GetTagListRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` State uint32 `protobuf:"varint,2,opt,name=state,proto3" json:"state,omitempty"` // contains filtered or unexported fields }
func (*GetTagListRequest) Descriptor
deprecated
func (*GetTagListRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetTagListRequest.ProtoReflect.Descriptor instead.
func (*GetTagListRequest) GetName ¶
func (x *GetTagListRequest) GetName() string
func (*GetTagListRequest) GetState ¶
func (x *GetTagListRequest) GetState() uint32
func (*GetTagListRequest) ProtoMessage ¶
func (*GetTagListRequest) ProtoMessage()
func (*GetTagListRequest) ProtoReflect ¶
func (x *GetTagListRequest) ProtoReflect() protoreflect.Message
func (*GetTagListRequest) Reset ¶
func (x *GetTagListRequest) Reset()
func (*GetTagListRequest) String ¶
func (x *GetTagListRequest) String() string
type GetTagListResponse ¶
type GetTagListResponse struct { List []*Tag `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Pager *Pager `protobuf:"bytes,2,opt,name=pager,proto3" json:"pager,omitempty"` // contains filtered or unexported fields }
func (*GetTagListResponse) Descriptor
deprecated
func (*GetTagListResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetTagListResponse.ProtoReflect.Descriptor instead.
func (*GetTagListResponse) GetList ¶
func (x *GetTagListResponse) GetList() []*Tag
func (*GetTagListResponse) GetPager ¶
func (x *GetTagListResponse) GetPager() *Pager
func (*GetTagListResponse) ProtoMessage ¶
func (*GetTagListResponse) ProtoMessage()
func (*GetTagListResponse) ProtoReflect ¶
func (x *GetTagListResponse) ProtoReflect() protoreflect.Message
func (*GetTagListResponse) Reset ¶
func (x *GetTagListResponse) Reset()
func (*GetTagListResponse) String ¶
func (x *GetTagListResponse) String() string
type Pager ¶
type Pager struct { Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` TotalRows int64 `protobuf:"varint,3,opt,name=total_rows,json=totalRows,proto3" json:"total_rows,omitempty"` // contains filtered or unexported fields }
func (*Pager) Descriptor
deprecated
func (*Pager) GetPageSize ¶
func (*Pager) GetTotalRows ¶
func (*Pager) ProtoMessage ¶
func (*Pager) ProtoMessage()
func (*Pager) ProtoReflect ¶
func (x *Pager) ProtoReflect() protoreflect.Message
type Tag ¶
type Tag struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` State uint32 `protobuf:"varint,3,opt,name=state,proto3" json:"state,omitempty"` // contains filtered or unexported fields }
func (*Tag) Descriptor
deprecated
func (*Tag) ProtoMessage ¶
func (*Tag) ProtoMessage()
func (*Tag) ProtoReflect ¶
func (x *Tag) ProtoReflect() protoreflect.Message
type TagServiceClient ¶
type TagServiceClient interface {
GetTagList(ctx context.Context, in *GetTagListRequest, opts ...grpc.CallOption) (*GetTagListResponse, error)
}
TagServiceClient is the client API for TagService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewTagServiceClient ¶
func NewTagServiceClient(cc grpc.ClientConnInterface) TagServiceClient
type TagServiceServer ¶
type TagServiceServer interface {
GetTagList(context.Context, *GetTagListRequest) (*GetTagListResponse, error)
}
TagServiceServer is the server API for TagService service.
type UnimplementedTagServiceServer ¶
type UnimplementedTagServiceServer struct { }
UnimplementedTagServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedTagServiceServer) GetTagList ¶
func (*UnimplementedTagServiceServer) GetTagList(context.Context, *GetTagListRequest) (*GetTagListResponse, error)