v1

package
v0.0.0-...-9def770 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	User_Create_FullMethodName = "/user.v1.User/Create"
	User_Get_FullMethodName    = "/user.v1.User/Get"
)
View Source
const OperationUserCreate = "/user.v1.User/Create"
View Source
const OperationUserGet = "/user.v1.User/Get"

Variables

View Source
var (
	ErrorReason_name = map[int32]string{
		0: "GREETER_UNSPECIFIED",
		1: "USER_NOT_FOUND",
	}
	ErrorReason_value = map[string]int32{
		"GREETER_UNSPECIFIED": 0,
		"USER_NOT_FOUND":      1,
	}
)

Enum value maps for ErrorReason.

View Source
var File_user_v1_error_reason_proto protoreflect.FileDescriptor
View Source
var File_user_v1_user_proto protoreflect.FileDescriptor
View Source
var User_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "user.v1.User",
	HandlerType: (*UserServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _User_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _User_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "user/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 RegisterUserHTTPServer

func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer)

func RegisterUserServer

func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)

Types

type CreateUserReply

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

func (*CreateUserReply) Descriptor deprecated

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

Deprecated: Use CreateUserReply.ProtoReflect.Descriptor instead.

func (*CreateUserReply) GetId

func (x *CreateUserReply) GetId() uint64

func (*CreateUserReply) ProtoMessage

func (*CreateUserReply) ProtoMessage()

func (*CreateUserReply) ProtoReflect

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

func (*CreateUserReply) Reset

func (x *CreateUserReply) Reset()

func (*CreateUserReply) String

func (x *CreateUserReply) String() string

type CreateUserRequest

type CreateUserRequest struct {
	Meta        *v1.ObjectMeta         `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	Status      int32                  `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	Nickname    string                 `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"`
	Password    string                 `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	Email       string                 `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"`
	Phone       string                 `protobuf:"bytes,6,opt,name=phone,proto3" json:"phone,omitempty"`
	IsAdmin     int32                  `protobuf:"varint,7,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"`
	TotalPolicy int64                  `protobuf:"varint,8,opt,name=total_policy,json=totalPolicy,proto3" json:"total_policy,omitempty"`
	LoginAt     *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=login_at,json=loginAt,proto3" json:"login_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUserRequest) Descriptor deprecated

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

Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.

func (*CreateUserRequest) GetEmail

func (x *CreateUserRequest) GetEmail() string

func (*CreateUserRequest) GetIsAdmin

func (x *CreateUserRequest) GetIsAdmin() int32

func (*CreateUserRequest) GetLoginAt

func (x *CreateUserRequest) GetLoginAt() *timestamppb.Timestamp

func (*CreateUserRequest) GetMeta

func (x *CreateUserRequest) GetMeta() *v1.ObjectMeta

func (*CreateUserRequest) GetNickname

func (x *CreateUserRequest) GetNickname() string

func (*CreateUserRequest) GetPassword

func (x *CreateUserRequest) GetPassword() string

func (*CreateUserRequest) GetPhone

func (x *CreateUserRequest) GetPhone() string

func (*CreateUserRequest) GetStatus

func (x *CreateUserRequest) GetStatus() int32

func (*CreateUserRequest) GetTotalPolicy

func (x *CreateUserRequest) GetTotalPolicy() int64

func (*CreateUserRequest) ProtoMessage

func (*CreateUserRequest) ProtoMessage()

func (*CreateUserRequest) ProtoReflect

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

func (*CreateUserRequest) Reset

func (x *CreateUserRequest) Reset()

func (*CreateUserRequest) String

func (x *CreateUserRequest) String() string

type ErrorReason

type ErrorReason int32
const (
	ErrorReason_GREETER_UNSPECIFIED ErrorReason = 0
	ErrorReason_USER_NOT_FOUND      ErrorReason = 1
)

func (ErrorReason) Descriptor

func (ErrorReason) Enum

func (x ErrorReason) Enum() *ErrorReason

func (ErrorReason) EnumDescriptor deprecated

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

Deprecated: Use ErrorReason.Descriptor instead.

func (ErrorReason) Number

func (x ErrorReason) Number() protoreflect.EnumNumber

func (ErrorReason) String

func (x ErrorReason) String() string

func (ErrorReason) Type

type GetUserRequest

type GetUserRequest struct {
	Id       uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"`
	Email    string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	Phone    string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	Status   int32  `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserRequest) Descriptor deprecated

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

Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.

func (*GetUserRequest) GetEmail

func (x *GetUserRequest) GetEmail() string

func (*GetUserRequest) GetId

func (x *GetUserRequest) GetId() uint64

func (*GetUserRequest) GetNickname

func (x *GetUserRequest) GetNickname() string

func (*GetUserRequest) GetPhone

func (x *GetUserRequest) GetPhone() string

func (*GetUserRequest) GetStatus

func (x *GetUserRequest) GetStatus() int32

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) ProtoReflect

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

func (*GetUserRequest) Reset

func (x *GetUserRequest) Reset()

func (*GetUserRequest) String

func (x *GetUserRequest) String() string

type UnimplementedUserServer

type UnimplementedUserServer struct {
}

UnimplementedUserServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServer) Create

func (UnimplementedUserServer) Get

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 {
	Create(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserReply, error)
	Get(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*UserReply, 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 UserHTTPClient

type UserHTTPClient interface {
	Create(ctx context.Context, req *CreateUserRequest, opts ...http.CallOption) (rsp *CreateUserReply, err error)
	Get(ctx context.Context, req *GetUserRequest, opts ...http.CallOption) (rsp *UserReply, err error)
}

func NewUserHTTPClient

func NewUserHTTPClient(client *http.Client) UserHTTPClient

type UserHTTPClientImpl

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

func (*UserHTTPClientImpl) Create

func (*UserHTTPClientImpl) Get

type UserHTTPServer

type UserHTTPServer interface {
	Create(context.Context, *CreateUserRequest) (*CreateUserReply, error)
	Get(context.Context, *GetUserRequest) (*UserReply, error)
}

type UserReply

type UserReply struct {
	Meta        *v1.ObjectMeta         `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	Status      int32                  `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	Nickname    string                 `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"`
	Email       string                 `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"`
	Phone       string                 `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"`
	IsAdmin     int32                  `protobuf:"varint,6,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"`
	TotalPolicy int64                  `protobuf:"varint,7,opt,name=total_policy,json=totalPolicy,proto3" json:"total_policy,omitempty"`
	LoginAt     *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=login_at,json=loginAt,proto3" json:"login_at,omitempty"`
	// contains filtered or unexported fields
}

func (*UserReply) Descriptor deprecated

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

Deprecated: Use UserReply.ProtoReflect.Descriptor instead.

func (*UserReply) GetEmail

func (x *UserReply) GetEmail() string

func (*UserReply) GetIsAdmin

func (x *UserReply) GetIsAdmin() int32

func (*UserReply) GetLoginAt

func (x *UserReply) GetLoginAt() *timestamppb.Timestamp

func (*UserReply) GetMeta

func (x *UserReply) GetMeta() *v1.ObjectMeta

func (*UserReply) GetNickname

func (x *UserReply) GetNickname() string

func (*UserReply) GetPhone

func (x *UserReply) GetPhone() string

func (*UserReply) GetStatus

func (x *UserReply) GetStatus() int32

func (*UserReply) GetTotalPolicy

func (x *UserReply) GetTotalPolicy() int64

func (*UserReply) ProtoMessage

func (*UserReply) ProtoMessage()

func (*UserReply) ProtoReflect

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

func (*UserReply) Reset

func (x *UserReply) Reset()

func (*UserReply) String

func (x *UserReply) String() string

type UserServer

type UserServer interface {
	Create(context.Context, *CreateUserRequest) (*CreateUserReply, error)
	Get(context.Context, *GetUserRequest) (*UserReply, error)
	// contains filtered or unexported methods
}

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

Jump to

Keyboard shortcuts

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