authV1

package
v0.0.0-...-34841a2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package authV1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AuthService_RegisterSendEmail_FullMethodName = "/auth.v1.AuthService/RegisterSendEmail"
	AuthService_RegisterWithEmail_FullMethodName = "/auth.v1.AuthService/RegisterWithEmail"
	AuthService_Login_FullMethodName             = "/auth.v1.AuthService/Login"
	AuthService_RefreshToken_FullMethodName      = "/auth.v1.AuthService/RefreshToken"
)

Variables

View Source
var AuthService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "auth.v1.AuthService",
	HandlerType: (*AuthServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterSendEmail",
			Handler:    _AuthService_RegisterSendEmail_Handler,
		},
		{
			MethodName: "RegisterWithEmail",
			Handler:    _AuthService_RegisterWithEmail_Handler,
		},
		{
			MethodName: "Login",
			Handler:    _AuthService_Login_Handler,
		},
		{
			MethodName: "RefreshToken",
			Handler:    _AuthService_RefreshToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "auth/v1/auth.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_auth_v1_auth_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. This client ignores the HTTP middlewares.

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. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)

Types

type AuthServiceClient

type AuthServiceClient interface {
	RegisterSendEmail(ctx context.Context, in *RegisterSendEmailRequest, opts ...grpc.CallOption) (*RegisterSendEmailResponse, error)
	RegisterWithEmail(ctx context.Context, in *RegisterWithEmailRequest, opts ...grpc.CallOption) (*RegisterWithEmailResponse, error)
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
	RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*RefreshTokenResponse, 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 {
	RegisterSendEmail(context.Context, *RegisterSendEmailRequest) (*RegisterSendEmailResponse, error)
	RegisterWithEmail(context.Context, *RegisterWithEmailRequest) (*RegisterWithEmailResponse, error)
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
	RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, 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 {
	Email    string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,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) GetEmail

func (x *LoginRequest) GetEmail() string

func (*LoginRequest) GetPassword

func (x *LoginRequest) GetPassword() 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 {
	AccessToken  string `protobuf:"bytes,1,opt,name=accessToken,proto3" json:"accessToken,omitempty"`
	RefreshToken string `protobuf:"bytes,2,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginResponse) Descriptor deprecated

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

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetAccessToken

func (x *LoginResponse) GetAccessToken() string

func (*LoginResponse) GetRefreshToken

func (x *LoginResponse) GetRefreshToken() 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 RefreshTokenRequest

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

func (*RefreshTokenRequest) Descriptor deprecated

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

Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead.

func (*RefreshTokenRequest) GetRefreshToken

func (x *RefreshTokenRequest) GetRefreshToken() string

func (*RefreshTokenRequest) ProtoMessage

func (*RefreshTokenRequest) ProtoMessage()

func (*RefreshTokenRequest) ProtoReflect

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

func (*RefreshTokenRequest) Reset

func (x *RefreshTokenRequest) Reset()

func (*RefreshTokenRequest) String

func (x *RefreshTokenRequest) String() string

type RefreshTokenResponse

type RefreshTokenResponse struct {
	AccessToken  string `protobuf:"bytes,1,opt,name=accessToken,proto3" json:"accessToken,omitempty"`
	RefreshToken string `protobuf:"bytes,2,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"`
	// contains filtered or unexported fields
}

func (*RefreshTokenResponse) Descriptor deprecated

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

Deprecated: Use RefreshTokenResponse.ProtoReflect.Descriptor instead.

func (*RefreshTokenResponse) GetAccessToken

func (x *RefreshTokenResponse) GetAccessToken() string

func (*RefreshTokenResponse) GetRefreshToken

func (x *RefreshTokenResponse) GetRefreshToken() string

func (*RefreshTokenResponse) ProtoMessage

func (*RefreshTokenResponse) ProtoMessage()

func (*RefreshTokenResponse) ProtoReflect

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

func (*RefreshTokenResponse) Reset

func (x *RefreshTokenResponse) Reset()

func (*RefreshTokenResponse) String

func (x *RefreshTokenResponse) String() string

type RegisterSendEmailRequest

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

func (*RegisterSendEmailRequest) Descriptor deprecated

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

Deprecated: Use RegisterSendEmailRequest.ProtoReflect.Descriptor instead.

func (*RegisterSendEmailRequest) GetEmail

func (x *RegisterSendEmailRequest) GetEmail() string

func (*RegisterSendEmailRequest) ProtoMessage

func (*RegisterSendEmailRequest) ProtoMessage()

func (*RegisterSendEmailRequest) ProtoReflect

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

func (*RegisterSendEmailRequest) Reset

func (x *RegisterSendEmailRequest) Reset()

func (*RegisterSendEmailRequest) String

func (x *RegisterSendEmailRequest) String() string

type RegisterSendEmailResponse

type RegisterSendEmailResponse struct {
	// contains filtered or unexported fields
}

func (*RegisterSendEmailResponse) Descriptor deprecated

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

Deprecated: Use RegisterSendEmailResponse.ProtoReflect.Descriptor instead.

func (*RegisterSendEmailResponse) ProtoMessage

func (*RegisterSendEmailResponse) ProtoMessage()

func (*RegisterSendEmailResponse) ProtoReflect

func (*RegisterSendEmailResponse) Reset

func (x *RegisterSendEmailResponse) Reset()

func (*RegisterSendEmailResponse) String

func (x *RegisterSendEmailResponse) String() string

type RegisterWithEmailRequest

type RegisterWithEmailRequest struct {
	Username   string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Email      string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	Password   string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	EmailToken string `protobuf:"bytes,4,opt,name=emailToken,proto3" json:"emailToken,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterWithEmailRequest) Descriptor deprecated

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

Deprecated: Use RegisterWithEmailRequest.ProtoReflect.Descriptor instead.

func (*RegisterWithEmailRequest) GetEmail

func (x *RegisterWithEmailRequest) GetEmail() string

func (*RegisterWithEmailRequest) GetEmailToken

func (x *RegisterWithEmailRequest) GetEmailToken() string

func (*RegisterWithEmailRequest) GetPassword

func (x *RegisterWithEmailRequest) GetPassword() string

func (*RegisterWithEmailRequest) GetUsername

func (x *RegisterWithEmailRequest) GetUsername() string

func (*RegisterWithEmailRequest) ProtoMessage

func (*RegisterWithEmailRequest) ProtoMessage()

func (*RegisterWithEmailRequest) ProtoReflect

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

func (*RegisterWithEmailRequest) Reset

func (x *RegisterWithEmailRequest) Reset()

func (*RegisterWithEmailRequest) String

func (x *RegisterWithEmailRequest) String() string

type RegisterWithEmailResponse

type RegisterWithEmailResponse struct {
	// contains filtered or unexported fields
}

func (*RegisterWithEmailResponse) Descriptor deprecated

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

Deprecated: Use RegisterWithEmailResponse.ProtoReflect.Descriptor instead.

func (*RegisterWithEmailResponse) ProtoMessage

func (*RegisterWithEmailResponse) ProtoMessage()

func (*RegisterWithEmailResponse) ProtoReflect

func (*RegisterWithEmailResponse) Reset

func (x *RegisterWithEmailResponse) Reset()

func (*RegisterWithEmailResponse) String

func (x *RegisterWithEmailResponse) String() string

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct{}

UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedAuthServiceServer) Login

func (UnimplementedAuthServiceServer) RefreshToken

func (UnimplementedAuthServiceServer) RegisterSendEmail

func (UnimplementedAuthServiceServer) RegisterWithEmail

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.

Jump to

Keyboard shortcuts

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