Documentation ¶
Overview ¶
Package remotecli for remote client
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // RPCInfo as param just avoid to get it from ctx Send(ctx context.Context, ri rpcinfo.RPCInfo, req remote.Message) (err error) Recv(ctx context.Context, ri rpcinfo.RPCInfo, resp remote.Message) (err error) Recycle() }
Client implementation may be different between mux and non-mux clients.
type ConnReleaser ¶ added in v0.10.0
ConnReleaser helps to release the raw connection.
type ConnWrapper ¶
type ConnWrapper struct {
// contains filtered or unexported fields
}
ConnWrapper wraps a connection.
func NewConnWrapper ¶
func NewConnWrapper(connPool remote.ConnPool) *ConnWrapper
NewConnWrapper returns a new ConnWrapper using the given connPool and logger.
func (*ConnWrapper) GetConn ¶
func (cm *ConnWrapper) GetConn(ctx context.Context, d remote.Dialer, ri rpcinfo.RPCInfo) (net.Conn, error)
GetConn returns a connection using the given Dialer and RPCInfo.
func (*ConnWrapper) ReleaseConn ¶
func (cm *ConnWrapper) ReleaseConn(err error, ri rpcinfo.RPCInfo)
ReleaseConn should notice that ri may nil when oneway TODO duplicate release may cause problem?
type StreamConnManager ¶ added in v0.10.0
type StreamConnManager struct {
ConnReleaser
}
StreamConnManager manages the underlying connection of the stream
func NewStream ¶
func NewStream(ctx context.Context, ri rpcinfo.RPCInfo, handler remote.ClientTransHandler, opt *remote.ClientOption) (streaming.Stream, *StreamConnManager, error)
NewStream create a client side stream
func NewStreamConnManager ¶ added in v0.10.0
func NewStreamConnManager(cr ConnReleaser) *StreamConnManager
NewStreamConnManager returns a new StreamConnManager
func (*StreamConnManager) ReleaseConn ¶ added in v0.10.0
func (scm *StreamConnManager) ReleaseConn(err error, ri rpcinfo.RPCInfo)
ReleaseConn releases the raw connection of the stream