Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSnippetsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSnippetsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SnippetsClient) error
- func RegisterSnippetsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSnippetsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SnippetsServer) error
- func RegisterSnippetsServer(s *grpc.Server, srv SnippetsServer)
- type GetReq
- type GetResp
- type SaveReq
- type SaveResp
- type SnippetsClient
- type SnippetsServer
- type UnimplementedSnippetsServer
Constants ¶
This section is empty.
Variables ¶
var File_snippets_proto protoreflect.FileDescriptor
Functions ¶
func RegisterSnippetsHandler ¶
func RegisterSnippetsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSnippetsHandler registers the http handlers for service Snippets to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSnippetsHandlerClient ¶
func RegisterSnippetsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SnippetsClient) error
RegisterSnippetsHandlerClient registers the http handlers for service Snippets to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SnippetsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SnippetsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SnippetsClient" to call the correct interceptors.
func RegisterSnippetsHandlerFromEndpoint ¶
func RegisterSnippetsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSnippetsHandlerFromEndpoint is same as RegisterSnippetsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSnippetsHandlerServer ¶
func RegisterSnippetsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SnippetsServer) error
RegisterSnippetsHandlerServer registers the http handlers for service Snippets to "mux". UnaryRPC :call SnippetsServer 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 RegisterSnippetsHandlerFromEndpoint instead.
func RegisterSnippetsServer ¶
func RegisterSnippetsServer(s *grpc.Server, srv SnippetsServer)
Types ¶
type GetReq ¶
type GetReq struct { UnixNano int64 `protobuf:"varint,1,opt,name=unixNano,proto3" json:"unixNano,omitempty"` // contains filtered or unexported fields }
func (*GetReq) Descriptor
deprecated
func (*GetReq) GetUnixNano ¶
func (*GetReq) ProtoMessage ¶
func (*GetReq) ProtoMessage()
func (*GetReq) ProtoReflect ¶
func (x *GetReq) ProtoReflect() protoreflect.Message
type GetResp ¶
type GetResp struct { UnixNano int64 `protobuf:"varint,1,opt,name=unixNano,proto3" json:"unixNano,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*GetResp) Descriptor
deprecated
func (*GetResp) GetContent ¶
func (*GetResp) GetUnixNano ¶
func (*GetResp) ProtoMessage ¶
func (*GetResp) ProtoMessage()
func (*GetResp) ProtoReflect ¶
func (x *GetResp) ProtoReflect() protoreflect.Message
type SaveReq ¶
type SaveReq struct { UnixNano int64 `protobuf:"varint,1,opt,name=unixNano,proto3" json:"unixNano,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*SaveReq) Descriptor
deprecated
func (*SaveReq) GetContent ¶
func (*SaveReq) GetUnixNano ¶
func (*SaveReq) ProtoMessage ¶
func (*SaveReq) ProtoMessage()
func (*SaveReq) ProtoReflect ¶
func (x *SaveReq) ProtoReflect() protoreflect.Message
type SaveResp ¶
type SaveResp struct {
// contains filtered or unexported fields
}
func (*SaveResp) Descriptor
deprecated
func (*SaveResp) ProtoMessage ¶
func (*SaveResp) ProtoMessage()
func (*SaveResp) ProtoReflect ¶
func (x *SaveResp) ProtoReflect() protoreflect.Message
type SnippetsClient ¶
type SnippetsClient interface { Save(ctx context.Context, in *SaveReq, opts ...grpc.CallOption) (*SaveResp, error) Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*GetResp, error) }
SnippetsClient is the client API for Snippets service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSnippetsClient ¶
func NewSnippetsClient(cc grpc.ClientConnInterface) SnippetsClient
type SnippetsServer ¶
type SnippetsServer interface { Save(context.Context, *SaveReq) (*SaveResp, error) Get(context.Context, *GetReq) (*GetResp, error) }
SnippetsServer is the server API for Snippets service.
type UnimplementedSnippetsServer ¶
type UnimplementedSnippetsServer struct { }
UnimplementedSnippetsServer can be embedded to have forward compatible implementations.