storage

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAll added in v0.3.0

func FindAll() (map[string]*Alias, error)

FindAll finds all the Aliass in Store.

Types

type Alias added in v0.4.0

type Alias struct {
	// Local holds all local addresses configured on an alias.
	//
	// The type is specified as `interface{}` for backward-compatibility reasons
	// since only a single value was supported before.
	Local interface{} `toml:"local"`
	// Remote holds all remote addresses configured on an alias.
	//
	// The type is specified as `interface{}` for backward-compatibility reasons
	// since only a single value was supported before.
	Remote interface{} `toml:"remote"`

	Server            string        `toml:"server"`
	Key               string        `toml:"key"`
	Verbose           bool          `toml:"verbose"`
	Help              bool          `toml:"help"`
	Version           bool          `toml:"version"`
	Detach            bool          `toml:"detach"`
	Insecure          bool          `toml:"insecure"`
	KeepAliveInterval time.Duration `toml:"keep-alive-interval"`
	Timeout           time.Duration `toml:"timeout"`
}

Alias represents settings of the ssh tunnel.

func FindByName

func FindByName(name string) (*Alias, error)

FindByName finds the Alias in Store by name.

func Remove

func Remove(name string) (*Alias, error)

Remove deletes Alias from the Store by name.

func Save

func Save(name string, alias *Alias) (*Alias, error)

Save stores Alias to the Store.

func (Alias) ReadLocal added in v0.4.0

func (t Alias) ReadLocal() ([]string, error)

func (Alias) ReadRemote added in v0.4.0

func (t Alias) ReadRemote() ([]string, error)

func (Alias) String added in v0.4.0

func (t Alias) String() string

type Store

type Store struct {
	Aliases map[string]*Alias `toml:"tunnels"`
}

Store contains the map of aliases, where key contains the alias name.

Jump to

Keyboard shortcuts

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