Documentation ¶
Index ¶
- Variables
- func NewXClientForGreeter(addr string) (client.XClient, error)
- func RegisterGreeterHTTPServer(g *gin.RouterGroup, srv GreeterHTTPServer)
- func ServeForGreeter(addr string) error
- type GreeterAble
- type GreeterClient
- type GreeterHTTPClient
- type GreeterHTTPClientImpl
- type GreeterHTTPServer
- type GreeterImpl
- type GreeterOneClient
- type HelloReply
- func (*HelloReply) Descriptor() ([]byte, []int)
- func (m *HelloReply) GetMessage() string
- func (m *HelloReply) Marshal() (dAtA []byte, err error)
- func (m *HelloReply) MarshalTo(dAtA []byte) (int, error)
- func (m *HelloReply) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HelloReply) ProtoMessage()
- func (m *HelloReply) Reset()
- func (m *HelloReply) Size() (n int)
- func (m *HelloReply) String() string
- func (m *HelloReply) Unmarshal(dAtA []byte) error
- func (m *HelloReply) XXX_DiscardUnknown()
- func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HelloReply) XXX_Merge(src proto.Message)
- func (m *HelloReply) XXX_Size() int
- func (m *HelloReply) XXX_Unmarshal(b []byte) error
- type HelloRequest
- func (*HelloRequest) Descriptor() ([]byte, []int)
- func (m *HelloRequest) GetName() string
- func (m *HelloRequest) Marshal() (dAtA []byte, err error)
- func (m *HelloRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *HelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HelloRequest) ProtoMessage()
- func (m *HelloRequest) Reset()
- func (m *HelloRequest) Size() (n int)
- func (m *HelloRequest) String() string
- func (m *HelloRequest) Unmarshal(dAtA []byte) error
- func (m *HelloRequest) XXX_DiscardUnknown()
- func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HelloRequest) XXX_Merge(src proto.Message)
- func (m *HelloRequest) XXX_Size() int
- func (m *HelloRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewXClientForGreeter ¶
NewXClientForGreeter creates a XClient. You can configure this client with more options such as etcd registry, serialize type, select algorithm and fail mode.
func RegisterGreeterHTTPServer ¶
func RegisterGreeterHTTPServer(g *gin.RouterGroup, srv GreeterHTTPServer)
func ServeForGreeter ¶
ServeForGreeter starts a server only registers one service. You can register more services and only start one server. It blocks until the application exits.
Types ¶
type GreeterAble ¶
type GreeterAble interface { // SayHello is server rpc method as defined SayHello(ctx context.Context, args *HelloRequest, reply *HelloReply) (err error) }
================== interface skeleton ===================
type GreeterClient ¶
type GreeterClient struct {
// contains filtered or unexported fields
}
================== client stub =================== Greeter is a client wrapped XClient.
func NewGreeterClient ¶
func NewGreeterClient(xclient client.XClient) *GreeterClient
NewGreeterClient wraps a XClient as GreeterClient. You can pass a shared XClient object created by NewXClientForGreeter.
func (*GreeterClient) SayHello ¶
func (c *GreeterClient) SayHello(ctx context.Context, args *HelloRequest) (reply *HelloReply, err error)
SayHello is client rpc method as defined
type GreeterHTTPClient ¶
type GreeterHTTPClient interface { // SayHello SayHello(context.Context, *HelloRequest, ...client.CallOption) (*HelloReply, error) }
GreeterHTTPClient
func NewGreeterHTTPClient ¶
func NewGreeterHTTPClient(c *client.Client) GreeterHTTPClient
type GreeterHTTPClientImpl ¶
type GreeterHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*GreeterHTTPClientImpl) SayHello ¶
func (c *GreeterHTTPClientImpl) SayHello(ctx context.Context, req *HelloRequest, opts ...client.CallOption) (*HelloReply, error)
SayHello
type GreeterHTTPServer ¶
type GreeterHTTPServer interface { // SayHello SayHello(context.Context, *HelloRequest) (*HelloReply, error) }
GreeterHTTPServer
type GreeterImpl ¶
type GreeterImpl struct{}
================== server skeleton ===================
func (*GreeterImpl) SayHello ¶
func (s *GreeterImpl) SayHello(ctx context.Context, args *HelloRequest, reply *HelloReply) (err error)
SayHello is server rpc method as defined
type GreeterOneClient ¶
type GreeterOneClient struct {
// contains filtered or unexported fields
}
================== oneclient stub =================== GreeterOneClient is a client wrapped oneClient.
func NewGreeterOneClient ¶
func NewGreeterOneClient(oneclient *client.OneClient) *GreeterOneClient
NewGreeterOneClient wraps a OneClient as GreeterOneClient. You can pass a shared OneClient object created by NewOneClientForGreeter.
func (*GreeterOneClient) SayHello ¶
func (c *GreeterOneClient) SayHello(ctx context.Context, args *HelloRequest) (reply *HelloReply, err error)
SayHello is client rpc method as defined
type HelloReply ¶
type HelloReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HelloReply) Descriptor ¶
func (*HelloReply) Descriptor() ([]byte, []int)
func (*HelloReply) GetMessage ¶
func (m *HelloReply) GetMessage() string
func (*HelloReply) Marshal ¶
func (m *HelloReply) Marshal() (dAtA []byte, err error)
func (*HelloReply) MarshalToSizedBuffer ¶
func (m *HelloReply) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HelloReply) ProtoMessage ¶
func (*HelloReply) ProtoMessage()
func (*HelloReply) Reset ¶
func (m *HelloReply) Reset()
func (*HelloReply) Size ¶
func (m *HelloReply) Size() (n int)
func (*HelloReply) String ¶
func (m *HelloReply) String() string
func (*HelloReply) Unmarshal ¶
func (m *HelloReply) Unmarshal(dAtA []byte) error
func (*HelloReply) XXX_DiscardUnknown ¶
func (m *HelloReply) XXX_DiscardUnknown()
func (*HelloReply) XXX_Marshal ¶
func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HelloReply) XXX_Merge ¶
func (m *HelloReply) XXX_Merge(src proto.Message)
func (*HelloReply) XXX_Size ¶
func (m *HelloReply) XXX_Size() int
func (*HelloReply) XXX_Unmarshal ¶
func (m *HelloReply) XXX_Unmarshal(b []byte) error
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" uri:"name"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HelloRequest) Descriptor ¶
func (*HelloRequest) Descriptor() ([]byte, []int)
func (*HelloRequest) GetName ¶
func (m *HelloRequest) GetName() string
func (*HelloRequest) Marshal ¶
func (m *HelloRequest) Marshal() (dAtA []byte, err error)
func (*HelloRequest) MarshalToSizedBuffer ¶
func (m *HelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) Reset ¶
func (m *HelloRequest) Reset()
func (*HelloRequest) Size ¶
func (m *HelloRequest) Size() (n int)
func (*HelloRequest) String ¶
func (m *HelloRequest) String() string
func (*HelloRequest) Unmarshal ¶
func (m *HelloRequest) Unmarshal(dAtA []byte) error
func (*HelloRequest) XXX_DiscardUnknown ¶
func (m *HelloRequest) XXX_DiscardUnknown()
func (*HelloRequest) XXX_Marshal ¶
func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HelloRequest) XXX_Merge ¶
func (m *HelloRequest) XXX_Merge(src proto.Message)
func (*HelloRequest) XXX_Size ¶
func (m *HelloRequest) XXX_Size() int
func (*HelloRequest) XXX_Unmarshal ¶
func (m *HelloRequest) XXX_Unmarshal(b []byte) error