client

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TransportName = "proxy"

Variables

This section is empty.

Functions

func Destroy

func Destroy()

func Init

func Init(server, hostName string, tls bool, mux uint8, cas []string) error

func SetUUID

func SetUUID(uid string)

Types

type Client

type Client struct {
	proxy.ProxyClient
	DoneFunc func() error
}

func NewClient

func NewClient() (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Dial

func (c *Client) Dial(_, _ string) (net.Conn, error)

func (*Client) Proxy

func (c *Client) Proxy(ctx context.Context, req *transport.Request, localAddr chan<- string, w io.Writer, r io.Reader) error

func (*Client) String

func (c *Client) String() string

type ConnNode

type ConnNode struct {
	Conn *ConnWrapper
	Next *ConnNode
}

type ConnQueue

type ConnQueue struct {
	Params *Params
	Size   int
	Conn   ConnWrappers
	// contains filtered or unexported fields
}

func NewConnQueue

func NewConnQueue(size int, params *Params) *ConnQueue

func (*ConnQueue) Add added in v1.7.8

func (q *ConnQueue) Add(conn *ConnWrapper)

func (*ConnQueue) Destroy

func (q *ConnQueue) Destroy()

Destroy force disconnect all the connections

func (*ConnQueue) Dial

func (q *ConnQueue) Dial() (*ConnWrapper, error)

Dial dials new grpc connection with saved params

func (*ConnQueue) GetClient

func (q *ConnQueue) GetClient() (proxy.ProxyClient, func() error, error)

GetClient gets a grpc client from connection

func (*ConnQueue) GetConn

func (q *ConnQueue) GetConn() (*ConnWrapper, func() error, error)

GetConn gets a grpc connection from the pool, also moves the cursor

func (*ConnQueue) GetConnOutSide

func (q *ConnQueue) GetConnOutSide() (*ConnWrapper, func() error, error)

GetConnOutSide gets a connection outside the pool

func (*ConnQueue) Init

func (q *ConnQueue) Init() error

type ConnWrapper

type ConnWrapper struct {
	*grpc.ClientConn
	InUse uint32
}

func NewConnWrapper added in v1.8.2

func NewConnWrapper(p *Params) (*ConnWrapper, error)

func (*ConnWrapper) Close added in v1.8.0

func (w *ConnWrapper) Close() error

func (*ConnWrapper) Done

func (w *ConnWrapper) Done() error

func (*ConnWrapper) Use

func (w *ConnWrapper) Use()

type ConnWrappers

type ConnWrappers []*ConnWrapper

func (ConnWrappers) LogStatus added in v1.7.8

func (w ConnWrappers) LogStatus()

func (ConnWrappers) PickLRU added in v1.7.8

func (w ConnWrappers) PickLRU() *ConnWrapper

type Forwarder

type Forwarder struct {
	Ctx       context.Context
	Stream    proxy.Proxy_ProxyClient
	Writer    io.Writer
	Reader    io.Reader
	LocalAddr chan string
}

func NewForwarder

func NewForwarder(ctx context.Context, s proxy.Proxy_ProxyClient, w io.Writer, r io.Reader) *Forwarder

func (*Forwarder) CopySRCtoTarget

func (f *Forwarder) CopySRCtoTarget() (err error)

func (*Forwarder) CopyTargetToSRC

func (f *Forwarder) CopyTargetToSRC() (err error)

func (*Forwarder) Start added in v1.7.9

func (f *Forwarder) Start(req *transport.Request, localAddrChan chan<- string) error

type Params

type Params struct {
	Addr string
	Opts []grpc.DialOption
}

func NewParams

func NewParams(addr string, opts ...grpc.DialOption) *Params

Jump to

Keyboard shortcuts

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