proto

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GRPCConn *grpc.ClientConn
View Source
var MsgService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.MsgService",
	HandlerType: (*MsgServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendMsgCode",
			Handler:    _MsgService_SendMsgCode_Handler,
		},
		{
			MethodName: "CheckMsgCode",
			Handler:    _MsgService_CheckMsgCode_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "base.proto",
}

MsgService_ServiceDesc is the grpc.ServiceDesc for MsgService 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 UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetByID",
			Handler:    _UserService_GetByID_Handler,
		},
		{
			MethodName: "GetIDByMobile",
			Handler:    _UserService_GetIDByMobile_Handler,
		},
		{
			MethodName: "GetInfoByToken",
			Handler:    _UserService_GetInfoByToken_Handler,
		},
		{
			MethodName: "Login",
			Handler:    _UserService_Login_Handler,
		},
		{
			MethodName: "ExpireToken",
			Handler:    _UserService_ExpireToken_Handler,
		},
		{
			MethodName: "UpdateMobile",
			Handler:    _UserService_UpdateMobile_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListByIDs",
			Handler:       _UserService_ListByIDs_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "base.proto",
}

UserService_ServiceDesc is the grpc.ServiceDesc for UserService 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 WechatService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.WechatService",
	HandlerType: (*WechatServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _WechatService_Login_Handler,
		},
		{
			MethodName: "GetAccessToken",
			Handler:    _WechatService_GetAccessToken_Handler,
		},
		{
			MethodName: "GetAccessTokenFromUser",
			Handler:    _WechatService_GetAccessTokenFromUser_Handler,
		},
		{
			MethodName: "BindUser",
			Handler:    _WechatService_BindUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "base.proto",
}

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

Functions

func GRPCConnect

func GRPCConnect()

func RegisterMsgServiceServer

func RegisterMsgServiceServer(s grpc.ServiceRegistrar, srv MsgServiceServer)

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

func RegisterWechatServiceServer

func RegisterWechatServiceServer(s grpc.ServiceRegistrar, srv WechatServiceServer)

Types

type AppID

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

func (*AppID) Descriptor deprecated

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

Deprecated: Use AppID.ProtoReflect.Descriptor instead.

func (*AppID) GetAppID

func (x *AppID) GetAppID() string

func (*AppID) ProtoMessage

func (*AppID) ProtoMessage()

func (*AppID) ProtoReflect

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

func (*AppID) Reset

func (x *AppID) Reset()

func (*AppID) String

func (x *AppID) String() string

type BoolF

type BoolF struct {
	F bool `protobuf:"varint,1,opt,name=f,proto3" json:"f,omitempty"`
	// contains filtered or unexported fields
}

func (*BoolF) Descriptor deprecated

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

Deprecated: Use BoolF.ProtoReflect.Descriptor instead.

func (*BoolF) GetF

func (x *BoolF) GetF() bool

func (*BoolF) ProtoMessage

func (*BoolF) ProtoMessage()

func (*BoolF) ProtoReflect

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

func (*BoolF) Reset

func (x *BoolF) Reset()

func (*BoolF) String

func (x *BoolF) String() string

type Code

type Code struct {
	Code  string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	AppID string `protobuf:"bytes,2,opt,name=appID,proto3" json:"appID,omitempty"`
	// contains filtered or unexported fields
}

func (*Code) Descriptor deprecated

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

Deprecated: Use Code.ProtoReflect.Descriptor instead.

func (*Code) GetAppID

func (x *Code) GetAppID() string

func (*Code) GetCode

func (x *Code) GetCode() string

func (*Code) ProtoMessage

func (*Code) ProtoMessage()

func (*Code) ProtoReflect

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

func (*Code) Reset

func (x *Code) Reset()

func (*Code) String

func (x *Code) String() string

type Info

type Info struct {
	UserID uint32 `protobuf:"varint,1,opt,name=userID,proto3" json:"userID,omitempty"`
	OpenID string `protobuf:"bytes,2,opt,name=openID,proto3" json:"openID,omitempty"`
	// contains filtered or unexported fields
}

func (*Info) Descriptor deprecated

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

Deprecated: Use Info.ProtoReflect.Descriptor instead.

func (*Info) GetOpenID

func (x *Info) GetOpenID() string

func (*Info) GetUserID

func (x *Info) GetUserID() uint32

func (*Info) ProtoMessage

func (*Info) ProtoMessage()

func (*Info) ProtoReflect

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

func (*Info) Reset

func (x *Info) Reset()

func (*Info) String

func (x *Info) String() string

type Login

type Login struct {
	LoginType uint32 `protobuf:"varint,1,opt,name=LoginType,proto3" json:"LoginType,omitempty"`
	Device    string `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"`
	Mobile    string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"`
	Code      string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*Login) Descriptor deprecated

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

Deprecated: Use Login.ProtoReflect.Descriptor instead.

func (*Login) GetCode

func (x *Login) GetCode() string

func (*Login) GetDevice

func (x *Login) GetDevice() string

func (*Login) GetLoginType

func (x *Login) GetLoginType() uint32

func (*Login) GetMobile

func (x *Login) GetMobile() string

func (*Login) ProtoMessage

func (*Login) ProtoMessage()

func (*Login) ProtoReflect

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

func (*Login) Reset

func (x *Login) Reset()

func (*Login) String

func (x *Login) String() string

type Mobile

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

func (*Mobile) Descriptor deprecated

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

Deprecated: Use Mobile.ProtoReflect.Descriptor instead.

func (*Mobile) GetMobile

func (x *Mobile) GetMobile() string

func (*Mobile) ProtoMessage

func (*Mobile) ProtoMessage()

func (*Mobile) ProtoReflect

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

func (*Mobile) Reset

func (x *Mobile) Reset()

func (*Mobile) String

func (x *Mobile) String() string

type Msg

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

func (*Msg) Descriptor deprecated

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

Deprecated: Use Msg.ProtoReflect.Descriptor instead.

func (*Msg) GetMsg

func (x *Msg) GetMsg() string

func (*Msg) ProtoMessage

func (*Msg) ProtoMessage()

func (*Msg) ProtoReflect

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

func (*Msg) Reset

func (x *Msg) Reset()

func (*Msg) String

func (x *Msg) String() string

type MsgCode

type MsgCode struct {
	Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"`
	Code   string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*MsgCode) Descriptor deprecated

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

Deprecated: Use MsgCode.ProtoReflect.Descriptor instead.

func (*MsgCode) GetCode

func (x *MsgCode) GetCode() string

func (*MsgCode) GetMobile

func (x *MsgCode) GetMobile() string

func (*MsgCode) ProtoMessage

func (*MsgCode) ProtoMessage()

func (*MsgCode) ProtoReflect

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

func (*MsgCode) Reset

func (x *MsgCode) Reset()

func (*MsgCode) String

func (x *MsgCode) String() string

type MsgCodeBack

type MsgCodeBack struct {
	Msg  string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*MsgCodeBack) Descriptor deprecated

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

Deprecated: Use MsgCodeBack.ProtoReflect.Descriptor instead.

func (*MsgCodeBack) GetCode

func (x *MsgCodeBack) GetCode() string

func (*MsgCodeBack) GetMsg

func (x *MsgCodeBack) GetMsg() string

func (*MsgCodeBack) ProtoMessage

func (*MsgCodeBack) ProtoMessage()

func (*MsgCodeBack) ProtoReflect

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

func (*MsgCodeBack) Reset

func (x *MsgCodeBack) Reset()

func (*MsgCodeBack) String

func (x *MsgCodeBack) String() string

type MsgServiceClient

type MsgServiceClient interface {
	//  发送验证码
	SendMsgCode(ctx context.Context, in *Mobile, opts ...grpc.CallOption) (*MsgCodeBack, error)
	//  校验验证码
	CheckMsgCode(ctx context.Context, in *MsgCode, opts ...grpc.CallOption) (*BoolF, error)
}

MsgServiceClient is the client API for MsgService 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 NewMsgServiceClient

func NewMsgServiceClient(cc grpc.ClientConnInterface) MsgServiceClient

type MsgServiceServer

type MsgServiceServer interface {
	//  发送验证码
	SendMsgCode(context.Context, *Mobile) (*MsgCodeBack, error)
	//  校验验证码
	CheckMsgCode(context.Context, *MsgCode) (*BoolF, error)
	// contains filtered or unexported methods
}

MsgServiceServer is the server API for MsgService service. All implementations must embed UnimplementedMsgServiceServer for forward compatibility

type OpenID

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

func (*OpenID) Descriptor deprecated

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

Deprecated: Use OpenID.ProtoReflect.Descriptor instead.

func (*OpenID) GetId

func (x *OpenID) GetId() string

func (*OpenID) ProtoMessage

func (*OpenID) ProtoMessage()

func (*OpenID) ProtoReflect

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

func (*OpenID) Reset

func (x *OpenID) Reset()

func (*OpenID) String

func (x *OpenID) String() string

type Token

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

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetToken

func (x *Token) GetToken() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

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

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type UnimplementedMsgServiceServer

type UnimplementedMsgServiceServer struct {
}

UnimplementedMsgServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMsgServiceServer) CheckMsgCode

func (UnimplementedMsgServiceServer) SendMsgCode

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) ExpireToken

func (UnimplementedUserServiceServer) GetByID

func (UnimplementedUserServiceServer) GetIDByMobile

func (UnimplementedUserServiceServer) GetInfoByToken

func (UnimplementedUserServiceServer) ListByIDs

func (UnimplementedUserServiceServer) Login

func (UnimplementedUserServiceServer) UpdateMobile

type UnimplementedWechatServiceServer

type UnimplementedWechatServiceServer struct {
}

UnimplementedWechatServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedWechatServiceServer) BindUser

func (UnimplementedWechatServiceServer) GetAccessToken

func (UnimplementedWechatServiceServer) GetAccessTokenFromUser added in v0.3.0

func (UnimplementedWechatServiceServer) GetAccessTokenFromUser(context.Context, *AppID) (*Token, error)

func (UnimplementedWechatServiceServer) Login

type UnsafeMsgServiceServer

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

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

type UnsafeUserServiceServer

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

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

type UnsafeWechatServiceServer

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

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

type User

type User struct {
	Id     uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Mobile string `protobuf:"bytes,2,opt,name=mobile,proto3" json:"mobile,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetId

func (x *User) GetId() uint32

func (*User) GetMobile

func (x *User) GetMobile() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type UserID

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

func (*UserID) Descriptor deprecated

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

Deprecated: Use UserID.ProtoReflect.Descriptor instead.

func (*UserID) GetId

func (x *UserID) GetId() uint32

func (*UserID) ProtoMessage

func (*UserID) ProtoMessage()

func (*UserID) ProtoReflect

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

func (*UserID) Reset

func (x *UserID) Reset()

func (*UserID) String

func (x *UserID) String() string

type UserList

type UserList struct {
	U *User `protobuf:"bytes,1,opt,name=u,proto3" json:"u,omitempty"`
	// contains filtered or unexported fields
}

func (*UserList) Descriptor deprecated

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

Deprecated: Use UserList.ProtoReflect.Descriptor instead.

func (*UserList) GetU

func (x *UserList) GetU() *User

func (*UserList) ProtoMessage

func (*UserList) ProtoMessage()

func (*UserList) ProtoReflect

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

func (*UserList) Reset

func (x *UserList) Reset()

func (*UserList) String

func (x *UserList) String() string

type UserServiceClient

type UserServiceClient interface {
	GetByID(ctx context.Context, in *UserID, opts ...grpc.CallOption) (*User, error)
	GetIDByMobile(ctx context.Context, in *Mobile, opts ...grpc.CallOption) (*UserID, error)
	GetInfoByToken(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Info, error)
	ListByIDs(ctx context.Context, opts ...grpc.CallOption) (UserService_ListByIDsClient, error)
	//  登录
	Login(ctx context.Context, in *Login, opts ...grpc.CallOption) (*Token, error)
	//  刷新token
	ExpireToken(ctx context.Context, in *Token, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// 修改手机号
	UpdateMobile(ctx context.Context, in *User, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

UserServiceClient is the client API for UserService 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 UserServiceServer

type UserServiceServer interface {
	GetByID(context.Context, *UserID) (*User, error)
	GetIDByMobile(context.Context, *Mobile) (*UserID, error)
	GetInfoByToken(context.Context, *Token) (*Info, error)
	ListByIDs(UserService_ListByIDsServer) error
	//  登录
	Login(context.Context, *Login) (*Token, error)
	//  刷新token
	ExpireToken(context.Context, *Token) (*emptypb.Empty, error)
	// 修改手机号
	UpdateMobile(context.Context, *User) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility

type UserService_ListByIDsClient

type UserService_ListByIDsClient interface {
	Send(*UserID) error
	Recv() (*UserList, error)
	grpc.ClientStream
}

type UserService_ListByIDsServer

type UserService_ListByIDsServer interface {
	Send(*UserList) error
	Recv() (*UserID, error)
	grpc.ServerStream
}

type WechatLogin

type WechatLogin struct {
	AppID string `protobuf:"bytes,1,opt,name=appID,proto3" json:"appID,omitempty"`
	Code  string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	//  系统标识
	SysCode   uint32 `protobuf:"varint,3,opt,name=sysCode,proto3" json:"sysCode,omitempty"`
	LoginType uint32 `protobuf:"varint,4,opt,name=loginType,proto3" json:"loginType,omitempty"`
	// contains filtered or unexported fields
}

func (*WechatLogin) Descriptor deprecated

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

Deprecated: Use WechatLogin.ProtoReflect.Descriptor instead.

func (*WechatLogin) GetAppID

func (x *WechatLogin) GetAppID() string

func (*WechatLogin) GetCode

func (x *WechatLogin) GetCode() string

func (*WechatLogin) GetLoginType

func (x *WechatLogin) GetLoginType() uint32

func (*WechatLogin) GetSysCode

func (x *WechatLogin) GetSysCode() uint32

func (*WechatLogin) ProtoMessage

func (*WechatLogin) ProtoMessage()

func (*WechatLogin) ProtoReflect

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

func (*WechatLogin) Reset

func (x *WechatLogin) Reset()

func (*WechatLogin) String

func (x *WechatLogin) String() string

type WechatMobile

type WechatMobile struct {
	Mobile  string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"`
	OpenID  string `protobuf:"bytes,2,opt,name=openID,proto3" json:"openID,omitempty"`
	SysCode uint32 `protobuf:"varint,3,opt,name=sysCode,proto3" json:"sysCode,omitempty"`
	// contains filtered or unexported fields
}

func (*WechatMobile) Descriptor deprecated

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

Deprecated: Use WechatMobile.ProtoReflect.Descriptor instead.

func (*WechatMobile) GetMobile

func (x *WechatMobile) GetMobile() string

func (*WechatMobile) GetOpenID

func (x *WechatMobile) GetOpenID() string

func (*WechatMobile) GetSysCode

func (x *WechatMobile) GetSysCode() uint32

func (*WechatMobile) ProtoMessage

func (*WechatMobile) ProtoMessage()

func (*WechatMobile) ProtoReflect

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

func (*WechatMobile) Reset

func (x *WechatMobile) Reset()

func (*WechatMobile) String

func (x *WechatMobile) String() string

type WechatServiceClient

type WechatServiceClient interface {
	//  登录
	Login(ctx context.Context, in *WechatLogin, opts ...grpc.CallOption) (*Token, error)
	// 获取access_token
	GetAccessToken(ctx context.Context, in *AppID, opts ...grpc.CallOption) (*Token, error)
	//  从用户系统获取
	GetAccessTokenFromUser(ctx context.Context, in *AppID, opts ...grpc.CallOption) (*Token, error)
	//  微信绑定用户信息
	BindUser(ctx context.Context, in *WechatMobile, opts ...grpc.CallOption) (*UserID, error)
}

WechatServiceClient is the client API for WechatService 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 WechatServiceServer

type WechatServiceServer interface {
	//  登录
	Login(context.Context, *WechatLogin) (*Token, error)
	// 获取access_token
	GetAccessToken(context.Context, *AppID) (*Token, error)
	//  从用户系统获取
	GetAccessTokenFromUser(context.Context, *AppID) (*Token, error)
	//  微信绑定用户信息
	BindUser(context.Context, *WechatMobile) (*UserID, error)
	// contains filtered or unexported methods
}

WechatServiceServer is the server API for WechatService service. All implementations must embed UnimplementedWechatServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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