Documentation
¶
Overview ¶
Package alias provides utility functions related to alias configuration file management.
The alias configuration files are stored on `$HOME/.mole` on files named after the alias name.
Index ¶
Constants ¶
const ( InstancePidFile = "pid" InstanceLogFile = "mole.log" ShowTemplate = `` /* 504-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddressInput ¶
AddressInput holds information about a host
func (AddressInput) Address ¶
func (ai AddressInput) Address() string
Address returns a string representation of AddressInput to be used to perform network connections.
func (*AddressInput) Set ¶
func (ai *AddressInput) Set(value string) error
Set parses a string representation of AddressInput into its proper attributes.
func (AddressInput) String ¶
func (ai AddressInput) String() string
String returns a string representation of a AddressInput
func (*AddressInput) Type ¶
func (ai *AddressInput) Type() string
Type return a string representation of AddressInput.
type AddressInputList ¶
type AddressInputList []AddressInput
AddressInputList represents a collection of AddressInput objects
func (AddressInputList) List ¶
func (il AddressInputList) List() []string
List returns an array of the string representation of each AddressInput kept on the AddressInputList
func (*AddressInputList) Set ¶
func (il *AddressInputList) Set(value string) error
Set adds a string representation of a AddressInput to the AddressInputList object
func (AddressInputList) String ¶
func (il AddressInputList) String() string
String return the string representation of AddressInputList
func (*AddressInputList) Type ¶
func (il *AddressInputList) Type() string
Type return a string representation of AddressInputList.
type Alias ¶
type Alias struct { Name string `toml:"-"` TunnelType string `toml:"type"` Verbose bool `toml:"verbose"` Insecure bool `toml:"insecure"` Detach bool `toml:"detach"` Source []string `toml:"source"` Destination []string `toml:"destination"` Server string `toml:"server"` Key string `toml:"key"` KeepAliveInterval string `toml:"keep-alive-interval"` ConnectionRetries int `toml:"connection-retries"` WaitAndRetry string `toml:"wait-and-retry"` SshAgent string `toml:"ssh-agent"` Timeout string `toml:"timeout"` }
Alias holds all attributes required to start a ssh port forwarding tunnel.
func (*Alias) Merge ¶
func (a *Alias) Merge(tunnelFlags *TunnelFlags)
Merge overwrites certain Alias attributes based on the given TunnelFlags.
func (Alias) ParseTunnelFlags ¶
func (a Alias) ParseTunnelFlags() (*TunnelFlags, error)
ParseTunnelFlags parses an Alias into a TunnelFlags
type InstanceConfiguration ¶
func NewInstanceConfiguration ¶
func NewInstanceConfiguration(aliasName string) (*InstanceConfiguration, error)
type TunnelFlags ¶
type TunnelFlags struct { TunnelType string Verbose bool Insecure bool Detach bool Source AddressInputList Destination AddressInputList Server AddressInput Key string KeepAliveInterval time.Duration ConnectionRetries int WaitAndRetry time.Duration SshAgent string Timeout time.Duration // GivenFlags contains list of all flags that were given by the user. GivenFlags []string }
TunnelFlags is a struct that holds all flags required to establish a ssh port forwarding tunnel.
func (TunnelFlags) FlagGiven ¶ added in v1.0.1
func (tf TunnelFlags) FlagGiven(flag string) bool
FlagGiven tells if a specific flag was given by the user through CLI.
func (TunnelFlags) ParseAlias ¶
func (tf TunnelFlags) ParseAlias(name string) *Alias
ParseAlias translates a TunnelFlags object to an Alias object
func (TunnelFlags) String ¶
func (tf TunnelFlags) String() string