client

package
v0.0.0-...-a9387a1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotReady = logex.Define("not ready")
)
View Source
var Slogan = `
   _  _______  ________
  / |/ / __/ |/_/_  __/
 /    / _/_>  <  / /   
/_/|_/___/_/|_| /_/    
`

Functions

func FixHost

func FixHost(host string) string

Types

type Client

type Client struct {
	HTTP *HTTP
	// contains filtered or unexported fields
}

func New

func New(cfg *Config, f *flow.Flow) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) GetController

func (c *Client) GetController() (*controller.Client, error)

func (*Client) GetDataChannelStat

func (c *Client) GetDataChannelStat() (string, error)

func (*Client) GetDchan

func (c *Client) GetDchan() (*dchan.Client, error)

func (*Client) GetRoute

func (c *Client) GetRoute() (*route.Route, error)

func (*Client) NeedLogin

func (c *Client) NeedLogin()

func (*Client) OnAllBackoff

func (c *Client) OnAllBackoff()

func (*Client) OnNewDC

func (c *Client) OnNewDC(ports []int)

func (*Client) Relogin

func (c *Client) Relogin()

func (*Client) Run

func (c *Client) Run()

func (*Client) SaveRoute

func (c *Client) SaveRoute() error

func (*Client) ShowControllerStage

func (c *Client) ShowControllerStage() ([]controller.StageInfo, error)

type Config

type Config struct {
	Debug      bool
	DebugStack bool `default:"true"`
	DebugFlow  bool

	DevId     int
	UserName  string
	Password  string
	AesKey    string `name:"key"`
	RouteFile string `default:"routes.conf"`
	Pprof     string `default:":10060"`

	Sock string `desc:"unixsock for interactive with" default:"/tmp/next.sock"`

	Host2 string `name:"host"`
	Host  string `type:"[0]"`
}

func (*Config) FlaglyDesc

func (c *Config) FlaglyDesc() string

func (*Config) FlaglyHandle

func (c *Config) FlaglyHandle(f *flow.Flow) error

func (*Config) FlaglyVerify

func (c *Config) FlaglyVerify() error

func (*Config) GetHostName

func (c *Config) GetHostName() string

type DchanDelegate

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

func (*DchanDelegate) OnAllBackoff

func (d *DchanDelegate) OnAllBackoff(cli *dchan.Client)

func (*DchanDelegate) OnLinkRefused

func (d *DchanDelegate) OnLinkRefused()

type HTTP

type HTTP struct {
	Host   string
	User   string
	Pswd   string
	AesKey []byte
	// contains filtered or unexported fields
}

func NewHTTP

func NewHTTP(host, user, pswd string, aeskey []byte) *HTTP

func (*HTTP) Login

func (c *HTTP) Login(onLogin func(*uc.AuthResponse) error) error

type Shell

type Shell struct {
	Sock string
	// contains filtered or unexported fields
}

func NewShell

func NewShell(f *flow.Flow, cli *Client, sock string) (*Shell, error)

func (*Shell) Close

func (s *Shell) Close()

type Tun

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

func (*Tun) Close

func (t *Tun) Close()

func (*Tun) ConfigUpdate

func (t *Tun) ConfigUpdate(remoteCfg *uc.AuthResponse)

ConfigUpdate: non-test

func (*Tun) Name

func (t *Tun) Name() string

func (*Tun) Run

func (t *Tun) Run(in, out chan []byte)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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