user

package
v1.0.28 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Result_name = map[int32]string{
		0: "OK",
		1: "FAIL",
	}
	Result_value = map[string]int32{
		"OK":   0,
		"FAIL": 1,
	}
)

Enum value maps for Result.

Functions

func RegisterUserGrpcServer

func RegisterUserGrpcServer(s *grpc.Server, srv UserGrpcServer)

Types

type Result

type Result int32
const (
	Result_OK   Result = 0
	Result_FAIL Result = 1
)

func (Result) Descriptor

func (Result) Descriptor() protoreflect.EnumDescriptor

func (Result) Enum

func (x Result) Enum() *Result

func (Result) EnumDescriptor deprecated

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

Deprecated: Use Result.Descriptor instead.

func (Result) Number

func (x Result) Number() protoreflect.EnumNumber

func (Result) String

func (x Result) String() string

func (Result) Type

func (Result) Type() protoreflect.EnumType

type UnimplementedUserGrpcServer

type UnimplementedUserGrpcServer struct {
}

UnimplementedUserGrpcServer can be embedded to have forward compatible implementations.

func (*UnimplementedUserGrpcServer) Delete

func (*UnimplementedUserGrpcServer) Get added in v1.0.20

func (*UnimplementedUserGrpcServer) Login

func (*UnimplementedUserGrpcServer) Logout

func (*UnimplementedUserGrpcServer) Register

func (*UnimplementedUserGrpcServer) Update

type UserGrpcClient

type UserGrpcClient interface {
	Register(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error)
	Login(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error)
	Logout(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error)
	Update(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error)
	Delete(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error)
	Get(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error)
}

UserGrpcClient is the client API for UserGrpc service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewUserGrpcClient

func NewUserGrpcClient(cc grpc.ClientConnInterface) UserGrpcClient

type UserGrpcServer

UserGrpcServer is the server API for UserGrpc service.

type UserRequest added in v1.0.10

type UserRequest struct {
	ClientName string `protobuf:"bytes,1,opt,name=client_name,json=clientName,proto3" json:"client_name,omitempty"` // 微服务名称
	Data       []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`                               // json序列化数据
	// contains filtered or unexported fields
}

message 可理解为golang中的struct,可嵌套 message 名称首字母大写,驼峰格式 内部变量小写,下划线连接

func (*UserRequest) Descriptor deprecated added in v1.0.10

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

Deprecated: Use UserRequest.ProtoReflect.Descriptor instead.

func (*UserRequest) GetClientName added in v1.0.10

func (x *UserRequest) GetClientName() string

func (*UserRequest) GetData added in v1.0.10

func (x *UserRequest) GetData() []byte

func (*UserRequest) ProtoMessage added in v1.0.10

func (*UserRequest) ProtoMessage()

func (*UserRequest) ProtoReflect added in v1.0.10

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

func (*UserRequest) Reset added in v1.0.10

func (x *UserRequest) Reset()

func (*UserRequest) String added in v1.0.10

func (x *UserRequest) String() string

type UserResponse added in v1.0.10

type UserResponse struct {
	Result  Result `protobuf:"varint,1,opt,name=result,proto3,enum=Result" json:"result,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Data    []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*UserResponse) Descriptor deprecated added in v1.0.10

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

Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.

func (*UserResponse) GetData added in v1.0.10

func (x *UserResponse) GetData() []byte

func (*UserResponse) GetMessage added in v1.0.20

func (x *UserResponse) GetMessage() string

func (*UserResponse) GetResult added in v1.0.10

func (x *UserResponse) GetResult() Result

func (*UserResponse) ProtoMessage added in v1.0.10

func (*UserResponse) ProtoMessage()

func (*UserResponse) ProtoReflect added in v1.0.10

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

func (*UserResponse) Reset added in v1.0.10

func (x *UserResponse) Reset()

func (*UserResponse) String added in v1.0.10

func (x *UserResponse) String() string

Jump to

Keyboard shortcuts

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