remotecli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 11 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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