Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var File_example_example_proto protoreflect.FileDescriptor
Functions ¶
func NewXClientForExample ¶
NewXClientForExample creates a XClient. You can configure this client with more options such as etcd registry, serialize type, select algorithm and fail mode.
func RegisterExampleHTTPService ¶
func RegisterExampleHTTPService(g *gin.RouterGroup, svc ExampleHTTPService)
Types ¶
type ExampleAble ¶
type ExampleAble interface { // Login is server rpc method as defined Login(ctx context.Context, args *LoginReq, reply *LoginRsp) (err error) // Sms is server rpc method as defined Sms(ctx context.Context, args *SmsReq, reply *SmsRsp) (err error) }
================== interface skeleton ===================
type ExampleClient ¶
type ExampleClient struct {
// contains filtered or unexported fields
}
================== client stub =================== Example is a client wrapped XClient.
func NewExampleClient ¶
func NewExampleClient(xclient client.XClient) *ExampleClient
NewExampleClient wraps a XClient as ExampleClient. You can pass a shared XClient object created by NewXClientForExample.
type ExampleHTTPService ¶
type ExampleOneClient ¶
type ExampleOneClient struct {
// contains filtered or unexported fields
}
================== oneclient stub =================== ExampleOneClient is a client wrapped oneClient.
func NewExampleOneClient ¶
func NewExampleOneClient(oneclient *client.OneClient) *ExampleOneClient
NewExampleOneClient wraps a OneClient as ExampleOneClient. You can pass a shared OneClient object created by NewOneClientForExample.
type LoginReq ¶
type LoginReq struct { // @gotags: binding:"required" Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty" binding:"required"` // @gotags: binding:"required" Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty" binding:"required"` // contains filtered or unexported fields }
func (*LoginReq) Descriptor
deprecated
func (*LoginReq) GetPassword ¶
func (*LoginReq) GetUsername ¶
func (*LoginReq) ProtoMessage ¶
func (*LoginReq) ProtoMessage()
func (*LoginReq) ProtoReflect ¶
func (x *LoginReq) ProtoReflect() protoreflect.Message
type LoginRsp ¶
type LoginRsp struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` ExpiresAt int64 `protobuf:"varint,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // contains filtered or unexported fields }
func (*LoginRsp) Descriptor
deprecated
func (*LoginRsp) GetExpiresAt ¶
func (*LoginRsp) ProtoMessage ¶
func (*LoginRsp) ProtoMessage()
func (*LoginRsp) ProtoReflect ¶
func (x *LoginRsp) ProtoReflect() protoreflect.Message
type SmsReq ¶
type SmsReq struct { // @gotags: binding:"required,mobile" Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty" binding:"required,mobile"` // contains filtered or unexported fields }
func (*SmsReq) Descriptor
deprecated
func (*SmsReq) ProtoMessage ¶
func (*SmsReq) ProtoMessage()
func (*SmsReq) ProtoReflect ¶
func (x *SmsReq) ProtoReflect() protoreflect.Message
type SmsRsp ¶
type SmsRsp struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
func (*SmsRsp) Descriptor
deprecated
func (*SmsRsp) ProtoMessage ¶
func (*SmsRsp) ProtoMessage()
func (*SmsRsp) ProtoReflect ¶
func (x *SmsRsp) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.