Documentation ¶
Overview ¶
Package codes is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterCodesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCodesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CodesServiceClient) error
- func RegisterCodesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCodesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CodesServiceServer) error
- func RegisterCodesServiceServer(s *grpc.Server, srv CodesServiceServer)
- type Code
- type CodesServiceClient
- type CodesServiceServer
- type CreateCodeRequest
- func (*CreateCodeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateCodeRequest) GetEmail() string
- func (x *CreateCodeRequest) GetResponseType() string
- func (*CreateCodeRequest) ProtoMessage()
- func (x *CreateCodeRequest) ProtoReflect() protoreflect.Message
- func (x *CreateCodeRequest) Reset()
- func (x *CreateCodeRequest) String() string
- type UnimplementedCodesServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_codes_v1_codes_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCodesServiceHandler ¶
func RegisterCodesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCodesServiceHandler registers the http handlers for service CodesService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCodesServiceHandlerClient ¶
func RegisterCodesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CodesServiceClient) error
RegisterCodesServiceHandlerClient registers the http handlers for service CodesService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CodesServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CodesServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CodesServiceClient" to call the correct interceptors.
func RegisterCodesServiceHandlerFromEndpoint ¶
func RegisterCodesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCodesServiceHandlerFromEndpoint is same as RegisterCodesServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCodesServiceHandlerServer ¶
func RegisterCodesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CodesServiceServer) error
RegisterCodesServiceHandlerServer registers the http handlers for service CodesService to "mux". UnaryRPC :call CodesServiceServer 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 RegisterCodesServiceHandlerFromEndpoint instead.
func RegisterCodesServiceServer ¶
func RegisterCodesServiceServer(s *grpc.Server, srv CodesServiceServer)
Types ¶
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
func (*Code) Descriptor
deprecated
func (*Code) ProtoMessage ¶
func (*Code) ProtoMessage()
func (*Code) ProtoReflect ¶
func (x *Code) ProtoReflect() protoreflect.Message
type CodesServiceClient ¶
type CodesServiceClient interface { // Create authorization code. // // Returns an authorization code. CreateCode(ctx context.Context, in *CreateCodeRequest, opts ...grpc.CallOption) (*Code, error) }
CodesServiceClient is the client API for CodesService 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 NewCodesServiceClient ¶
func NewCodesServiceClient(cc grpc.ClientConnInterface) CodesServiceClient
type CodesServiceServer ¶
type CodesServiceServer interface { // Create authorization code. // // Returns an authorization code. CreateCode(context.Context, *CreateCodeRequest) (*Code, error) }
CodesServiceServer is the server API for CodesService service.
type CreateCodeRequest ¶
type CreateCodeRequest struct { // Email address. Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` // Response type. ResponseType string `protobuf:"bytes,2,opt,name=response_type,json=responseType,proto3" json:"response_type,omitempty"` // contains filtered or unexported fields }
func (*CreateCodeRequest) Descriptor
deprecated
func (*CreateCodeRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateCodeRequest.ProtoReflect.Descriptor instead.
func (*CreateCodeRequest) GetEmail ¶
func (x *CreateCodeRequest) GetEmail() string
func (*CreateCodeRequest) GetResponseType ¶
func (x *CreateCodeRequest) GetResponseType() string
func (*CreateCodeRequest) ProtoMessage ¶
func (*CreateCodeRequest) ProtoMessage()
func (*CreateCodeRequest) ProtoReflect ¶
func (x *CreateCodeRequest) ProtoReflect() protoreflect.Message
func (*CreateCodeRequest) Reset ¶
func (x *CreateCodeRequest) Reset()
func (*CreateCodeRequest) String ¶
func (x *CreateCodeRequest) String() string
type UnimplementedCodesServiceServer ¶
type UnimplementedCodesServiceServer struct { }
UnimplementedCodesServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedCodesServiceServer) CreateCode ¶
func (*UnimplementedCodesServiceServer) CreateCode(context.Context, *CreateCodeRequest) (*Code, error)