Documentation ¶
Overview ¶
Package client is an interface for any protocol's client
Index ¶
Constants ¶
View Source
const DefaultPoolSize = 50
DefaultPoolSize is 500
Variables ¶
This section is empty.
Functions ¶
func GetProtocolSpec ¶
GetProtocolSpec is to get protocol specifications
func InstallPlugin ¶
InstallPlugin is plugin for the new function
Types ¶
type NewFunc ¶
type NewFunc func(Options) ProtocolClient
NewFunc is function for the client
func GetClientNewFunc ¶
GetClientNewFunc is to get the client
type Options ¶
type Options struct { PoolSize int PoolTTL time.Duration TLSConfig *tls.Config Failure map[string]bool }
Options is configs for client creation
type ProtocolClient ¶
type ProtocolClient interface { Call(ctx context.Context, addr string, inv *invocation.Invocation, rsp interface{}) error String() string }
ProtocolClient is the interface to communicate with one kind of ProtocolServer, it is used in transport handler rcp protocol client,http protocol client,or you can implement your own
func CreateClient ¶
func CreateClient(protocol, service string) (ProtocolClient, error)
CreateClient is for to create client based on protocol and the service name
func GetClient ¶
func GetClient(protocol, service string) (ProtocolClient, error)
GetClient is to get the client based on protocol and service name
Click to show internal directories.
Click to hide internal directories.