clientv1

package
v0.0.0-...-f0a7105 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthenticationService_Login_FullMethodName  = "/client.v1.AuthenticationService/Login"
	AuthenticationService_Logout_FullMethodName = "/client.v1.AuthenticationService/Logout"
	AuthenticationService_GetMe_FullMethodName  = "/client.v1.AuthenticationService/GetMe"
)
View Source
const OperationAuthenticationServiceGetMe = "/client.v1.AuthenticationService/GetMe"
View Source
const OperationAuthenticationServiceLogin = "/client.v1.AuthenticationService/Login"
View Source
const OperationAuthenticationServiceLogout = "/client.v1.AuthenticationService/Logout"

Variables

View Source
var (
	GrantType_name = map[int32]string{
		0: "password",
		1: "client_credentials",
		2: "refresh_token",
	}
	GrantType_value = map[string]int32{
		"password":           0,
		"client_credentials": 1,
		"refresh_token":      2,
	}
)

Enum value maps for GrantType.

View Source
var (
	TokenType_name = map[int32]string{
		0: "bearer",
		1: "mac",
	}
	TokenType_value = map[string]int32{
		"bearer": 0,
		"mac":    1,
	}
)

Enum value maps for TokenType.

View Source
var (
	ClientErrorReason_name = map[int32]string{
		0:  "BAD_REQUEST",
		1:  "NOT_LOGGED_IN",
		2:  "ACCESS_FORBIDDEN",
		3:  "RESOURCE_NOT_FOUND",
		4:  "METHOD_NOT_ALLOWED",
		5:  "REQUEST_TIMEOUT",
		10: "INTERNAL_SERVER_ERROR",
		11: "NOT_IMPLEMENTED",
		12: "NETWORK_ERROR",
		13: "SERVICE_UNAVAILABLE",
		14: "NETWORK_TIMEOUT",
		15: "REQUEST_NOT_SUPPORT",
		20: "INVALID_USERID",
		21: "INVALID_PASSWORD",
		22: "TOKEN_EXPIRED",
		23: "INVALID_TOKEN",
		24: "TOKEN_NOT_EXIST",
		25: "USER_NOT_EXIST",
		26: "USER_FREEZE",
	}
	ClientErrorReason_value = map[string]int32{
		"BAD_REQUEST":           0,
		"NOT_LOGGED_IN":         1,
		"ACCESS_FORBIDDEN":      2,
		"RESOURCE_NOT_FOUND":    3,
		"METHOD_NOT_ALLOWED":    4,
		"REQUEST_TIMEOUT":       5,
		"INTERNAL_SERVER_ERROR": 10,
		"NOT_IMPLEMENTED":       11,
		"NETWORK_ERROR":         12,
		"SERVICE_UNAVAILABLE":   13,
		"NETWORK_TIMEOUT":       14,
		"REQUEST_NOT_SUPPORT":   15,
		"INVALID_USERID":        20,
		"INVALID_PASSWORD":      21,
		"TOKEN_EXPIRED":         22,
		"INVALID_TOKEN":         23,
		"TOKEN_NOT_EXIST":       24,
		"USER_NOT_EXIST":        25,
		"USER_FREEZE":           26,
	}
)

Enum value maps for ClientErrorReason.

View Source
var AuthenticationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "client.v1.AuthenticationService",
	HandlerType: (*AuthenticationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _AuthenticationService_Login_Handler,
		},
		{
			MethodName: "Logout",
			Handler:    _AuthenticationService_Logout_Handler,
		},
		{
			MethodName: "GetMe",
			Handler:    _AuthenticationService_GetMe_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "client/v1/authentication.proto",
}

AuthenticationService_ServiceDesc is the grpc.ServiceDesc for AuthenticationService 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_client_v1_authentication_proto protoreflect.FileDescriptor
View Source
var File_client_v1_error_proto protoreflect.FileDescriptor

Functions

func ErrorAccessForbidden

func ErrorAccessForbidden(format string, args ...interface{}) *errors.Error

403

func ErrorBadRequest

func ErrorBadRequest(format string, args ...interface{}) *errors.Error

400

func ErrorInternalServerError

func ErrorInternalServerError(format string, args ...interface{}) *errors.Error

500

func ErrorInvalidPassword

func ErrorInvalidPassword(format string, args ...interface{}) *errors.Error

密码无效

func ErrorInvalidToken

func ErrorInvalidToken(format string, args ...interface{}) *errors.Error

token无效

func ErrorInvalidUserid

func ErrorInvalidUserid(format string, args ...interface{}) *errors.Error

用户ID无效

func ErrorMethodNotAllowed

func ErrorMethodNotAllowed(format string, args ...interface{}) *errors.Error

405

func ErrorNetworkError

func ErrorNetworkError(format string, args ...interface{}) *errors.Error

502

func ErrorNetworkTimeout

func ErrorNetworkTimeout(format string, args ...interface{}) *errors.Error

504

func ErrorNotImplemented

func ErrorNotImplemented(format string, args ...interface{}) *errors.Error

501

func ErrorNotLoggedIn

func ErrorNotLoggedIn(format string, args ...interface{}) *errors.Error

401

func ErrorRequestNotSupport

func ErrorRequestNotSupport(format string, args ...interface{}) *errors.Error

505

func ErrorRequestTimeout

func ErrorRequestTimeout(format string, args ...interface{}) *errors.Error

408

func ErrorResourceNotFound

func ErrorResourceNotFound(format string, args ...interface{}) *errors.Error

404

func ErrorServiceUnavailable

func ErrorServiceUnavailable(format string, args ...interface{}) *errors.Error

503

func ErrorTokenExpired

func ErrorTokenExpired(format string, args ...interface{}) *errors.Error

token过期

func ErrorTokenNotExist

func ErrorTokenNotExist(format string, args ...interface{}) *errors.Error

token不存在

func ErrorUserFreeze

func ErrorUserFreeze(format string, args ...interface{}) *errors.Error

账号冻结

func ErrorUserNotExist

func ErrorUserNotExist(format string, args ...interface{}) *errors.Error

用户不存在

func IsAccessForbidden

func IsAccessForbidden(err error) bool

403

func IsBadRequest

func IsBadRequest(err error) bool

400

func IsInternalServerError

func IsInternalServerError(err error) bool

500

func IsInvalidPassword

func IsInvalidPassword(err error) bool

密码无效

func IsInvalidToken

func IsInvalidToken(err error) bool

token无效

func IsInvalidUserid

func IsInvalidUserid(err error) bool

用户ID无效

func IsMethodNotAllowed

func IsMethodNotAllowed(err error) bool

405

func IsNetworkError

func IsNetworkError(err error) bool

502

func IsNetworkTimeout

func IsNetworkTimeout(err error) bool

504

func IsNotImplemented

func IsNotImplemented(err error) bool

501

func IsNotLoggedIn

func IsNotLoggedIn(err error) bool

401

func IsRequestNotSupport

func IsRequestNotSupport(err error) bool

505

func IsRequestTimeout

func IsRequestTimeout(err error) bool

408

func IsResourceNotFound

func IsResourceNotFound(err error) bool

404

func IsServiceUnavailable

func IsServiceUnavailable(err error) bool

503

func IsTokenExpired

func IsTokenExpired(err error) bool

token过期

func IsTokenNotExist

func IsTokenNotExist(err error) bool

token不存在

func IsUserFreeze

func IsUserFreeze(err error) bool

账号冻结

func IsUserNotExist

func IsUserNotExist(err error) bool

用户不存在

func RegisterAuthenticationServiceHTTPServer

func RegisterAuthenticationServiceHTTPServer(s *http.Server, srv AuthenticationServiceHTTPServer)

func RegisterAuthenticationServiceServer

func RegisterAuthenticationServiceServer(s grpc.ServiceRegistrar, srv AuthenticationServiceServer)

Types

type AuthenticationServiceClient

type AuthenticationServiceClient interface {
	// APP Login
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
	// APP Logout
	Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// APP Get the data of logged in user
	GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*v1.User, error)
}

AuthenticationServiceClient is the client API for AuthenticationService 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.

The authentication service definition for user APP.

type AuthenticationServiceHTTPClient

type AuthenticationServiceHTTPClient interface {
	GetMe(ctx context.Context, req *GetMeRequest, opts ...http.CallOption) (rsp *v1.User, err error)
	Login(ctx context.Context, req *LoginRequest, opts ...http.CallOption) (rsp *LoginResponse, err error)
	Logout(ctx context.Context, req *LogoutRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
}

func NewAuthenticationServiceHTTPClient

func NewAuthenticationServiceHTTPClient(client *http.Client) AuthenticationServiceHTTPClient

type AuthenticationServiceHTTPClientImpl

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

func (*AuthenticationServiceHTTPClientImpl) GetMe

func (*AuthenticationServiceHTTPClientImpl) Login

func (*AuthenticationServiceHTTPClientImpl) Logout

type AuthenticationServiceHTTPServer

type AuthenticationServiceHTTPServer interface {
	// GetMe APP Get the data of logged in user
	GetMe(context.Context, *GetMeRequest) (*v1.User, error)
	// Login APP Login
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
	// Logout APP Logout
	Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error)
}

type AuthenticationServiceServer

type AuthenticationServiceServer interface {
	// APP Login
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
	// APP Logout
	Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error)
	// APP Get the data of logged in user
	GetMe(context.Context, *GetMeRequest) (*v1.User, error)
	// contains filtered or unexported methods
}

AuthenticationServiceServer is the server API for AuthenticationService service. All implementations must embed UnimplementedAuthenticationServiceServer for forward compatibility

The authentication service definition for user APP.

type ClientErrorReason

type ClientErrorReason int32
const (
	ClientErrorReason_BAD_REQUEST           ClientErrorReason = 0  // 400
	ClientErrorReason_NOT_LOGGED_IN         ClientErrorReason = 1  // 401
	ClientErrorReason_ACCESS_FORBIDDEN      ClientErrorReason = 2  // 403
	ClientErrorReason_RESOURCE_NOT_FOUND    ClientErrorReason = 3  // 404
	ClientErrorReason_METHOD_NOT_ALLOWED    ClientErrorReason = 4  // 405
	ClientErrorReason_REQUEST_TIMEOUT       ClientErrorReason = 5  // 408
	ClientErrorReason_INTERNAL_SERVER_ERROR ClientErrorReason = 10 // 500
	ClientErrorReason_NOT_IMPLEMENTED       ClientErrorReason = 11 // 501
	ClientErrorReason_NETWORK_ERROR         ClientErrorReason = 12 // 502
	ClientErrorReason_SERVICE_UNAVAILABLE   ClientErrorReason = 13 // 503
	ClientErrorReason_NETWORK_TIMEOUT       ClientErrorReason = 14 // 504
	ClientErrorReason_REQUEST_NOT_SUPPORT   ClientErrorReason = 15 // 505
	ClientErrorReason_INVALID_USERID        ClientErrorReason = 20 // 用户ID无效
	ClientErrorReason_INVALID_PASSWORD      ClientErrorReason = 21 // 密码无效
	ClientErrorReason_TOKEN_EXPIRED         ClientErrorReason = 22 // token过期
	ClientErrorReason_INVALID_TOKEN         ClientErrorReason = 23 // token无效
	ClientErrorReason_TOKEN_NOT_EXIST       ClientErrorReason = 24 // token不存在
	ClientErrorReason_USER_NOT_EXIST        ClientErrorReason = 25 // 用户不存在
	ClientErrorReason_USER_FREEZE           ClientErrorReason = 26 // 账号冻结
)

func (ClientErrorReason) Descriptor

func (ClientErrorReason) Enum

func (ClientErrorReason) EnumDescriptor deprecated

func (ClientErrorReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use ClientErrorReason.Descriptor instead.

func (ClientErrorReason) Number

func (ClientErrorReason) String

func (x ClientErrorReason) String() string

func (ClientErrorReason) Type

type GetMeRequest

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

Get current user information - request

func (*GetMeRequest) Descriptor deprecated

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

Deprecated: Use GetMeRequest.ProtoReflect.Descriptor instead.

func (*GetMeRequest) GetId

func (x *GetMeRequest) GetId() uint32

func (*GetMeRequest) ProtoMessage

func (*GetMeRequest) ProtoMessage()

func (*GetMeRequest) ProtoReflect

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

func (*GetMeRequest) Reset

func (x *GetMeRequest) Reset()

func (*GetMeRequest) String

func (x *GetMeRequest) String() string

func (*GetMeRequest) Validate

func (m *GetMeRequest) Validate() error

Validate checks the field values on GetMeRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetMeRequest) ValidateAll

func (m *GetMeRequest) ValidateAll() error

ValidateAll checks the field values on GetMeRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetMeRequestMultiError, or nil if none found.

type GetMeRequestMultiError

type GetMeRequestMultiError []error

GetMeRequestMultiError is an error wrapping multiple validation errors returned by GetMeRequest.ValidateAll() if the designated constraints aren't met.

func (GetMeRequestMultiError) AllErrors

func (m GetMeRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetMeRequestMultiError) Error

func (m GetMeRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetMeRequestValidationError

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

GetMeRequestValidationError is the validation error returned by GetMeRequest.Validate if the designated constraints aren't met.

func (GetMeRequestValidationError) Cause

Cause function returns cause value.

func (GetMeRequestValidationError) Error

Error satisfies the builtin error interface

func (GetMeRequestValidationError) ErrorName

func (e GetMeRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetMeRequestValidationError) Field

Field function returns field value.

func (GetMeRequestValidationError) Key

Key function returns key value.

func (GetMeRequestValidationError) Reason

Reason function returns reason value.

type GrantType

type GrantType int32

Authorization type

const (
	GrantType_password           GrantType = 0 // Password Mode (Resource Owner Password Credentials Grant)
	GrantType_client_credentials GrantType = 1 // Client Credentials Grant
	GrantType_refresh_token      GrantType = 2 // Refresh Token
)

func (GrantType) Descriptor

func (GrantType) Descriptor() protoreflect.EnumDescriptor

func (GrantType) Enum

func (x GrantType) Enum() *GrantType

func (GrantType) EnumDescriptor deprecated

func (GrantType) EnumDescriptor() ([]byte, []int)

Deprecated: Use GrantType.Descriptor instead.

func (GrantType) Number

func (x GrantType) Number() protoreflect.EnumNumber

func (GrantType) String

func (x GrantType) String() string

func (GrantType) Type

type LoginRequest

type LoginRequest struct {
	UserName     string  `protobuf:"bytes,1,opt,name=user_name,proto3" json:"user_name,omitempty"`   // Username, required.
	Password     string  `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`     // User's password, required.
	GrantType    string  `protobuf:"bytes,3,opt,name=grant_type,proto3" json:"grant_type,omitempty"` // Authorization type, the value here is fixed to "password", required.
	Scope        *string `protobuf:"bytes,4,opt,name=scope,proto3,oneof" json:"scope,omitempty"`     // A space-separated list of ranges. If not provided, scope authorizes any scope, defaulting to an empty list.
	ClientId     *string `protobuf:"bytes,5,opt,name=client_id,proto3,oneof" json:"client_id,omitempty"`
	ClientSecret *string `protobuf:"bytes,6,opt,name=client_secret,proto3,oneof" json:"client_secret,omitempty"`
	// contains filtered or unexported fields
}

User background login - request

func (*LoginRequest) Descriptor deprecated

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

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetClientId

func (x *LoginRequest) GetClientId() string

func (*LoginRequest) GetClientSecret

func (x *LoginRequest) GetClientSecret() string

func (*LoginRequest) GetGrantType

func (x *LoginRequest) GetGrantType() string

func (*LoginRequest) GetPassword

func (x *LoginRequest) GetPassword() string

func (*LoginRequest) GetScope

func (x *LoginRequest) GetScope() 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

func (*LoginRequest) Validate

func (m *LoginRequest) Validate() error

Validate checks the field values on LoginRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*LoginRequest) ValidateAll

func (m *LoginRequest) ValidateAll() error

ValidateAll checks the field values on LoginRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LoginRequestMultiError, or nil if none found.

type LoginRequestMultiError

type LoginRequestMultiError []error

LoginRequestMultiError is an error wrapping multiple validation errors returned by LoginRequest.ValidateAll() if the designated constraints aren't met.

func (LoginRequestMultiError) AllErrors

func (m LoginRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LoginRequestMultiError) Error

func (m LoginRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type LoginRequestValidationError

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

LoginRequestValidationError is the validation error returned by LoginRequest.Validate if the designated constraints aren't met.

func (LoginRequestValidationError) Cause

Cause function returns cause value.

func (LoginRequestValidationError) Error

Error satisfies the builtin error interface

func (LoginRequestValidationError) ErrorName

func (e LoginRequestValidationError) ErrorName() string

ErrorName returns error name.

func (LoginRequestValidationError) Field

Field function returns field value.

func (LoginRequestValidationError) Key

Key function returns key value.

func (LoginRequestValidationError) Reason

Reason function returns reason value.

type LoginResponse

type LoginResponse struct {
	AccessToken  string  `protobuf:"bytes,1,opt,name=access_token,proto3" json:"access_token,omitempty"`    // Access token, required.
	RefreshToken string  `protobuf:"bytes,2,opt,name=refresh_token,proto3" json:"refresh_token,omitempty"`  // Refresh token, used to obtain the next access token, optional.
	TokenType    string  `protobuf:"bytes,3,opt,name=token_type,proto3" json:"token_type,omitempty"`        // Token type, this value is case-insensitive, required, and can be bearer type or mac type.
	ExpiresIn    *int64  `protobuf:"varint,4,opt,name=expires_in,proto3,oneof" json:"expires_in,omitempty"` // Token validity time, unit is seconds. If the access token expires, the server should reply with the duration of the access token granted. If this parameter is omitted, the expiration time must be set in other ways.
	Scope        *string `protobuf:"bytes,5,opt,name=scope,proto3,oneof" json:"scope,omitempty"`            // A space-separated list of user grant scopes. If not provided, scope authorizes any scope, defaulting to an empty list.
	// contains filtered or unexported fields
}

User background login - response

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) GetExpiresIn

func (x *LoginResponse) GetExpiresIn() int64

func (*LoginResponse) GetRefreshToken

func (x *LoginResponse) GetRefreshToken() string

func (*LoginResponse) GetScope

func (x *LoginResponse) GetScope() string

func (*LoginResponse) GetTokenType

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

func (*LoginResponse) Validate

func (m *LoginResponse) Validate() error

Validate checks the field values on LoginResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*LoginResponse) ValidateAll

func (m *LoginResponse) ValidateAll() error

ValidateAll checks the field values on LoginResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LoginResponseMultiError, or nil if none found.

type LoginResponseMultiError

type LoginResponseMultiError []error

LoginResponseMultiError is an error wrapping multiple validation errors returned by LoginResponse.ValidateAll() if the designated constraints aren't met.

func (LoginResponseMultiError) AllErrors

func (m LoginResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LoginResponseMultiError) Error

func (m LoginResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type LoginResponseValidationError

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

LoginResponseValidationError is the validation error returned by LoginResponse.Validate if the designated constraints aren't met.

func (LoginResponseValidationError) Cause

Cause function returns cause value.

func (LoginResponseValidationError) Error

Error satisfies the builtin error interface

func (LoginResponseValidationError) ErrorName

func (e LoginResponseValidationError) ErrorName() string

ErrorName returns error name.

func (LoginResponseValidationError) Field

Field function returns field value.

func (LoginResponseValidationError) Key

Key function returns key value.

func (LoginResponseValidationError) Reason

Reason function returns reason value.

type LogoutRequest

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

User background logout - request

func (*LogoutRequest) Descriptor deprecated

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

Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.

func (*LogoutRequest) GetId

func (x *LogoutRequest) GetId() uint32

func (*LogoutRequest) ProtoMessage

func (*LogoutRequest) ProtoMessage()

func (*LogoutRequest) ProtoReflect

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

func (*LogoutRequest) Reset

func (x *LogoutRequest) Reset()

func (*LogoutRequest) String

func (x *LogoutRequest) String() string

func (*LogoutRequest) Validate

func (m *LogoutRequest) Validate() error

Validate checks the field values on LogoutRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*LogoutRequest) ValidateAll

func (m *LogoutRequest) ValidateAll() error

ValidateAll checks the field values on LogoutRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LogoutRequestMultiError, or nil if none found.

type LogoutRequestMultiError

type LogoutRequestMultiError []error

LogoutRequestMultiError is an error wrapping multiple validation errors returned by LogoutRequest.ValidateAll() if the designated constraints aren't met.

func (LogoutRequestMultiError) AllErrors

func (m LogoutRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LogoutRequestMultiError) Error

func (m LogoutRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type LogoutRequestValidationError

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

LogoutRequestValidationError is the validation error returned by LogoutRequest.Validate if the designated constraints aren't met.

func (LogoutRequestValidationError) Cause

Cause function returns cause value.

func (LogoutRequestValidationError) Error

Error satisfies the builtin error interface

func (LogoutRequestValidationError) ErrorName

func (e LogoutRequestValidationError) ErrorName() string

ErrorName returns error name.

func (LogoutRequestValidationError) Field

Field function returns field value.

func (LogoutRequestValidationError) Key

Key function returns key value.

func (LogoutRequestValidationError) Reason

Reason function returns reason value.

type RefreshTokenRequest

type RefreshTokenRequest struct {
	RefreshToken string  `protobuf:"bytes,1,opt,name=refresh_token,proto3" json:"refresh_token,omitempty"` // Refresh token, used to obtain the next access token, required.
	GrantType    string  `protobuf:"bytes,2,opt,name=grant_type,proto3" json:"grant_type,omitempty"`       // Authorization type, the value here is fixed to "refresh_token", required.
	Scope        *string `protobuf:"bytes,3,opt,name=scope,proto3,oneof" json:"scope,omitempty"`           // A space-separated list of ranges. If not provided, scope authorizes any scope, defaulting to an empty list.
	ClientId     *string `protobuf:"bytes,5,opt,name=client_id,proto3,oneof" json:"client_id,omitempty"`
	ClientSecret *string `protobuf:"bytes,6,opt,name=client_secret,proto3,oneof" json:"client_secret,omitempty"`
	// contains filtered or unexported fields
}

User refresh token - request

func (*RefreshTokenRequest) Descriptor deprecated

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

Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead.

func (*RefreshTokenRequest) GetClientId

func (x *RefreshTokenRequest) GetClientId() string

func (*RefreshTokenRequest) GetClientSecret

func (x *RefreshTokenRequest) GetClientSecret() string

func (*RefreshTokenRequest) GetGrantType

func (x *RefreshTokenRequest) GetGrantType() string

func (*RefreshTokenRequest) GetRefreshToken

func (x *RefreshTokenRequest) GetRefreshToken() string

func (*RefreshTokenRequest) GetScope

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

func (*RefreshTokenRequest) Validate

func (m *RefreshTokenRequest) Validate() error

Validate checks the field values on RefreshTokenRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*RefreshTokenRequest) ValidateAll

func (m *RefreshTokenRequest) ValidateAll() error

ValidateAll checks the field values on RefreshTokenRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RefreshTokenRequestMultiError, or nil if none found.

type RefreshTokenRequestMultiError

type RefreshTokenRequestMultiError []error

RefreshTokenRequestMultiError is an error wrapping multiple validation errors returned by RefreshTokenRequest.ValidateAll() if the designated constraints aren't met.

func (RefreshTokenRequestMultiError) AllErrors

func (m RefreshTokenRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RefreshTokenRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type RefreshTokenRequestValidationError

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

RefreshTokenRequestValidationError is the validation error returned by RefreshTokenRequest.Validate if the designated constraints aren't met.

func (RefreshTokenRequestValidationError) Cause

Cause function returns cause value.

func (RefreshTokenRequestValidationError) Error

Error satisfies the builtin error interface

func (RefreshTokenRequestValidationError) ErrorName

ErrorName returns error name.

func (RefreshTokenRequestValidationError) Field

Field function returns field value.

func (RefreshTokenRequestValidationError) Key

Key function returns key value.

func (RefreshTokenRequestValidationError) Reason

Reason function returns reason value.

type RefreshTokenResponse

type RefreshTokenResponse struct {
	RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,proto3" json:"refresh_token,omitempty"` // Refresh token, used to obtain the next access token, optional.
	GrantType    string `protobuf:"bytes,2,opt,name=grant_type,proto3" json:"grant_type,omitempty"`       // Authorization type, the value here is fixed to "refresh token", required.
	// contains filtered or unexported fields
}

User refresh token - response

func (*RefreshTokenResponse) Descriptor deprecated

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

Deprecated: Use RefreshTokenResponse.ProtoReflect.Descriptor instead.

func (*RefreshTokenResponse) GetGrantType

func (x *RefreshTokenResponse) GetGrantType() 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

func (*RefreshTokenResponse) Validate

func (m *RefreshTokenResponse) Validate() error

Validate checks the field values on RefreshTokenResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*RefreshTokenResponse) ValidateAll

func (m *RefreshTokenResponse) ValidateAll() error

ValidateAll checks the field values on RefreshTokenResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RefreshTokenResponseMultiError, or nil if none found.

type RefreshTokenResponseMultiError

type RefreshTokenResponseMultiError []error

RefreshTokenResponseMultiError is an error wrapping multiple validation errors returned by RefreshTokenResponse.ValidateAll() if the designated constraints aren't met.

func (RefreshTokenResponseMultiError) AllErrors

func (m RefreshTokenResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RefreshTokenResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type RefreshTokenResponseValidationError

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

RefreshTokenResponseValidationError is the validation error returned by RefreshTokenResponse.Validate if the designated constraints aren't met.

func (RefreshTokenResponseValidationError) Cause

Cause function returns cause value.

func (RefreshTokenResponseValidationError) Error

Error satisfies the builtin error interface

func (RefreshTokenResponseValidationError) ErrorName

ErrorName returns error name.

func (RefreshTokenResponseValidationError) Field

Field function returns field value.

func (RefreshTokenResponseValidationError) Key

Key function returns key value.

func (RefreshTokenResponseValidationError) Reason

Reason function returns reason value.

type TokenType

type TokenType int32

Token type

const (
	TokenType_bearer TokenType = 0 //
	TokenType_mac    TokenType = 1 //
)

func (TokenType) Descriptor

func (TokenType) Descriptor() protoreflect.EnumDescriptor

func (TokenType) Enum

func (x TokenType) Enum() *TokenType

func (TokenType) EnumDescriptor deprecated

func (TokenType) EnumDescriptor() ([]byte, []int)

Deprecated: Use TokenType.Descriptor instead.

func (TokenType) Number

func (x TokenType) Number() protoreflect.EnumNumber

func (TokenType) String

func (x TokenType) String() string

func (TokenType) Type

type UnimplementedAuthenticationServiceServer

type UnimplementedAuthenticationServiceServer struct {
}

UnimplementedAuthenticationServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthenticationServiceServer) GetMe

func (UnimplementedAuthenticationServiceServer) Login

func (UnimplementedAuthenticationServiceServer) Logout

type UnsafeAuthenticationServiceServer

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

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

Jump to

Keyboard shortcuts

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