remotecli

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package remotecli for remote client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStream

NewStream create a client side stream

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.

func NewClient

func NewClient(ctx context.Context, ri rpcinfo.RPCInfo, handler remote.TransHandler, opt *remote.ClientOption) (Client, error)

NewClient creates a new Client using the given params.

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?

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL