v1

package
v0.0.0-...-cf50efe Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserServiceErrorReason_name = map[int32]string{
		0: "USER_NOT_FOUND",
		1: "CONTENT_MISSING",
	}
	UserServiceErrorReason_value = map[string]int32{
		"USER_NOT_FOUND":  0,
		"CONTENT_MISSING": 1,
	}
)

Enum value maps for UserServiceErrorReason.

View Source
var File_api_user_service_v1_user_error_proto protoreflect.FileDescriptor
View Source
var File_api_user_service_v1_user_proto protoreflect.FileDescriptor
View Source
var User_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "user.service.v1.User",
	HandlerType: (*UserServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUserList",
			Handler:    _User_GetUserList_Handler,
		},
		{
			MethodName: "CreateUser",
			Handler:    _User_CreateUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/user/service/v1/user.proto",
}

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

Functions

func ErrorContentMissing

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

func ErrorUserNotFound

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

func IsContentMissing

func IsContentMissing(err error) bool

func IsUserNotFound

func IsUserNotFound(err error) bool

func RegisterUserServer

func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)

Types

type CreateUserInfo

type CreateUserInfo struct {
	NickName string `protobuf:"bytes,1,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	Mobile   string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUserInfo) Descriptor deprecated

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

Deprecated: Use CreateUserInfo.ProtoReflect.Descriptor instead.

func (*CreateUserInfo) GetMobile

func (x *CreateUserInfo) GetMobile() string

func (*CreateUserInfo) GetNickName

func (x *CreateUserInfo) GetNickName() string

func (*CreateUserInfo) GetPassword

func (x *CreateUserInfo) GetPassword() string

func (*CreateUserInfo) ProtoMessage

func (*CreateUserInfo) ProtoMessage()

func (*CreateUserInfo) ProtoReflect

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

func (*CreateUserInfo) Reset

func (x *CreateUserInfo) Reset()

func (*CreateUserInfo) String

func (x *CreateUserInfo) String() string

func (*CreateUserInfo) Validate

func (m *CreateUserInfo) Validate() error

Validate checks the field values on CreateUserInfo with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CreateUserInfoValidationError

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

CreateUserInfoValidationError is the validation error returned by CreateUserInfo.Validate if the designated constraints aren't met.

func (CreateUserInfoValidationError) Cause

Cause function returns cause value.

func (CreateUserInfoValidationError) Error

Error satisfies the builtin error interface

func (CreateUserInfoValidationError) ErrorName

func (e CreateUserInfoValidationError) ErrorName() string

ErrorName returns error name.

func (CreateUserInfoValidationError) Field

Field function returns field value.

func (CreateUserInfoValidationError) Key

Key function returns key value.

func (CreateUserInfoValidationError) Reason

Reason function returns reason value.

type PageInfo

type PageInfo struct {
	PageNum  uint32 `protobuf:"varint,1,opt,name=page_num,json=pageNum,proto3" json:"page_num,omitempty"`
	PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

func (*PageInfo) Descriptor deprecated

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

Deprecated: Use PageInfo.ProtoReflect.Descriptor instead.

func (*PageInfo) GetPageNum

func (x *PageInfo) GetPageNum() uint32

func (*PageInfo) GetPageSize

func (x *PageInfo) GetPageSize() uint32

func (*PageInfo) ProtoMessage

func (*PageInfo) ProtoMessage()

func (*PageInfo) ProtoReflect

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

func (*PageInfo) Reset

func (x *PageInfo) Reset()

func (*PageInfo) String

func (x *PageInfo) String() string

func (*PageInfo) Validate

func (m *PageInfo) Validate() error

Validate checks the field values on PageInfo with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type PageInfoValidationError

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

PageInfoValidationError is the validation error returned by PageInfo.Validate if the designated constraints aren't met.

func (PageInfoValidationError) Cause

func (e PageInfoValidationError) Cause() error

Cause function returns cause value.

func (PageInfoValidationError) Error

func (e PageInfoValidationError) Error() string

Error satisfies the builtin error interface

func (PageInfoValidationError) ErrorName

func (e PageInfoValidationError) ErrorName() string

ErrorName returns error name.

func (PageInfoValidationError) Field

func (e PageInfoValidationError) Field() string

Field function returns field value.

func (PageInfoValidationError) Key

func (e PageInfoValidationError) Key() bool

Key function returns key value.

func (PageInfoValidationError) Reason

func (e PageInfoValidationError) Reason() string

Reason function returns reason value.

type UnimplementedUserServer

type UnimplementedUserServer struct {
}

UnimplementedUserServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServer) CreateUser

func (UnimplementedUserServer) GetUserList

type UnsafeUserServer

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

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

type UserClient

type UserClient interface {
	GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserResponseList, error)
	CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, error)
}

UserClient is the client API for User 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 NewUserClient

func NewUserClient(cc grpc.ClientConnInterface) UserClient

type UserInfoResponse

type UserInfoResponse struct {
	Id       int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Mobile   string `protobuf:"bytes,2,opt,name=mobile,proto3" json:"mobile,omitempty"`
	NickName string `protobuf:"bytes,3,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"`
	Birthday string `protobuf:"bytes,4,opt,name=birthday,proto3" json:"birthday,omitempty"`
	Gender   int32  `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"`
	Role     int32  `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"`
	// contains filtered or unexported fields
}

func (*UserInfoResponse) Descriptor deprecated

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

Deprecated: Use UserInfoResponse.ProtoReflect.Descriptor instead.

func (*UserInfoResponse) GetBirthday

func (x *UserInfoResponse) GetBirthday() string

func (*UserInfoResponse) GetGender

func (x *UserInfoResponse) GetGender() int32

func (*UserInfoResponse) GetId

func (x *UserInfoResponse) GetId() int32

func (*UserInfoResponse) GetMobile

func (x *UserInfoResponse) GetMobile() string

func (*UserInfoResponse) GetNickName

func (x *UserInfoResponse) GetNickName() string

func (*UserInfoResponse) GetRole

func (x *UserInfoResponse) GetRole() int32

func (*UserInfoResponse) ProtoMessage

func (*UserInfoResponse) ProtoMessage()

func (*UserInfoResponse) ProtoReflect

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

func (*UserInfoResponse) Reset

func (x *UserInfoResponse) Reset()

func (*UserInfoResponse) String

func (x *UserInfoResponse) String() string

func (*UserInfoResponse) Validate

func (m *UserInfoResponse) Validate() error

Validate checks the field values on UserInfoResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type UserInfoResponseValidationError

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

UserInfoResponseValidationError is the validation error returned by UserInfoResponse.Validate if the designated constraints aren't met.

func (UserInfoResponseValidationError) Cause

Cause function returns cause value.

func (UserInfoResponseValidationError) Error

Error satisfies the builtin error interface

func (UserInfoResponseValidationError) ErrorName

ErrorName returns error name.

func (UserInfoResponseValidationError) Field

Field function returns field value.

func (UserInfoResponseValidationError) Key

Key function returns key value.

func (UserInfoResponseValidationError) Reason

Reason function returns reason value.

type UserResponseList

type UserResponseList struct {
	Total int32               `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	Data  []*UserInfoResponse `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*UserResponseList) Descriptor deprecated

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

Deprecated: Use UserResponseList.ProtoReflect.Descriptor instead.

func (*UserResponseList) GetData

func (x *UserResponseList) GetData() []*UserInfoResponse

func (*UserResponseList) GetTotal

func (x *UserResponseList) GetTotal() int32

func (*UserResponseList) ProtoMessage

func (*UserResponseList) ProtoMessage()

func (*UserResponseList) ProtoReflect

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

func (*UserResponseList) Reset

func (x *UserResponseList) Reset()

func (*UserResponseList) String

func (x *UserResponseList) String() string

func (*UserResponseList) Validate

func (m *UserResponseList) Validate() error

Validate checks the field values on UserResponseList with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type UserResponseListValidationError

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

UserResponseListValidationError is the validation error returned by UserResponseList.Validate if the designated constraints aren't met.

func (UserResponseListValidationError) Cause

Cause function returns cause value.

func (UserResponseListValidationError) Error

Error satisfies the builtin error interface

func (UserResponseListValidationError) ErrorName

ErrorName returns error name.

func (UserResponseListValidationError) Field

Field function returns field value.

func (UserResponseListValidationError) Key

Key function returns key value.

func (UserResponseListValidationError) Reason

Reason function returns reason value.

type UserServer

type UserServer interface {
	GetUserList(context.Context, *PageInfo) (*UserResponseList, error)
	CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error)
	// contains filtered or unexported methods
}

UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility

type UserServiceErrorReason

type UserServiceErrorReason int32
const (
	UserServiceErrorReason_USER_NOT_FOUND  UserServiceErrorReason = 0
	UserServiceErrorReason_CONTENT_MISSING UserServiceErrorReason = 1
)

func (UserServiceErrorReason) Descriptor

func (UserServiceErrorReason) Enum

func (UserServiceErrorReason) EnumDescriptor deprecated

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

Deprecated: Use UserServiceErrorReason.Descriptor instead.

func (UserServiceErrorReason) Number

func (UserServiceErrorReason) String

func (x UserServiceErrorReason) String() string

func (UserServiceErrorReason) Type

Jump to

Keyboard shortcuts

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