Documentation ¶
Overview ¶
Package api is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterHishoBotHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHishoBotHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HishoBotClient) error
- func RegisterHishoBotHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHishoBotHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HishoBotServer) error
- func RegisterHishoBotServer(s *grpc.Server, srv HishoBotServer)
- type HishoBotClient
- type HishoBotServer
- type PingRequest
- type PingResponse
- func (*PingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PingResponse) GetCode() int64
- func (x *PingResponse) GetValue() string
- func (*PingResponse) ProtoMessage()
- func (x *PingResponse) ProtoReflect() protoreflect.Message
- func (x *PingResponse) Reset()
- func (x *PingResponse) String() string
- type UnimplementedHishoBotServer
Constants ¶
This section is empty.
Variables ¶
var File_hisho_bot_proto protoreflect.FileDescriptor
Functions ¶
func RegisterHishoBotHandler ¶
func RegisterHishoBotHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHishoBotHandler registers the http handlers for service HishoBot to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHishoBotHandlerClient ¶
func RegisterHishoBotHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HishoBotClient) error
RegisterHishoBotHandlerClient registers the http handlers for service HishoBot to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HishoBotClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HishoBotClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HishoBotClient" to call the correct interceptors.
func RegisterHishoBotHandlerFromEndpoint ¶
func RegisterHishoBotHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHishoBotHandlerFromEndpoint is same as RegisterHishoBotHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHishoBotHandlerServer ¶
func RegisterHishoBotHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HishoBotServer) error
RegisterHishoBotHandlerServer registers the http handlers for service HishoBot to "mux". UnaryRPC :call HishoBotServer 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 RegisterHishoBotHandlerFromEndpoint instead.
func RegisterHishoBotServer ¶
func RegisterHishoBotServer(s *grpc.Server, srv HishoBotServer)
Types ¶
type HishoBotClient ¶
type HishoBotClient interface {
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
}
HishoBotClient is the client API for HishoBot service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewHishoBotClient ¶
func NewHishoBotClient(cc grpc.ClientConnInterface) HishoBotClient
type HishoBotServer ¶
type HishoBotServer interface {
Ping(context.Context, *PingRequest) (*PingResponse, error)
}
HishoBotServer is the server API for HishoBot service.
type PingRequest ¶
type PingRequest struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*PingRequest) Descriptor
deprecated
func (*PingRequest) Descriptor() ([]byte, []int)
Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.
func (*PingRequest) GetValue ¶
func (x *PingRequest) GetValue() string
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) ProtoReflect ¶
func (x *PingRequest) ProtoReflect() protoreflect.Message
func (*PingRequest) Reset ¶
func (x *PingRequest) Reset()
func (*PingRequest) String ¶
func (x *PingRequest) String() string
type PingResponse ¶
type PingResponse struct { Code int64 `protobuf:"varint,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 (*PingResponse) Descriptor
deprecated
func (*PingResponse) Descriptor() ([]byte, []int)
Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.
func (*PingResponse) GetCode ¶
func (x *PingResponse) GetCode() int64
func (*PingResponse) GetValue ¶
func (x *PingResponse) GetValue() string
func (*PingResponse) ProtoMessage ¶
func (*PingResponse) ProtoMessage()
func (*PingResponse) ProtoReflect ¶
func (x *PingResponse) ProtoReflect() protoreflect.Message
func (*PingResponse) Reset ¶
func (x *PingResponse) Reset()
func (*PingResponse) String ¶
func (x *PingResponse) String() string
type UnimplementedHishoBotServer ¶
type UnimplementedHishoBotServer struct { }
UnimplementedHishoBotServer can be embedded to have forward compatible implementations.
func (*UnimplementedHishoBotServer) Ping ¶
func (*UnimplementedHishoBotServer) Ping(context.Context, *PingRequest) (*PingResponse, error)