gen

package
v0.0.0-...-4e6b079 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 18 Imported by: 1

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_common_proto protoreflect.FileDescriptor
View Source
var User_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go.taskapplication.proto.userapi.User",
	HandlerType: (*UserServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUserEmail",
			Handler:    _User_GetUserEmail_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "user.proto",
}

User_ServiceDesc is the grpc.ServiceDesc for User service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterUserHandler

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

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

func RegisterUserHandlerClient

func RegisterUserHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserClient) error

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

func RegisterUserHandlerFromEndpoint

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

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

func RegisterUserHandlerServer

func RegisterUserHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServer) error

RegisterUserHandlerServer registers the http handlers for service User to "mux". UnaryRPC :call UserServer 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 RegisterUserHandlerFromEndpoint instead.

func RegisterUserServer

func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)

Types

type GetUserEmailRequest

type GetUserEmailRequest struct {
	UserUuid string `protobuf:"bytes,1,opt,name=user_uuid,json=userUuid,proto3" json:"user_uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserEmailRequest) Descriptor deprecated

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

Deprecated: Use GetUserEmailRequest.ProtoReflect.Descriptor instead.

func (*GetUserEmailRequest) GetUserUuid

func (x *GetUserEmailRequest) GetUserUuid() string

func (*GetUserEmailRequest) ProtoMessage

func (*GetUserEmailRequest) ProtoMessage()

func (*GetUserEmailRequest) ProtoReflect

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

func (*GetUserEmailRequest) Reset

func (x *GetUserEmailRequest) Reset()

func (*GetUserEmailRequest) String

func (x *GetUserEmailRequest) String() string

type GetUserEmailResponse

type GetUserEmailResponse struct {
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserEmailResponse) Descriptor deprecated

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

Deprecated: Use GetUserEmailResponse.ProtoReflect.Descriptor instead.

func (*GetUserEmailResponse) GetEmail

func (x *GetUserEmailResponse) GetEmail() string

func (*GetUserEmailResponse) ProtoMessage

func (*GetUserEmailResponse) ProtoMessage()

func (*GetUserEmailResponse) ProtoReflect

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

func (*GetUserEmailResponse) Reset

func (x *GetUserEmailResponse) Reset()

func (*GetUserEmailResponse) String

func (x *GetUserEmailResponse) String() string

type UnimplementedUserServer

type UnimplementedUserServer struct {
}

UnimplementedUserServer should be embedded to have forward compatible implementations.

func (UnimplementedUserServer) GetUserEmail

type UnsafeUserServer

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

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

type UserClient

type UserClient interface {
	GetUserEmail(ctx context.Context, in *GetUserEmailRequest, opts ...grpc.CallOption) (*GetUserEmailResponse, error)
}

UserClient is the client API for User 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 NewUserClient

func NewUserClient(cc grpc.ClientConnInterface) UserClient

type UserServer

type UserServer interface {
	GetUserEmail(context.Context, *GetUserEmailRequest) (*GetUserEmailResponse, error)
}

UserServer is the server API for User service. All implementations should embed UnimplementedUserServer for forward compatibility

Jump to

Keyboard shortcuts

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