client

package
v0.0.0-...-84fdf29 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionManager

type ConnectionManager struct {
	// contains filtered or unexported fields
}

func NewConnectionManager

func NewConnectionManager(ctx context.Context, cfg *config.ClientCommonConf) *ConnectionManager

func (*ConnectionManager) Close

func (cm *ConnectionManager) Close() error

func (*ConnectionManager) Connect

func (cm *ConnectionManager) Connect() (net.Conn, error)

func (*ConnectionManager) OpenConnection

func (cm *ConnectionManager) OpenConnection() error

type Control

type Control struct {
	// contains filtered or unexported fields
}

func NewControl

func NewControl(
	ctx context.Context, runID string, conn net.Conn, cm *ConnectionManager,
	clientCfg config.ClientCommonConf,
	pxyCfgs map[string]config.ProxyConf,
	visitorCfgs map[string]config.VisitorConf,
	authSetter auth.Setter,
) *Control

func (*Control) Close

func (ctl *Control) Close() error

func (*Control) ClosedDoneCh

func (ctl *Control) ClosedDoneCh() <-chan struct{}

ClosedDoneCh returns a channel that will be closed after all resources are released

func (*Control) GracefulClose

func (ctl *Control) GracefulClose(d time.Duration) error

func (*Control) HandleNatHoleResp

func (ctl *Control) HandleNatHoleResp(inMsg *msg.NatHoleResp)

func (*Control) HandleNewProxyResp

func (ctl *Control) HandleNewProxyResp(inMsg *msg.NewProxyResp)

func (*Control) HandleReqWorkConn

func (ctl *Control) HandleReqWorkConn(_ *msg.ReqWorkConn)

func (*Control) ReloadConf

func (ctl *Control) ReloadConf(pxyCfgs map[string]config.ProxyConf, visitorCfgs map[string]config.VisitorConf) error

func (*Control) Run

func (ctl *Control) Run()

type GeneralResponse

type GeneralResponse struct {
	Code int
	Msg  string
}

type ProxyStatusResp

type ProxyStatusResp struct {
	Name       string `json:"name"`
	Type       string `json:"type"`
	Status     string `json:"status"`
	Err        string `json:"err"`
	LocalAddr  string `json:"local_addr"`
	Plugin     string `json:"plugin"`
	RemoteAddr string `json:"remote_addr"`
}

func NewProxyStatusResp

func NewProxyStatusResp(status *proxy.WorkingStatus, serverAddr string) ProxyStatusResp

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is a client service.

func NewService

func NewService(
	cfg config.ClientCommonConf,
	pxyCfgs map[string]config.ProxyConf,
	visitorCfgs map[string]config.VisitorConf,
	cfgFile string,
) (svr *Service, err error)

func (*Service) Close

func (svr *Service) Close()

func (*Service) GetController

func (svr *Service) GetController() *Control

func (*Service) GracefulClose

func (svr *Service) GracefulClose(d time.Duration)

func (*Service) ReloadConf

func (svr *Service) ReloadConf(pxyCfgs map[string]config.ProxyConf, visitorCfgs map[string]config.VisitorConf) error

func (*Service) Run

func (svr *Service) Run(ctx context.Context) error

func (*Service) RunAdminServer

func (svr *Service) RunAdminServer(address string) (err error)

type StatusResp

type StatusResp map[string][]ProxyStatusResp

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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