Documentation
¶
Index ¶
- Constants
- Variables
- type Conn
- type Invoke
- type InvokeOption
- type InvokeOptions
- type Options
- func Codec(cc codec.Codec) Options
- func ConnectTimeout(connectTimeout time.Duration) Options
- func KeepaliveInterval(keepaliveInterval time.Duration) Options
- func KeepaliveLifetime(keepaliveLifetime time.Duration) Options
- func Registry(registry registry.Registry) Options
- func Transport(client transport.Client) Options
- type RocClient
- func (r *RocClient) Client() transport.Client
- func (r *RocClient) Close()
- func (r *RocClient) Codec() codec.Codec
- func (r *RocClient) ConnectTimeout() time.Duration
- func (r *RocClient) InvokeRC(c *context.Context, method string, req chan []byte, errIn chan error, ...) (chan []byte, chan error)
- func (r *RocClient) InvokeRR(c *context.Context, method string, req, rsp proto.Message, ...) error
- func (r *RocClient) InvokeRS(c *context.Context, method string, req proto.Message, opts ...InvokeOptions) (chan []byte, chan error)
- func (r *RocClient) KeepaliveInterval() time.Duration
- func (r *RocClient) KeepaliveLifetime() time.Duration
- func (r *RocClient) Registry() registry.Registry
- type Strategy
Constants ¶
View Source
const ( // StateBlock block is unavailable state StateBlock state = 0x01 + iota // StateReady ready is unavailable state StateReady // StateWorking is available state StateWorking )
Variables ¶
View Source
var ( ErrorNoneServer = errors.New("server is none to use") ErrorNoSuchServer = errors.New("no such server") )
Functions ¶
This section is empty.
Types ¶
type InvokeOption ¶
type InvokeOption struct {
// contains filtered or unexported fields
}
type InvokeOptions ¶
type InvokeOptions func(*InvokeOption)
func WithAddress ¶
func WithAddress(name, address string, version ...string) InvokeOptions
WithAddress set service discover prefix with both service serviceName and address
func WithName ¶
func WithName(name string, version ...string) InvokeOptions
WithName set service discover prefix with service serviceName
type Options ¶
type Options func(*option)
Options invoke option
func ConnectTimeout ¶
ConnectTimeout set connect timeout
func KeepaliveInterval ¶
KeepaliveInterval set keepalive interval
func KeepaliveLifetime ¶
KeepaliveLifetime set keepalive life time
type RocClient ¶
type RocClient struct {
// contains filtered or unexported fields
}
func NewRocClient ¶
NewRocClient create a client set opts,or use default
func (*RocClient) ConnectTimeout ¶
func (*RocClient) InvokeRR ¶
func (r *RocClient) InvokeRR(c *context.Context, method string, req, rsp proto.Message, opts ...InvokeOptions) error
InvokeRR rpc request requestResponse,it's block request,one request one response
func (*RocClient) InvokeRS ¶
func (r *RocClient) InvokeRS(c *context.Context, method string, req proto.Message, opts ...InvokeOptions) (chan []byte, chan error)
InvokeRS rpc request requestStream,it's one request and multiple response
func (*RocClient) KeepaliveInterval ¶
func (*RocClient) KeepaliveLifetime ¶
Click to show internal directories.
Click to hide internal directories.