tunnel

package
v0.0.0-...-6814b35 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: BSD-3-Clause, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int
const (
	Local Mode = iota
	Remote
	Socks
	RemoteSocks
)

func (Mode) String

func (m Mode) String() string

func (*Mode) UnmarshalTOML

func (m *Mode) UnmarshalTOML(data interface{}) error

type Status

type Status int
const (
	Closed Status = iota
	Open
	Reconn
)

type StringOrInt

type StringOrInt string

Custom type to handle both string and integer values in the TOML config. This is useful for the local address.

func (StringOrInt) String

func (s StringOrInt) String() string

func (*StringOrInt) UnmarshalTOML

func (s *StringOrInt) UnmarshalTOML(v any) error

type Tunnel

type Tunnel struct {
	Name          string        `toml:"name" json:"name"`
	LocalAddress  StringOrInt   `toml:"local" json:"local"`
	RemoteAddress StringOrInt   `toml:"remote" json:"remote"`
	Host          string        `toml:"host" json:"host"`
	User          string        `toml:"user" json:"user"`
	IdentityFile  string        `toml:"identity" json:"identity"`
	Port          int           `toml:"port" json:"port"`
	Mode          Mode          `toml:"mode" json:"mode"`
	Status        Status        `toml:"-" json:"status"`
	LastConn      time.Time     `toml:"-" json:"last_conn"`
	Closed        chan struct{} `toml:"-" json:"-"`
	// contains filtered or unexported fields
}

func (*Tunnel) Close

func (t *Tunnel) Close() error

func (*Tunnel) Open

func (t *Tunnel) Open() error

Jump to

Keyboard shortcuts

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