config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Location = "~/.config/jump"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Tunnels map[string]Tunnel `toml:"tunnels"`
	Remotes map[string]Remote `toml:"remotes"`
}

func Read

func Read(cfgFile string) (Config, error)

func Write

func Write(cfgFile string, cfg Config) (Config, error)

func (*Config) AddRemote

func (c *Config) AddRemote(name string, remote Remote)

func (*Config) AddTunnel

func (c *Config) AddTunnel(name string, tunnel Tunnel)

func (Config) GetRemote

func (c Config) GetRemote(name string) *Remote

func (Config) GetTunnel

func (c Config) GetTunnel(name string) *Tunnel

type Remote

type Remote struct {
	Addr      string  `toml:"address"`
	Port      int16   `toml:"port"`
	User      *string `toml:"user"`
	IdentFile *string `toml:"identity"`
}

type Tunnel

type Tunnel struct {
	LocalPort  int16  `toml:"local"`
	RemotePort int16  `toml:"remote"`
	Addr       string `toml:"address"`
}

Jump to

Keyboard shortcuts

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