user_gw

package
v0.0.0-...-031707f Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MulanPSL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package user_gw is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_user_user_gw_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "LoginServer",
			Handler:    _UserService_LoginServer_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "user/user_gw.proto",
}

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

Functions

func RegisterUserServiceHandler

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

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

func RegisterUserServiceHandlerClient

func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error

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

func RegisterUserServiceHandlerFromEndpoint

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

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

func RegisterUserServiceHandlerServer

func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error

RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". UnaryRPC :call UserServiceServer 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 RegisterUserServiceHandlerFromEndpoint instead.

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

Types

type LoginInput

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

func (*LoginInput) Descriptor deprecated

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

Deprecated: Use LoginInput.ProtoReflect.Descriptor instead.

func (*LoginInput) GetCode

func (x *LoginInput) GetCode() string

func (*LoginInput) ProtoMessage

func (*LoginInput) ProtoMessage()

func (*LoginInput) ProtoReflect

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

func (*LoginInput) Reset

func (x *LoginInput) Reset()

func (*LoginInput) String

func (x *LoginInput) String() string

type LoginOutPut

type LoginOutPut struct {
	AccessToken string `protobuf:"bytes,1,opt,name=AccessToken,proto3" json:"AccessToken,omitempty"`
	ExpiresIn   int32  `protobuf:"varint,2,opt,name=ExpiresIn,proto3" json:"ExpiresIn,omitempty"`
	TokenType   string `protobuf:"bytes,3,opt,name=TokenType,proto3" json:"TokenType,omitempty"`
	Scope       string `protobuf:"bytes,4,opt,name=Scope,proto3" json:"Scope,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginOutPut) Descriptor deprecated

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

Deprecated: Use LoginOutPut.ProtoReflect.Descriptor instead.

func (*LoginOutPut) GetAccessToken

func (x *LoginOutPut) GetAccessToken() string

func (*LoginOutPut) GetExpiresIn

func (x *LoginOutPut) GetExpiresIn() int32

func (*LoginOutPut) GetScope

func (x *LoginOutPut) GetScope() string

func (*LoginOutPut) GetTokenType

func (x *LoginOutPut) GetTokenType() string

func (*LoginOutPut) ProtoMessage

func (*LoginOutPut) ProtoMessage()

func (*LoginOutPut) ProtoReflect

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

func (*LoginOutPut) Reset

func (x *LoginOutPut) Reset()

func (*LoginOutPut) String

func (x *LoginOutPut) String() string

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) LoginServer

type UnsafeUserServiceServer

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

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

type UserServiceClient

type UserServiceClient interface {
	LoginServer(ctx context.Context, in *LoginInput, opts ...grpc.CallOption) (*LoginOutPut, error)
}

UserServiceClient is the client API for UserService 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 UserServiceServer

type UserServiceServer interface {
	LoginServer(context.Context, *LoginInput) (*LoginOutPut, error)
	// contains filtered or unexported methods
}

UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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