auth_service

package
v0.0.0-...-a2f44c0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package auth_service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AuthService_Login_FullMethodName         = "/auth_service.AuthService/Login"
	AuthService_ValidateToken_FullMethodName = "/auth_service.AuthService/ValidateToken"
	AuthService_SignUp_FullMethodName        = "/auth_service.AuthService/SignUp"
)

Variables

View Source
var AuthService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "auth_service.AuthService",
	HandlerType: (*AuthServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _AuthService_Login_Handler,
		},
		{
			MethodName: "ValidateToken",
			Handler:    _AuthService_ValidateToken_Handler,
		},
		{
			MethodName: "SignUp",
			Handler:    _AuthService_SignUp_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/auth-service/auth-service.proto",
}

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

View Source
var File_api_auth_service_auth_service_proto protoreflect.FileDescriptor

Functions

func RegisterAuthServiceHandler

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

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

func RegisterAuthServiceHandlerClient

func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error

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

func RegisterAuthServiceHandlerFromEndpoint

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

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

func RegisterAuthServiceHandlerServer

func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error

RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer 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 RegisterAuthServiceHandlerFromEndpoint instead.

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)

Types

type AuthServiceClient

type AuthServiceClient interface {
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
	ValidateToken(ctx context.Context, in *ValidateTokenRequest, opts ...grpc.CallOption) (*TokenClaims, error)
	SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error)
}

AuthServiceClient is the client API for AuthService 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 AuthServiceServer

type AuthServiceServer interface {
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
	ValidateToken(context.Context, *ValidateTokenRequest) (*TokenClaims, error)
	SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error)
	// contains filtered or unexported methods
}

AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility

type LoginRequest

type LoginRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginRequest) Descriptor deprecated

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

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetPassword

func (x *LoginRequest) GetPassword() string

func (*LoginRequest) GetUsername

func (x *LoginRequest) GetUsername() string

func (*LoginRequest) ProtoMessage

func (*LoginRequest) ProtoMessage()

func (*LoginRequest) ProtoReflect

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

func (*LoginRequest) Reset

func (x *LoginRequest) Reset()

func (*LoginRequest) String

func (x *LoginRequest) String() string

type LoginResponse

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

func (*LoginResponse) Descriptor deprecated

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

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetToken

func (x *LoginResponse) GetToken() string

func (*LoginResponse) ProtoMessage

func (*LoginResponse) ProtoMessage()

func (*LoginResponse) ProtoReflect

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

func (*LoginResponse) Reset

func (x *LoginResponse) Reset()

func (*LoginResponse) String

func (x *LoginResponse) String() string

type SignUpRequest

type SignUpRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// contains filtered or unexported fields
}

func (*SignUpRequest) Descriptor deprecated

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

Deprecated: Use SignUpRequest.ProtoReflect.Descriptor instead.

func (*SignUpRequest) GetClientId

func (x *SignUpRequest) GetClientId() string

func (*SignUpRequest) GetPassword

func (x *SignUpRequest) GetPassword() string

func (*SignUpRequest) GetUsername

func (x *SignUpRequest) GetUsername() string

func (*SignUpRequest) ProtoMessage

func (*SignUpRequest) ProtoMessage()

func (*SignUpRequest) ProtoReflect

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

func (*SignUpRequest) Reset

func (x *SignUpRequest) Reset()

func (*SignUpRequest) String

func (x *SignUpRequest) String() string

type SignUpResponse

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

func (*SignUpResponse) Descriptor deprecated

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

Deprecated: Use SignUpResponse.ProtoReflect.Descriptor instead.

func (*SignUpResponse) GetToken

func (x *SignUpResponse) GetToken() string

func (*SignUpResponse) ProtoMessage

func (*SignUpResponse) ProtoMessage()

func (*SignUpResponse) ProtoReflect

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

func (*SignUpResponse) Reset

func (x *SignUpResponse) Reset()

func (*SignUpResponse) String

func (x *SignUpResponse) String() string

type TokenClaims

type TokenClaims struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// contains filtered or unexported fields
}

func (*TokenClaims) Descriptor deprecated

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

Deprecated: Use TokenClaims.ProtoReflect.Descriptor instead.

func (*TokenClaims) GetClientId

func (x *TokenClaims) GetClientId() string

func (*TokenClaims) GetUsername

func (x *TokenClaims) GetUsername() string

func (*TokenClaims) ProtoMessage

func (*TokenClaims) ProtoMessage()

func (*TokenClaims) ProtoReflect

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

func (*TokenClaims) Reset

func (x *TokenClaims) Reset()

func (*TokenClaims) String

func (x *TokenClaims) String() string

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct {
}

UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServiceServer) Login

func (UnimplementedAuthServiceServer) SignUp

func (UnimplementedAuthServiceServer) ValidateToken

type UnsafeAuthServiceServer

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

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

type ValidateTokenRequest

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

func (*ValidateTokenRequest) Descriptor deprecated

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

Deprecated: Use ValidateTokenRequest.ProtoReflect.Descriptor instead.

func (*ValidateTokenRequest) GetToken

func (x *ValidateTokenRequest) GetToken() string

func (*ValidateTokenRequest) ProtoMessage

func (*ValidateTokenRequest) ProtoMessage()

func (*ValidateTokenRequest) ProtoReflect

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

func (*ValidateTokenRequest) Reset

func (x *ValidateTokenRequest) Reset()

func (*ValidateTokenRequest) String

func (x *ValidateTokenRequest) String() string

Jump to

Keyboard shortcuts

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