client

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Token_Generate_FullMethodName = "/api.Token/Generate"
	Token_Refresh_FullMethodName  = "/api.Token/Refresh"
	Token_Validate_FullMethodName = "/api.Token/Validate"
)

Variables

View Source
var File_token_proto protoreflect.FileDescriptor
View Source
var Token_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.Token",
	HandlerType: (*TokenServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Generate",
			Handler:    _Token_Generate_Handler,
		},
		{
			MethodName: "Refresh",
			Handler:    _Token_Refresh_Handler,
		},
		{
			MethodName: "Validate",
			Handler:    _Token_Validate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "token.proto",
}

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

Functions

func RegisterTokenServer

func RegisterTokenServer(s grpc.ServiceRegistrar, srv TokenServer)

Types

type TokenClient

type TokenClient interface {
	Generate(ctx context.Context, in *TokenGenerateRequest, opts ...grpc.CallOption) (*TokenGenerateResponse, error)
	Refresh(ctx context.Context, in *TokenRefreshRequest, opts ...grpc.CallOption) (*TokenRefreshResponse, error)
	Validate(ctx context.Context, in *TokenValidateRequest, opts ...grpc.CallOption) (*TokenValidateResponse, error)
}

TokenClient is the client API for Token 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 NewTokenClient

func NewTokenClient(cc grpc.ClientConnInterface) TokenClient

type TokenGenerateRequest

type TokenGenerateRequest 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 (*TokenGenerateRequest) Descriptor deprecated

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

Deprecated: Use TokenGenerateRequest.ProtoReflect.Descriptor instead.

func (*TokenGenerateRequest) GetPassword

func (x *TokenGenerateRequest) GetPassword() string

func (*TokenGenerateRequest) GetUsername

func (x *TokenGenerateRequest) GetUsername() string

func (*TokenGenerateRequest) ProtoMessage

func (*TokenGenerateRequest) ProtoMessage()

func (*TokenGenerateRequest) ProtoReflect

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

func (*TokenGenerateRequest) Reset

func (x *TokenGenerateRequest) Reset()

func (*TokenGenerateRequest) String

func (x *TokenGenerateRequest) String() string

func (*TokenGenerateRequest) Validate

func (m *TokenGenerateRequest) Validate() error

Validate checks the field values on TokenGenerateRequest 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 (*TokenGenerateRequest) ValidateAll

func (m *TokenGenerateRequest) ValidateAll() error

ValidateAll checks the field values on TokenGenerateRequest 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 TokenGenerateRequestMultiError, or nil if none found.

type TokenGenerateRequestMultiError

type TokenGenerateRequestMultiError []error

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

func (TokenGenerateRequestMultiError) AllErrors

func (m TokenGenerateRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TokenGenerateRequestMultiError) Error

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

type TokenGenerateRequestValidationError

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

TokenGenerateRequestValidationError is the validation error returned by TokenGenerateRequest.Validate if the designated constraints aren't met.

func (TokenGenerateRequestValidationError) Cause

Cause function returns cause value.

func (TokenGenerateRequestValidationError) Error

Error satisfies the builtin error interface

func (TokenGenerateRequestValidationError) ErrorName

ErrorName returns error name.

func (TokenGenerateRequestValidationError) Field

Field function returns field value.

func (TokenGenerateRequestValidationError) Key

Key function returns key value.

func (TokenGenerateRequestValidationError) Reason

Reason function returns reason value.

type TokenGenerateResponse

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

func (*TokenGenerateResponse) Descriptor deprecated

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

Deprecated: Use TokenGenerateResponse.ProtoReflect.Descriptor instead.

func (*TokenGenerateResponse) GetAccessToken

func (x *TokenGenerateResponse) GetAccessToken() string

func (*TokenGenerateResponse) GetRefreshToken

func (x *TokenGenerateResponse) GetRefreshToken() string

func (*TokenGenerateResponse) ProtoMessage

func (*TokenGenerateResponse) ProtoMessage()

func (*TokenGenerateResponse) ProtoReflect

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

func (*TokenGenerateResponse) Reset

func (x *TokenGenerateResponse) Reset()

func (*TokenGenerateResponse) String

func (x *TokenGenerateResponse) String() string

func (*TokenGenerateResponse) Validate

func (m *TokenGenerateResponse) Validate() error

Validate checks the field values on TokenGenerateResponse 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 (*TokenGenerateResponse) ValidateAll

func (m *TokenGenerateResponse) ValidateAll() error

ValidateAll checks the field values on TokenGenerateResponse 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 TokenGenerateResponseMultiError, or nil if none found.

type TokenGenerateResponseMultiError

type TokenGenerateResponseMultiError []error

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

func (TokenGenerateResponseMultiError) AllErrors

func (m TokenGenerateResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TokenGenerateResponseMultiError) Error

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

type TokenGenerateResponseValidationError

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

TokenGenerateResponseValidationError is the validation error returned by TokenGenerateResponse.Validate if the designated constraints aren't met.

func (TokenGenerateResponseValidationError) Cause

Cause function returns cause value.

func (TokenGenerateResponseValidationError) Error

Error satisfies the builtin error interface

func (TokenGenerateResponseValidationError) ErrorName

ErrorName returns error name.

func (TokenGenerateResponseValidationError) Field

Field function returns field value.

func (TokenGenerateResponseValidationError) Key

Key function returns key value.

func (TokenGenerateResponseValidationError) Reason

Reason function returns reason value.

type TokenRefreshRequest

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

func (*TokenRefreshRequest) Descriptor deprecated

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

Deprecated: Use TokenRefreshRequest.ProtoReflect.Descriptor instead.

func (*TokenRefreshRequest) GetRefreshToken

func (x *TokenRefreshRequest) GetRefreshToken() string

func (*TokenRefreshRequest) ProtoMessage

func (*TokenRefreshRequest) ProtoMessage()

func (*TokenRefreshRequest) ProtoReflect

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

func (*TokenRefreshRequest) Reset

func (x *TokenRefreshRequest) Reset()

func (*TokenRefreshRequest) String

func (x *TokenRefreshRequest) String() string

func (*TokenRefreshRequest) Validate

func (m *TokenRefreshRequest) Validate() error

Validate checks the field values on TokenRefreshRequest 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 (*TokenRefreshRequest) ValidateAll

func (m *TokenRefreshRequest) ValidateAll() error

ValidateAll checks the field values on TokenRefreshRequest 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 TokenRefreshRequestMultiError, or nil if none found.

type TokenRefreshRequestMultiError

type TokenRefreshRequestMultiError []error

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

func (TokenRefreshRequestMultiError) AllErrors

func (m TokenRefreshRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TokenRefreshRequestMultiError) Error

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

type TokenRefreshRequestValidationError

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

TokenRefreshRequestValidationError is the validation error returned by TokenRefreshRequest.Validate if the designated constraints aren't met.

func (TokenRefreshRequestValidationError) Cause

Cause function returns cause value.

func (TokenRefreshRequestValidationError) Error

Error satisfies the builtin error interface

func (TokenRefreshRequestValidationError) ErrorName

ErrorName returns error name.

func (TokenRefreshRequestValidationError) Field

Field function returns field value.

func (TokenRefreshRequestValidationError) Key

Key function returns key value.

func (TokenRefreshRequestValidationError) Reason

Reason function returns reason value.

type TokenRefreshResponse

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

func (*TokenRefreshResponse) Descriptor deprecated

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

Deprecated: Use TokenRefreshResponse.ProtoReflect.Descriptor instead.

func (*TokenRefreshResponse) GetNewAccessToken

func (x *TokenRefreshResponse) GetNewAccessToken() string

func (*TokenRefreshResponse) ProtoMessage

func (*TokenRefreshResponse) ProtoMessage()

func (*TokenRefreshResponse) ProtoReflect

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

func (*TokenRefreshResponse) Reset

func (x *TokenRefreshResponse) Reset()

func (*TokenRefreshResponse) String

func (x *TokenRefreshResponse) String() string

func (*TokenRefreshResponse) Validate

func (m *TokenRefreshResponse) Validate() error

Validate checks the field values on TokenRefreshResponse 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 (*TokenRefreshResponse) ValidateAll

func (m *TokenRefreshResponse) ValidateAll() error

ValidateAll checks the field values on TokenRefreshResponse 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 TokenRefreshResponseMultiError, or nil if none found.

type TokenRefreshResponseMultiError

type TokenRefreshResponseMultiError []error

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

func (TokenRefreshResponseMultiError) AllErrors

func (m TokenRefreshResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TokenRefreshResponseMultiError) Error

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

type TokenRefreshResponseValidationError

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

TokenRefreshResponseValidationError is the validation error returned by TokenRefreshResponse.Validate if the designated constraints aren't met.

func (TokenRefreshResponseValidationError) Cause

Cause function returns cause value.

func (TokenRefreshResponseValidationError) Error

Error satisfies the builtin error interface

func (TokenRefreshResponseValidationError) ErrorName

ErrorName returns error name.

func (TokenRefreshResponseValidationError) Field

Field function returns field value.

func (TokenRefreshResponseValidationError) Key

Key function returns key value.

func (TokenRefreshResponseValidationError) Reason

Reason function returns reason value.

type TokenServer

type TokenServer interface {
	Generate(context.Context, *TokenGenerateRequest) (*TokenGenerateResponse, error)
	Refresh(context.Context, *TokenRefreshRequest) (*TokenRefreshResponse, error)
	Validate(context.Context, *TokenValidateRequest) (*TokenValidateResponse, error)
	// contains filtered or unexported methods
}

TokenServer is the server API for Token service. All implementations must embed UnimplementedTokenServer for forward compatibility.

type TokenValidateRequest

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

func (*TokenValidateRequest) Descriptor deprecated

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

Deprecated: Use TokenValidateRequest.ProtoReflect.Descriptor instead.

func (*TokenValidateRequest) GetAccessToken

func (x *TokenValidateRequest) GetAccessToken() string

func (*TokenValidateRequest) ProtoMessage

func (*TokenValidateRequest) ProtoMessage()

func (*TokenValidateRequest) ProtoReflect

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

func (*TokenValidateRequest) Reset

func (x *TokenValidateRequest) Reset()

func (*TokenValidateRequest) String

func (x *TokenValidateRequest) String() string

func (*TokenValidateRequest) Validate

func (m *TokenValidateRequest) Validate() error

Validate checks the field values on TokenValidateRequest 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 (*TokenValidateRequest) ValidateAll

func (m *TokenValidateRequest) ValidateAll() error

ValidateAll checks the field values on TokenValidateRequest 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 TokenValidateRequestMultiError, or nil if none found.

type TokenValidateRequestMultiError

type TokenValidateRequestMultiError []error

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

func (TokenValidateRequestMultiError) AllErrors

func (m TokenValidateRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TokenValidateRequestMultiError) Error

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

type TokenValidateRequestValidationError

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

TokenValidateRequestValidationError is the validation error returned by TokenValidateRequest.Validate if the designated constraints aren't met.

func (TokenValidateRequestValidationError) Cause

Cause function returns cause value.

func (TokenValidateRequestValidationError) Error

Error satisfies the builtin error interface

func (TokenValidateRequestValidationError) ErrorName

ErrorName returns error name.

func (TokenValidateRequestValidationError) Field

Field function returns field value.

func (TokenValidateRequestValidationError) Key

Key function returns key value.

func (TokenValidateRequestValidationError) Reason

Reason function returns reason value.

type TokenValidateResponse

type TokenValidateResponse struct {
	CredentialsId string `protobuf:"bytes,1,opt,name=credentials_id,json=credentialsId,proto3" json:"credentials_id,omitempty"`
	Username      string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	AccountType   string `protobuf:"bytes,3,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"`
	// contains filtered or unexported fields
}

func (*TokenValidateResponse) Descriptor deprecated

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

Deprecated: Use TokenValidateResponse.ProtoReflect.Descriptor instead.

func (*TokenValidateResponse) GetAccountType

func (x *TokenValidateResponse) GetAccountType() string

func (*TokenValidateResponse) GetCredentialsId

func (x *TokenValidateResponse) GetCredentialsId() string

func (*TokenValidateResponse) GetUsername

func (x *TokenValidateResponse) GetUsername() string

func (*TokenValidateResponse) ProtoMessage

func (*TokenValidateResponse) ProtoMessage()

func (*TokenValidateResponse) ProtoReflect

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

func (*TokenValidateResponse) Reset

func (x *TokenValidateResponse) Reset()

func (*TokenValidateResponse) String

func (x *TokenValidateResponse) String() string

func (*TokenValidateResponse) Validate

func (m *TokenValidateResponse) Validate() error

Validate checks the field values on TokenValidateResponse 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 (*TokenValidateResponse) ValidateAll

func (m *TokenValidateResponse) ValidateAll() error

ValidateAll checks the field values on TokenValidateResponse 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 TokenValidateResponseMultiError, or nil if none found.

type TokenValidateResponseMultiError

type TokenValidateResponseMultiError []error

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

func (TokenValidateResponseMultiError) AllErrors

func (m TokenValidateResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TokenValidateResponseMultiError) Error

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

type TokenValidateResponseValidationError

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

TokenValidateResponseValidationError is the validation error returned by TokenValidateResponse.Validate if the designated constraints aren't met.

func (TokenValidateResponseValidationError) Cause

Cause function returns cause value.

func (TokenValidateResponseValidationError) Error

Error satisfies the builtin error interface

func (TokenValidateResponseValidationError) ErrorName

ErrorName returns error name.

func (TokenValidateResponseValidationError) Field

Field function returns field value.

func (TokenValidateResponseValidationError) Key

Key function returns key value.

func (TokenValidateResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedTokenServer

type UnimplementedTokenServer struct{}

UnimplementedTokenServer 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 (UnimplementedTokenServer) Generate

func (UnimplementedTokenServer) Refresh

func (UnimplementedTokenServer) Validate

type UnsafeTokenServer

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

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

Jump to

Keyboard shortcuts

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