v1

package
v0.0.0-...-4da945e Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const OperationCenterInterfaceLogin = "/center.interface.v1.CenterInterface/Login"
View Source
const OperationCenterInterfaceLogout = "/center.interface.v1.CenterInterface/Logout"
View Source
const OperationCenterInterfaceRegister = "/center.interface.v1.CenterInterface/Register"

Variables

View Source
var (
	CenterInterfaceErrorReason_name = map[int32]string{
		0: "UNKNOWN_ERROR",
		1: "LOGIN_FAILED",
		2: "USERNAME_CONFLICT",
		3: "REGISTER_FAILED",
	}
	CenterInterfaceErrorReason_value = map[string]int32{
		"UNKNOWN_ERROR":     0,
		"LOGIN_FAILED":      1,
		"USERNAME_CONFLICT": 2,
		"REGISTER_FAILED":   3,
	}
)

Enum value maps for CenterInterfaceErrorReason.

View Source
var CenterInterface_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "center.interface.v1.CenterInterface",
	HandlerType: (*CenterInterfaceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _CenterInterface_Register_Handler,
		},
		{
			MethodName: "Login",
			Handler:    _CenterInterface_Login_Handler,
		},
		{
			MethodName: "Logout",
			Handler:    _CenterInterface_Logout_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "v1/center_interface.proto",
}

CenterInterface_ServiceDesc is the grpc.ServiceDesc for CenterInterface 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_v1_center_interface_error_proto protoreflect.FileDescriptor
View Source
var File_v1_center_interface_proto protoreflect.FileDescriptor

Functions

func ErrorLoginFailed

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

func ErrorRegisterFailed

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

func ErrorUnknownError

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

func ErrorUsernameConflict

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

func IsLoginFailed

func IsLoginFailed(err error) bool

func IsRegisterFailed

func IsRegisterFailed(err error) bool

func IsUnknownError

func IsUnknownError(err error) bool

func IsUsernameConflict

func IsUsernameConflict(err error) bool

func RegisterCenterInterfaceHTTPServer

func RegisterCenterInterfaceHTTPServer(s *http.Server, srv CenterInterfaceHTTPServer)

func RegisterCenterInterfaceServer

func RegisterCenterInterfaceServer(s grpc.ServiceRegistrar, srv CenterInterfaceServer)

Types

type CenterInterfaceClient

type CenterInterfaceClient interface {
	Register(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*RegisterReply, error)
	Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginReply, error)
	Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*LogoutReply, error)
}

CenterInterfaceClient is the client API for CenterInterface 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 CenterInterfaceErrorReason

type CenterInterfaceErrorReason int32
const (
	CenterInterfaceErrorReason_UNKNOWN_ERROR     CenterInterfaceErrorReason = 0
	CenterInterfaceErrorReason_LOGIN_FAILED      CenterInterfaceErrorReason = 1
	CenterInterfaceErrorReason_USERNAME_CONFLICT CenterInterfaceErrorReason = 2
	CenterInterfaceErrorReason_REGISTER_FAILED   CenterInterfaceErrorReason = 3
)

func (CenterInterfaceErrorReason) Descriptor

func (CenterInterfaceErrorReason) Enum

func (CenterInterfaceErrorReason) EnumDescriptor deprecated

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

Deprecated: Use CenterInterfaceErrorReason.Descriptor instead.

func (CenterInterfaceErrorReason) Number

func (CenterInterfaceErrorReason) String

func (CenterInterfaceErrorReason) Type

type CenterInterfaceHTTPClient

type CenterInterfaceHTTPClient interface {
	Login(ctx context.Context, req *LoginReq, opts ...http.CallOption) (rsp *LoginReply, err error)
	Logout(ctx context.Context, req *LogoutReq, opts ...http.CallOption) (rsp *LogoutReply, err error)
	Register(ctx context.Context, req *RegisterReq, opts ...http.CallOption) (rsp *RegisterReply, err error)
}

func NewCenterInterfaceHTTPClient

func NewCenterInterfaceHTTPClient(client *http.Client) CenterInterfaceHTTPClient

type CenterInterfaceHTTPClientImpl

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

func (*CenterInterfaceHTTPClientImpl) Login

func (*CenterInterfaceHTTPClientImpl) Logout

func (*CenterInterfaceHTTPClientImpl) Register

type CenterInterfaceHTTPServer

type CenterInterfaceHTTPServer interface {
	Login(context.Context, *LoginReq) (*LoginReply, error)
	Logout(context.Context, *LogoutReq) (*LogoutReply, error)
	Register(context.Context, *RegisterReq) (*RegisterReply, error)
}

type CenterInterfaceServer

type CenterInterfaceServer interface {
	Register(context.Context, *RegisterReq) (*RegisterReply, error)
	Login(context.Context, *LoginReq) (*LoginReply, error)
	Logout(context.Context, *LogoutReq) (*LogoutReply, error)
	// contains filtered or unexported methods
}

CenterInterfaceServer is the server API for CenterInterface service. All implementations must embed UnimplementedCenterInterfaceServer for forward compatibility

type LoginReply

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

func (*LoginReply) Descriptor deprecated

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

Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.

func (*LoginReply) GetToken

func (x *LoginReply) GetToken() string

func (*LoginReply) ProtoMessage

func (*LoginReply) ProtoMessage()

func (*LoginReply) ProtoReflect

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

func (*LoginReply) Reset

func (x *LoginReply) Reset()

func (*LoginReply) String

func (x *LoginReply) String() string

func (*LoginReply) Validate

func (m *LoginReply) Validate() error

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

func (m *LoginReply) ValidateAll() error

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

type LoginReplyMultiError

type LoginReplyMultiError []error

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

func (LoginReplyMultiError) AllErrors

func (m LoginReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LoginReplyMultiError) Error

func (m LoginReplyMultiError) Error() string

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

type LoginReplyValidationError

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

LoginReplyValidationError is the validation error returned by LoginReply.Validate if the designated constraints aren't met.

func (LoginReplyValidationError) Cause

func (e LoginReplyValidationError) Cause() error

Cause function returns cause value.

func (LoginReplyValidationError) Error

Error satisfies the builtin error interface

func (LoginReplyValidationError) ErrorName

func (e LoginReplyValidationError) ErrorName() string

ErrorName returns error name.

func (LoginReplyValidationError) Field

Field function returns field value.

func (LoginReplyValidationError) Key

Key function returns key value.

func (LoginReplyValidationError) Reason

func (e LoginReplyValidationError) Reason() string

Reason function returns reason value.

type LoginReq

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

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

Deprecated: Use LoginReq.ProtoReflect.Descriptor instead.

func (*LoginReq) GetPassword

func (x *LoginReq) GetPassword() string

func (*LoginReq) GetUsername

func (x *LoginReq) GetUsername() string

func (*LoginReq) ProtoMessage

func (*LoginReq) ProtoMessage()

func (*LoginReq) ProtoReflect

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

func (*LoginReq) Reset

func (x *LoginReq) Reset()

func (*LoginReq) String

func (x *LoginReq) String() string

func (*LoginReq) Validate

func (m *LoginReq) Validate() error

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

func (m *LoginReq) ValidateAll() error

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

type LoginReqMultiError

type LoginReqMultiError []error

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

func (LoginReqMultiError) AllErrors

func (m LoginReqMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LoginReqMultiError) Error

func (m LoginReqMultiError) Error() string

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

type LoginReqValidationError

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

LoginReqValidationError is the validation error returned by LoginReq.Validate if the designated constraints aren't met.

func (LoginReqValidationError) Cause

func (e LoginReqValidationError) Cause() error

Cause function returns cause value.

func (LoginReqValidationError) Error

func (e LoginReqValidationError) Error() string

Error satisfies the builtin error interface

func (LoginReqValidationError) ErrorName

func (e LoginReqValidationError) ErrorName() string

ErrorName returns error name.

func (LoginReqValidationError) Field

func (e LoginReqValidationError) Field() string

Field function returns field value.

func (LoginReqValidationError) Key

func (e LoginReqValidationError) Key() bool

Key function returns key value.

func (LoginReqValidationError) Reason

func (e LoginReqValidationError) Reason() string

Reason function returns reason value.

type LogoutReply

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

func (*LogoutReply) Descriptor deprecated

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

Deprecated: Use LogoutReply.ProtoReflect.Descriptor instead.

func (*LogoutReply) ProtoMessage

func (*LogoutReply) ProtoMessage()

func (*LogoutReply) ProtoReflect

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

func (*LogoutReply) Reset

func (x *LogoutReply) Reset()

func (*LogoutReply) String

func (x *LogoutReply) String() string

func (*LogoutReply) Validate

func (m *LogoutReply) Validate() error

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

func (m *LogoutReply) ValidateAll() error

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

type LogoutReplyMultiError

type LogoutReplyMultiError []error

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

func (LogoutReplyMultiError) AllErrors

func (m LogoutReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LogoutReplyMultiError) Error

func (m LogoutReplyMultiError) Error() string

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

type LogoutReplyValidationError

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

LogoutReplyValidationError is the validation error returned by LogoutReply.Validate if the designated constraints aren't met.

func (LogoutReplyValidationError) Cause

Cause function returns cause value.

func (LogoutReplyValidationError) Error

Error satisfies the builtin error interface

func (LogoutReplyValidationError) ErrorName

func (e LogoutReplyValidationError) ErrorName() string

ErrorName returns error name.

func (LogoutReplyValidationError) Field

Field function returns field value.

func (LogoutReplyValidationError) Key

Key function returns key value.

func (LogoutReplyValidationError) Reason

Reason function returns reason value.

type LogoutReq

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

func (*LogoutReq) Descriptor deprecated

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

Deprecated: Use LogoutReq.ProtoReflect.Descriptor instead.

func (*LogoutReq) ProtoMessage

func (*LogoutReq) ProtoMessage()

func (*LogoutReq) ProtoReflect

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

func (*LogoutReq) Reset

func (x *LogoutReq) Reset()

func (*LogoutReq) String

func (x *LogoutReq) String() string

func (*LogoutReq) Validate

func (m *LogoutReq) Validate() error

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

func (m *LogoutReq) ValidateAll() error

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

type LogoutReqMultiError

type LogoutReqMultiError []error

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

func (LogoutReqMultiError) AllErrors

func (m LogoutReqMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LogoutReqMultiError) Error

func (m LogoutReqMultiError) Error() string

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

type LogoutReqValidationError

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

LogoutReqValidationError is the validation error returned by LogoutReq.Validate if the designated constraints aren't met.

func (LogoutReqValidationError) Cause

func (e LogoutReqValidationError) Cause() error

Cause function returns cause value.

func (LogoutReqValidationError) Error

func (e LogoutReqValidationError) Error() string

Error satisfies the builtin error interface

func (LogoutReqValidationError) ErrorName

func (e LogoutReqValidationError) ErrorName() string

ErrorName returns error name.

func (LogoutReqValidationError) Field

func (e LogoutReqValidationError) Field() string

Field function returns field value.

func (LogoutReqValidationError) Key

Key function returns key value.

func (LogoutReqValidationError) Reason

func (e LogoutReqValidationError) Reason() string

Reason function returns reason value.

type RegisterReply

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

func (*RegisterReply) Descriptor deprecated

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

Deprecated: Use RegisterReply.ProtoReflect.Descriptor instead.

func (*RegisterReply) GetId

func (x *RegisterReply) GetId() int64

func (*RegisterReply) ProtoMessage

func (*RegisterReply) ProtoMessage()

func (*RegisterReply) ProtoReflect

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

func (*RegisterReply) Reset

func (x *RegisterReply) Reset()

func (*RegisterReply) String

func (x *RegisterReply) String() string

func (*RegisterReply) Validate

func (m *RegisterReply) Validate() error

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

func (m *RegisterReply) ValidateAll() error

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

type RegisterReplyMultiError

type RegisterReplyMultiError []error

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

func (RegisterReplyMultiError) AllErrors

func (m RegisterReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RegisterReplyMultiError) Error

func (m RegisterReplyMultiError) Error() string

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

type RegisterReplyValidationError

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

RegisterReplyValidationError is the validation error returned by RegisterReply.Validate if the designated constraints aren't met.

func (RegisterReplyValidationError) Cause

Cause function returns cause value.

func (RegisterReplyValidationError) Error

Error satisfies the builtin error interface

func (RegisterReplyValidationError) ErrorName

func (e RegisterReplyValidationError) ErrorName() string

ErrorName returns error name.

func (RegisterReplyValidationError) Field

Field function returns field value.

func (RegisterReplyValidationError) Key

Key function returns key value.

func (RegisterReplyValidationError) Reason

Reason function returns reason value.

type RegisterReq

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

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

Deprecated: Use RegisterReq.ProtoReflect.Descriptor instead.

func (*RegisterReq) GetPassword

func (x *RegisterReq) GetPassword() string

func (*RegisterReq) GetUsername

func (x *RegisterReq) GetUsername() string

func (*RegisterReq) ProtoMessage

func (*RegisterReq) ProtoMessage()

func (*RegisterReq) ProtoReflect

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

func (*RegisterReq) Reset

func (x *RegisterReq) Reset()

func (*RegisterReq) String

func (x *RegisterReq) String() string

func (*RegisterReq) Validate

func (m *RegisterReq) Validate() error

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

func (m *RegisterReq) ValidateAll() error

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

type RegisterReqMultiError

type RegisterReqMultiError []error

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

func (RegisterReqMultiError) AllErrors

func (m RegisterReqMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RegisterReqMultiError) Error

func (m RegisterReqMultiError) Error() string

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

type RegisterReqValidationError

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

RegisterReqValidationError is the validation error returned by RegisterReq.Validate if the designated constraints aren't met.

func (RegisterReqValidationError) Cause

Cause function returns cause value.

func (RegisterReqValidationError) Error

Error satisfies the builtin error interface

func (RegisterReqValidationError) ErrorName

func (e RegisterReqValidationError) ErrorName() string

ErrorName returns error name.

func (RegisterReqValidationError) Field

Field function returns field value.

func (RegisterReqValidationError) Key

Key function returns key value.

func (RegisterReqValidationError) Reason

Reason function returns reason value.

type UnimplementedCenterInterfaceServer

type UnimplementedCenterInterfaceServer struct {
}

UnimplementedCenterInterfaceServer must be embedded to have forward compatible implementations.

func (UnimplementedCenterInterfaceServer) Login

func (UnimplementedCenterInterfaceServer) Logout

func (UnimplementedCenterInterfaceServer) Register

type UnsafeCenterInterfaceServer

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

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

Jump to

Keyboard shortcuts

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