codes

package
v0.0.0-...-2610577 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package codes is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Code.ProtoReflect.Descriptor instead.

func (*Code) ProtoMessage

func (*Code) ProtoMessage()

func (*Code) ProtoReflect

func (x *Code) ProtoReflect() protoreflect.Message

func (*Code) Reset

func (x *Code) Reset()

func (*Code) String

func (x *Code) String() string

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.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL