gen

package
v0.0.0-...-f8b36bf Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package gen is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_todo_service_todo_service_proto protoreflect.FileDescriptor

Functions

func RegisterCommandServiceHandler

func RegisterCommandServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCommandServiceHandler registers the http handlers for service CommandService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCommandServiceHandlerClient

func RegisterCommandServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CommandServiceClient) error

RegisterCommandServiceHandlerClient registers the http handlers for service CommandService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CommandServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CommandServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CommandServiceClient" to call the correct interceptors.

func RegisterCommandServiceHandlerFromEndpoint

func RegisterCommandServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCommandServiceHandlerFromEndpoint is same as RegisterCommandServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCommandServiceHandlerServer

func RegisterCommandServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CommandServiceServer) error

RegisterCommandServiceHandlerServer registers the http handlers for service CommandService to "mux". UnaryRPC :call CommandServiceServer 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 RegisterCommandServiceHandlerFromEndpoint instead.

func RegisterCommandServiceServer

func RegisterCommandServiceServer(s *grpc.Server, srv CommandServiceServer)

Types

type CommandServiceClient

type CommandServiceClient interface {
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*EntityID, error)
}

CommandServiceClient is the client API for CommandService 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 CommandServiceServer

type CommandServiceServer interface {
	Create(context.Context, *CreateRequest) (*EntityID, error)
	// contains filtered or unexported methods
}

CommandServiceServer is the server API for CommandService service. All implementations must embed UnimplementedCommandServiceServer for forward compatibility

type CreateRequest

type CreateRequest struct {
	Name    string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Details string                 `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"`
	Due     *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=due,proto3" json:"due,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) Descriptor deprecated

func (*CreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetDetails

func (x *CreateRequest) GetDetails() string

func (*CreateRequest) GetDue

func (x *CreateRequest) GetDue() *timestamppb.Timestamp

func (*CreateRequest) GetName

func (x *CreateRequest) GetName() string

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type EntityID

type EntityID struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*EntityID) Descriptor deprecated

func (*EntityID) Descriptor() ([]byte, []int)

Deprecated: Use EntityID.ProtoReflect.Descriptor instead.

func (*EntityID) GetId

func (x *EntityID) GetId() uint32

func (*EntityID) ProtoMessage

func (*EntityID) ProtoMessage()

func (*EntityID) ProtoReflect

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

func (*EntityID) Reset

func (x *EntityID) Reset()

func (*EntityID) String

func (x *EntityID) String() string

type UnimplementedCommandServiceServer

type UnimplementedCommandServiceServer struct {
}

UnimplementedCommandServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCommandServiceServer) Create

type UnsafeCommandServiceServer

type UnsafeCommandServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeCommandServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CommandServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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