Documentation ¶
Index ¶
- Constants
- func NewRoundRobinSelector() client.Selector
- type BaseClient
- func (c *BaseClient) Broadcast(fn string, request, reply interface{}) error
- func (c *BaseClient) Call(ctx context.Context, fn string, arg interface{}, reply interface{}) error
- func (c *BaseClient) Call2(fn string, arg interface{}, reply interface{}) error
- func (c *BaseClient) Close() error
- func (c *BaseClient) Run() error
- type BaseServer
- type Cli
- type ClientOptions
- type ExtraContext
- type RoundRobinSelector
- type ServerOptions
Constants ¶
View Source
const (
BaseServicePath = "/im_service"
)
Variables ¶
This section is empty.
Functions ¶
func NewRoundRobinSelector ¶
Types ¶
type BaseClient ¶
type BaseClient struct {
// contains filtered or unexported fields
}
func NewBaseClient ¶
func NewBaseClient(options *ClientOptions) (*BaseClient, error)
func (*BaseClient) Broadcast ¶
func (c *BaseClient) Broadcast(fn string, request, reply interface{}) error
func (*BaseClient) Call ¶
func (c *BaseClient) Call(ctx context.Context, fn string, arg interface{}, reply interface{}) error
func (*BaseClient) Call2 ¶
func (c *BaseClient) Call2(fn string, arg interface{}, reply interface{}) error
func (*BaseClient) Close ¶
func (c *BaseClient) Close() error
func (*BaseClient) Run ¶
func (c *BaseClient) Run() error
type BaseServer ¶
type BaseServer struct { Srv *server.Server Options *ServerOptions // contains filtered or unexported fields }
func NewBaseServer ¶
func NewBaseServer(options *ServerOptions) *BaseServer
func (*BaseServer) GetServerID ¶
func (s *BaseServer) GetServerID() string
func (*BaseServer) Register ¶
func (s *BaseServer) Register(name string, sv interface{})
func (*BaseServer) Run ¶
func (s *BaseServer) Run() error
type ClientOptions ¶
type ExtraContext ¶
func NewContext ¶
func NewContext() *ExtraContext
func NewContextFrom ¶
func NewContextFrom(c context.Context) *ExtraContext
func (*ExtraContext) GetReqExtra ¶
func (c *ExtraContext) GetReqExtra(k string) (string, bool)
func (*ExtraContext) GetResExtra ¶
func (c *ExtraContext) GetResExtra(k string) (string, bool)
func (*ExtraContext) PutReqExtra ¶
func (c *ExtraContext) PutReqExtra(k string, v string) *ExtraContext
func (*ExtraContext) PutResExtra ¶
func (c *ExtraContext) PutResExtra(k string, v string) *ExtraContext
type RoundRobinSelector ¶
type RoundRobinSelector struct {
// contains filtered or unexported fields
}
RoundRobinSelector selects servers with roundrobin.
func (*RoundRobinSelector) Select ¶
func (s *RoundRobinSelector) Select(ctx context.Context, servicePath, serviceMethod string, args interface{}) string
func (*RoundRobinSelector) SelectNext ¶
func (s *RoundRobinSelector) SelectNext() string
func (*RoundRobinSelector) UpdateServer ¶
func (s *RoundRobinSelector) UpdateServer(servers map[string]string)
Click to show internal directories.
Click to hide internal directories.