grpc

package
v0.0.0-...-32fa971 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

* * Generated by go-doudou v2.0.1. * Don't edit!

Index

Constants

This section is empty.

Variables

View Source
var File_transport_grpc_usersvc_proto protoreflect.FileDescriptor
View Source
var MethodAnnotationStore = framework.AnnotationStore{
	"GetUserRpc": {
		{
			Name: "@role",
			Params: []string{
				"USER",
			},
		},
	},
	"GetMeRpc": {
		{
			Name: "@role",
			Params: []string{
				"USER",
			},
		},
	},
	"GetLogoutRpc": {
		{
			Name: "@role",
			Params: []string{
				"USER",
			},
		},
	},
}
View Source
var UsersvcService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "usersvc.UsersvcService",
	HandlerType: (*UsersvcServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUserRpc",
			Handler:    _UsersvcService_GetUserRpc_Handler,
		},
		{
			MethodName: "GetMeRpc",
			Handler:    _UsersvcService_GetMeRpc_Handler,
		},
		{
			MethodName: "SignUpRpc",
			Handler:    _UsersvcService_SignUpRpc_Handler,
		},
		{
			MethodName: "LogInRpc",
			Handler:    _UsersvcService_LogInRpc_Handler,
		},
		{
			MethodName: "GetLogoutRpc",
			Handler:    _UsersvcService_GetLogoutRpc_Handler,
		},
		{
			MethodName: "GetTokenValidateRpc",
			Handler:    _UsersvcService_GetTokenValidateRpc_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "transport/grpc/usersvc.proto",
}

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

Functions

func RegisterUsersvcServiceServer

func RegisterUsersvcServiceServer(s grpc.ServiceRegistrar, srv UsersvcServiceServer)

Types

type GetLogoutRpcResponse

type GetLogoutRpcResponse struct {

	// 成功返回OK
	// return OK if success
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLogoutRpcResponse) Descriptor deprecated

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

Deprecated: Use GetLogoutRpcResponse.ProtoReflect.Descriptor instead.

func (*GetLogoutRpcResponse) GetData

func (x *GetLogoutRpcResponse) GetData() string

func (*GetLogoutRpcResponse) ProtoMessage

func (*GetLogoutRpcResponse) ProtoMessage()

func (*GetLogoutRpcResponse) ProtoReflect

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

func (*GetLogoutRpcResponse) Reset

func (x *GetLogoutRpcResponse) Reset()

func (*GetLogoutRpcResponse) String

func (x *GetLogoutRpcResponse) String() string

type GetTokenValidateRpcRequest

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

func (*GetTokenValidateRpcRequest) Descriptor deprecated

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

Deprecated: Use GetTokenValidateRpcRequest.ProtoReflect.Descriptor instead.

func (*GetTokenValidateRpcRequest) GetToken

func (x *GetTokenValidateRpcRequest) GetToken() string

func (*GetTokenValidateRpcRequest) ProtoMessage

func (*GetTokenValidateRpcRequest) ProtoMessage()

func (*GetTokenValidateRpcRequest) ProtoReflect

func (*GetTokenValidateRpcRequest) Reset

func (x *GetTokenValidateRpcRequest) Reset()

func (*GetTokenValidateRpcRequest) String

func (x *GetTokenValidateRpcRequest) String() string

type GetUserRpcRequest

type GetUserRpcRequest struct {

	// 用户ID
	// user id
	UserId int32 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserRpcRequest) Descriptor deprecated

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

Deprecated: Use GetUserRpcRequest.ProtoReflect.Descriptor instead.

func (*GetUserRpcRequest) GetUserId

func (x *GetUserRpcRequest) GetUserId() int32

func (*GetUserRpcRequest) ProtoMessage

func (*GetUserRpcRequest) ProtoMessage()

func (*GetUserRpcRequest) ProtoReflect

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

func (*GetUserRpcRequest) Reset

func (x *GetUserRpcRequest) Reset()

func (*GetUserRpcRequest) String

func (x *GetUserRpcRequest) String() string

type LogInRpcRequest

type LogInRpcRequest struct {

	// 用户名
	// username
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// 密码
	// password
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*LogInRpcRequest) Descriptor deprecated

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

Deprecated: Use LogInRpcRequest.ProtoReflect.Descriptor instead.

func (*LogInRpcRequest) GetPassword

func (x *LogInRpcRequest) GetPassword() string

func (*LogInRpcRequest) GetUsername

func (x *LogInRpcRequest) GetUsername() string

func (*LogInRpcRequest) ProtoMessage

func (*LogInRpcRequest) ProtoMessage()

func (*LogInRpcRequest) ProtoReflect

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

func (*LogInRpcRequest) Reset

func (x *LogInRpcRequest) Reset()

func (*LogInRpcRequest) String

func (x *LogInRpcRequest) String() string

type LogInRpcResponse

type LogInRpcResponse struct {

	// token
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*LogInRpcResponse) Descriptor deprecated

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

Deprecated: Use LogInRpcResponse.ProtoReflect.Descriptor instead.

func (*LogInRpcResponse) GetData

func (x *LogInRpcResponse) GetData() string

func (*LogInRpcResponse) ProtoMessage

func (*LogInRpcResponse) ProtoMessage()

func (*LogInRpcResponse) ProtoReflect

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

func (*LogInRpcResponse) Reset

func (x *LogInRpcResponse) Reset()

func (*LogInRpcResponse) String

func (x *LogInRpcResponse) String() string

type Order

type Order struct {
	Col  string `protobuf:"bytes,1,opt,name=col,proto3" json:"col,omitempty"`
	Sort string `protobuf:"bytes,2,opt,name=sort,proto3" json:"sort,omitempty"`
	// contains filtered or unexported fields
}

func (*Order) Descriptor deprecated

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

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetCol

func (x *Order) GetCol() string

func (*Order) GetSort

func (x *Order) GetSort() string

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

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

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

type Page

type Page struct {

	// 排序规则
	Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
	// 页码
	PageNo int32 `protobuf:"varint,2,opt,name=pageNo,proto3" json:"pageNo,omitempty"`
	// 每页行数
	Size int32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*Page) Descriptor deprecated

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

Deprecated: Use Page.ProtoReflect.Descriptor instead.

func (*Page) GetOrders

func (x *Page) GetOrders() []*Order

func (*Page) GetPageNo

func (x *Page) GetPageNo() int32

func (*Page) GetSize

func (x *Page) GetSize() int32

func (*Page) ProtoMessage

func (*Page) ProtoMessage()

func (*Page) ProtoReflect

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

func (*Page) Reset

func (x *Page) Reset()

func (*Page) String

func (x *Page) String() string

type PageFilter

type PageFilter struct {

	// 真实姓名,前缀匹配
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// 所属部门
	Dept string `protobuf:"bytes,2,opt,name=dept,proto3" json:"dept,omitempty"`
	// contains filtered or unexported fields
}

func (*PageFilter) Descriptor deprecated

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

Deprecated: Use PageFilter.ProtoReflect.Descriptor instead.

func (*PageFilter) GetDept

func (x *PageFilter) GetDept() string

func (*PageFilter) GetName

func (x *PageFilter) GetName() string

func (*PageFilter) ProtoMessage

func (*PageFilter) ProtoMessage()

func (*PageFilter) ProtoReflect

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

func (*PageFilter) Reset

func (x *PageFilter) Reset()

func (*PageFilter) String

func (x *PageFilter) String() string

type PageQuery

type PageQuery struct {
	Filter *PageFilter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
	Page   *Page       `protobuf:"bytes,2,opt,name=page,proto3" json:"page,omitempty"`
	// contains filtered or unexported fields
}

分页筛选条件

func (*PageQuery) Descriptor deprecated

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

Deprecated: Use PageQuery.ProtoReflect.Descriptor instead.

func (*PageQuery) GetFilter

func (x *PageQuery) GetFilter() *PageFilter

func (*PageQuery) GetPage

func (x *PageQuery) GetPage() *Page

func (*PageQuery) ProtoMessage

func (*PageQuery) ProtoMessage()

func (*PageQuery) ProtoReflect

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

func (*PageQuery) Reset

func (x *PageQuery) Reset()

func (*PageQuery) String

func (x *PageQuery) String() string

type PageRet

type PageRet struct {
	Items    *anypb.Any `protobuf:"bytes,1,opt,name=items,proto3" json:"items,omitempty"`
	PageNo   int32      `protobuf:"varint,2,opt,name=pageNo,proto3" json:"pageNo,omitempty"`
	PageSize int32      `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
	Total    int32      `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"`
	HasNext  bool       `protobuf:"varint,5,opt,name=hasNext,proto3" json:"hasNext,omitempty"`
	// contains filtered or unexported fields
}

func (*PageRet) Descriptor deprecated

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

Deprecated: Use PageRet.ProtoReflect.Descriptor instead.

func (*PageRet) GetHasNext

func (x *PageRet) GetHasNext() bool

func (*PageRet) GetItems

func (x *PageRet) GetItems() *anypb.Any

func (*PageRet) GetPageNo

func (x *PageRet) GetPageNo() int32

func (*PageRet) GetPageSize

func (x *PageRet) GetPageSize() int32

func (*PageRet) GetTotal

func (x *PageRet) GetTotal() int32

func (*PageRet) ProtoMessage

func (*PageRet) ProtoMessage()

func (*PageRet) ProtoReflect

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

func (*PageRet) Reset

func (x *PageRet) Reset()

func (*PageRet) String

func (x *PageRet) String() string

type SignUpRpcRequest

type SignUpRpcRequest struct {

	// 用户名
	// username
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// 密码
	// password
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*SignUpRpcRequest) Descriptor deprecated

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

Deprecated: Use SignUpRpcRequest.ProtoReflect.Descriptor instead.

func (*SignUpRpcRequest) GetPassword

func (x *SignUpRpcRequest) GetPassword() string

func (*SignUpRpcRequest) GetUsername

func (x *SignUpRpcRequest) GetUsername() string

func (*SignUpRpcRequest) ProtoMessage

func (*SignUpRpcRequest) ProtoMessage()

func (*SignUpRpcRequest) ProtoReflect

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

func (*SignUpRpcRequest) Reset

func (x *SignUpRpcRequest) Reset()

func (*SignUpRpcRequest) String

func (x *SignUpRpcRequest) String() string

type SignUpRpcResponse

type SignUpRpcResponse struct {

	// 成功返回用户ID
	// return user ID if success
	Data int32 `protobuf:"varint,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*SignUpRpcResponse) Descriptor deprecated

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

Deprecated: Use SignUpRpcResponse.ProtoReflect.Descriptor instead.

func (*SignUpRpcResponse) GetData

func (x *SignUpRpcResponse) GetData() int32

func (*SignUpRpcResponse) ProtoMessage

func (*SignUpRpcResponse) ProtoMessage()

func (*SignUpRpcResponse) ProtoReflect

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

func (*SignUpRpcResponse) Reset

func (x *SignUpRpcResponse) Reset()

func (*SignUpRpcResponse) String

func (x *SignUpRpcResponse) String() string

type UnimplementedUsersvcServiceServer

type UnimplementedUsersvcServiceServer struct {
}

UnimplementedUsersvcServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUsersvcServiceServer) GetLogoutRpc

func (UnimplementedUsersvcServiceServer) GetMeRpc

func (UnimplementedUsersvcServiceServer) GetTokenValidateRpc

func (UnimplementedUsersvcServiceServer) GetUserRpc

func (UnimplementedUsersvcServiceServer) LogInRpc

func (UnimplementedUsersvcServiceServer) SignUpRpc

type UnsafeUsersvcServiceServer

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

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

type UserVo

type UserVo struct {
	Id       int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Name     string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Phone    string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	Dept     string `protobuf:"bytes,5,opt,name=dept,proto3" json:"dept,omitempty"`
	// contains filtered or unexported fields
}

func (*UserVo) Descriptor deprecated

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

Deprecated: Use UserVo.ProtoReflect.Descriptor instead.

func (*UserVo) GetDept

func (x *UserVo) GetDept() string

func (*UserVo) GetId

func (x *UserVo) GetId() int32

func (*UserVo) GetName

func (x *UserVo) GetName() string

func (*UserVo) GetPhone

func (x *UserVo) GetPhone() string

func (*UserVo) GetUsername

func (x *UserVo) GetUsername() string

func (*UserVo) ProtoMessage

func (*UserVo) ProtoMessage()

func (*UserVo) ProtoReflect

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

func (*UserVo) Reset

func (x *UserVo) Reset()

func (*UserVo) String

func (x *UserVo) String() string

type UsersvcServiceClient

type UsersvcServiceClient interface {
	// GetUser 用户详情接口
	// 展示如何定义带查询字符串参数的GET请求接口
	// GetUser is user detail api
	// demo how to define get http request with query string parameters
	// @role(USER)
	GetUserRpc(ctx context.Context, in *GetUserRpcRequest, opts ...grpc.CallOption) (*UserVo, error)
	// GetMe 获取当前登录用户详情接口
	// GetMe is used for getting user info from token in header.
	// @role(USER)
	GetMeRpc(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserVo, error)
	// PublicSignUp 用户注册接口
	// 展示如何定义POST请求且Content-Type是application/x-www-form-urlencoded的接口
	// PublicSignUp is user signup api
	// demo how to define post request api which accepts application/x-www-form-urlencoded content-type
	SignUpRpc(ctx context.Context, in *SignUpRpcRequest, opts ...grpc.CallOption) (*SignUpRpcResponse, error)
	// PublicLogIn 用户登录接口
	// 展示如何鉴权并返回token
	// PublicLogIn is user login api
	// demo how to do authentication and issue token
	LogInRpc(ctx context.Context, in *LogInRpcRequest, opts ...grpc.CallOption) (*LogInRpcResponse, error)
	// GetLogout 注销token
	// GetLogout is used for revoking a token
	// https://github.com/dgrijalva/jwt-go/issues/214
	// @role(USER)
	GetLogoutRpc(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetLogoutRpcResponse, error)
	// PublicTokenValidate token校验接口
	// 如果token有效,返回用户信息,否则返回空对象
	// PublicTokenValidate validates token string
	// if token is valid, return user information, otherwise, return empty data
	GetTokenValidateRpc(ctx context.Context, in *GetTokenValidateRpcRequest, opts ...grpc.CallOption) (*UserVo, error)
}

UsersvcServiceClient is the client API for UsersvcService 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 UsersvcServiceServer

type UsersvcServiceServer interface {
	// GetUser 用户详情接口
	// 展示如何定义带查询字符串参数的GET请求接口
	// GetUser is user detail api
	// demo how to define get http request with query string parameters
	// @role(USER)
	GetUserRpc(context.Context, *GetUserRpcRequest) (*UserVo, error)
	// GetMe 获取当前登录用户详情接口
	// GetMe is used for getting user info from token in header.
	// @role(USER)
	GetMeRpc(context.Context, *emptypb.Empty) (*UserVo, error)
	// PublicSignUp 用户注册接口
	// 展示如何定义POST请求且Content-Type是application/x-www-form-urlencoded的接口
	// PublicSignUp is user signup api
	// demo how to define post request api which accepts application/x-www-form-urlencoded content-type
	SignUpRpc(context.Context, *SignUpRpcRequest) (*SignUpRpcResponse, error)
	// PublicLogIn 用户登录接口
	// 展示如何鉴权并返回token
	// PublicLogIn is user login api
	// demo how to do authentication and issue token
	LogInRpc(context.Context, *LogInRpcRequest) (*LogInRpcResponse, error)
	// GetLogout 注销token
	// GetLogout is used for revoking a token
	// https://github.com/dgrijalva/jwt-go/issues/214
	// @role(USER)
	GetLogoutRpc(context.Context, *emptypb.Empty) (*GetLogoutRpcResponse, error)
	// PublicTokenValidate token校验接口
	// 如果token有效,返回用户信息,否则返回空对象
	// PublicTokenValidate validates token string
	// if token is valid, return user information, otherwise, return empty data
	GetTokenValidateRpc(context.Context, *GetTokenValidateRpcRequest) (*UserVo, error)
	// contains filtered or unexported methods
}

UsersvcServiceServer is the server API for UsersvcService service. All implementations must embed UnimplementedUsersvcServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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