ssh

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ForwardKeyTypeL = "L"
	ForwardKeyTypeR = "R"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cc *ssh_util.ClientConfig) *Client

func (*Client) LocalForward

func (c *Client) LocalForward(ctx context.Context, req LocalForwardReq)

func (*Client) LocalForwardClose

func (c *Client) LocalForwardClose(ctx context.Context, req LocalForwardReq)

func (*Client) RemoteForward

func (c *Client) RemoteForward(ctx context.Context, req RemoteForwardReq)

func (*Client) RemoteForwardClose

func (c *Client) RemoteForwardClose(ctx context.Context, req RemoteForwardReq)

func (*Client) Start

func (c *Client) Start(ctx context.Context)

func (*Client) Stop

func (c *Client) Stop(ctx context.Context)

type ClientSet

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

func NewClientSet

func NewClientSet() *ClientSet

func (*ClientSet) AddIfNotExist

func (cs *ClientSet) AddIfNotExist(ctx context.Context, epKey string, cc ssh_util.ClientConfig) bool

func (*ClientSet) ClearAllMark

func (cs *ClientSet) ClearAllMark()

func (*ClientSet) CloseForward

func (cs *ClientSet) CloseForward(ctx context.Context, fk ForwardKey)

func (*ClientSet) ForwardKeySet

func (cs *ClientSet) ForwardKeySet() ForwardKeySet

func (*ClientSet) LocalForward

func (cs *ClientSet) LocalForward(ctx context.Context, epKey string, req LocalForwardReq)

func (*ClientSet) RemoteForward

func (cs *ClientSet) RemoteForward(ctx context.Context, epKey string, req RemoteForwardReq)

func (*ClientSet) ResetIfChanged

func (cs *ClientSet) ResetIfChanged(ctx context.Context, epKey string, cc ssh_util.ClientConfig) bool

func (*ClientSet) ResetUnmarked

func (cs *ClientSet) ResetUnmarked(ctx context.Context)

type ForwardKey

type ForwardKey struct {
	EpKey   string
	Type    string
	KeyAddr string
	KeyPort int

	Value interface{}
}

func (*ForwardKey) Key

func (fk *ForwardKey) Key() string

type ForwardKeySet

type ForwardKeySet map[string]ForwardKey

func (ForwardKeySet) Add

func (fks ForwardKeySet) Add(fk ForwardKey)

func (ForwardKeySet) Contains

func (fks ForwardKeySet) Contains(fk ForwardKey) bool

func (ForwardKeySet) Remove

func (fks ForwardKeySet) Remove(fk ForwardKey)

type LocalForwardReq

type LocalForwardReq struct {
	LocalAddr  string
	LocalPort  int
	RemoteAddr string
	RemotePort int

	Tick   time.Duration
	TickCb TickFunc
}

type RemoteForwardReq

type RemoteForwardReq struct {
	// LocalAddr is the address the forward will forward to
	LocalAddr string
	// LocalPort is the port the forward will forward to
	LocalPort int

	// RemoteAddr is the address on the remote to listen on
	RemoteAddr string
	// RemotePort is the address on the remote to listen on
	RemotePort int

	Tick   time.Duration
	TickCb TickFunc
}

type TickFunc

type TickFunc func(context.Context)

Jump to

Keyboard shortcuts

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