Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNameList ¶
GetNameList return a list of server names from the Config structure.
Types ¶
type Config ¶
type Config struct { Log LogConfig Shell ShellConfig Include map[string]IncludeConfig Includes IncludesConfig Common ServerConfig Server map[string]ServerConfig Proxy map[string]ProxyConfig SSHConfig map[string]OpenSSHConfig }
Config is Struct that stores the entire configuration file.
func Read ¶ added in v0.6.7
ReadConf load configuration file and return Config structure TODO(blacknon): リファクタリング!(v0.6.5) 外出しや処理のまとめなど
func (*Config) ReadIncludeFiles ¶ added in v0.6.7
func (c *Config) ReadIncludeFiles()
ReadIncludeFiles read include files and append to Config.Server.
func (*Config) ReadOpenSSHConfig ¶ added in v0.6.7
func (c *Config) ReadOpenSSHConfig()
ReadOpenSSHConfig read OpenSSH config file and append to Config.Server.
func (*Config) ReduceCommon ¶ added in v0.6.7
func (c *Config) ReduceCommon()
ReduceCommon reduce common setting (in .lssh.conf servers)
type IncludeConfig ¶
type IncludeConfig struct {
Path string `toml:"path"`
}
IncludeConfig specify the configuration file to include (ServerConfig only).
type IncludesConfig ¶ added in v0.5.2
type IncludesConfig struct { // example: // path = [ // "~/.lssh.d/home.conf" // ,"~/.lssh.d/cloud.conf" // ] Path []string `toml:"path"` }
IncludesConfig specify the configuration file to include (ServerConfig only). Struct that can specify multiple files in array. TODO: ワイルドカード指定可能にする
type LogConfig ¶
type LogConfig struct { // Enable terminal logging. Enable bool `toml:"enable" yaml:"enable"` // Add a timestamp at the beginning of the terminal log line. Timestamp bool `toml:"timestamp" yaml:"timestamp"` // Specifies the directory for creating terminal logs. Dir string `toml:"dirpath" yaml:"dirpath"` // Logging with remove ANSI code. RemoveAnsiCode bool `toml:"remove_ansi_code" yaml:"remove_ansi_code"` }
LogConfig store the contents about the terminal log. The log file name is created in "YYYYmmdd_HHMMSS_servername.log" of the specified directory.
type OpenSSHConfig ¶ added in v0.6.1
type OpenSSHConfig struct { Path string `toml:"path"` // This is preferred Command string `toml:"command"` ServerConfig }
OpenSSHConfig is read OpenSSH configuration file.
type PortForward ¶ added in v0.6.1
type PortForward struct { Mode string // L or R. Local string // localhost:8080 Remote string // localhost:80 }
PortForward
type ProxyConfig ¶ added in v0.4.4
type ProxyConfig struct { Addr string `toml:"addr"` Port string `toml:"port"` User string `toml:"user"` Pass string `toml:"pass"` Proxy string `toml:"proxy"` ProxyType string `toml:"proxy_type"` Note string `toml:"note"` }
ProxyConfig is that stores Proxy server settings connected via http and socks5.
type ServerConfig ¶
type ServerConfig struct { // Connect basic Setting Addr string `toml:"addr"` Port string `toml:"port"` User string `toml:"user"` // Connect auth Setting Pass string `toml:"pass"` Passes []string `toml:"passes"` Key string `toml:"key"` KeyCommand string `toml:"keycmd"` KeyCommandPass string `toml:"keycmdpass"` KeyPass string `toml:"keypass"` Keys []string `toml:"keys"` // "keypath::passphrase" Cert string `toml:"cert"` CertKey string `toml:"certkey"` CertKeyPass string `toml:"certkeypass"` CertPKCS11 bool `toml:"certpkcs11"` AgentAuth bool `toml:"agentauth"` SSHAgentUse bool `toml:"ssh_agent"` SSHAgentKeyPath []string `toml:"ssh_agent_key"` // "keypath::passphrase" PKCS11Use bool `toml:"pkcs11"` PKCS11Provider string `toml:"pkcs11provider"` // PKCS11 Provider PATH PKCS11PIN string `toml:"pkcs11pin"` // PKCS11 PIN code // pre execute command PreCmd string `toml:"pre_cmd"` // post execute command PostCmd string `toml:"post_cmd"` // proxy setting ProxyType string `toml:"proxy_type"` Proxy string `toml:"proxy"` // OpenSSH type proxy setting ProxyCommand string `toml:"proxy_cmd"` // local rcfile setting // yes|no (default: yes) LocalRcUse string `toml:"local_rc"` // LocalRcPath LocalRcPath []string `toml:"local_rc_file"` // If LocalRcCompress is true, gzip the localrc file to base64 LocalRcCompress bool `toml:"local_rc_compress"` // LocalRcDecodeCmd is localrc decode command. run remote machine. LocalRcDecodeCmd string `toml:"local_rc_decode_cmd"` // LocalRcUncompressCmd is localrc un compress command. run remote machine. LocalRcUncompressCmd string `toml:"local_rc_uncompress_cmd"` // local/remote port forwarding setting. // ex. [`L`,`l`,`LOCAL`,`local`]|[`R`,`r`,`REMOTE`,`remote`] PortForwardMode string `toml:"port_forward"` // port forward (local). "host:port" PortForwardLocal string `toml:"port_forward_local"` // port forward (remote). "host:port" PortForwardRemote string `toml:"port_forward_remote"` // local/remote port forwarding settings // ex. {[`L`,`l`,`LOCAL`,`local`]|[`R`,`r`,`REMOTE`,`remote`]}:[localaddress]:[localport]:[remoteaddress]:[remoteport] PortForwards []string `toml:"port_forwards"` // local/remote Port Forwarding slice. Forwards []*PortForward // Dynamic Port Forward setting // ex.) "11080" DynamicPortForward string `toml:"dynamic_port_forward"` // Reverse Dynamic Port Forward setting // ex.) "11080" ReverseDynamicPortForward string `toml:"reverse_dynamic_port_forward"` // HTTP Dynamic Port Forward setting // ex.) "11080" HTTPDynamicPortForward string `toml:"http_dynamic_port_forward"` // HTTP Reverse Dynamic Port Forward setting // ex.) "11080" HTTPReverseDynamicPortForward string `toml:"http_reverse_dynamic_port_forward"` // NFS Dynamic Forward port setting // ex.) "12049" NFSDynamicForwardPort string `toml:"nfs_dynamic_forward"` // NFS Dynamic Forward path setting // ex.) "/path/to/remote" NFSDynamicForwardPath string `toml:"nfs_dynamic_forward_path"` // NFS Reverse Dynamic Forward port setting // ex.) "12049" NFSReverseDynamicForwardPort string `toml:"nfs_reverse_dynamic_forward"` // NFS Reverse Dynamic Forward path setting // ex.) "/path/to/local" NFSReverseDynamicForwardPath string `toml:"nfs_reverse_dynamic_forward_path"` // x11 forwarding setting X11 bool `toml:"x11"` // x11 trusted forwarding setting X11Trusted bool `toml:"x11_trusted"` // Connection Timeout second ConnectTimeout int `toml:"connect_timeout"` // Server Alive ServerAliveCountMax int `toml:"alive_max"` ServerAliveCountInterval int `toml:"alive_interval"` // note Note string `toml:"note"` }
ServerConfig Structure for holding SSH connection information
type ShellAliasConfig ¶ added in v0.6.8
type ShellAliasConfig struct { // command Command string `toml:"command"` }
type ShellConfig ¶ added in v0.5.3
type ShellConfig struct { // prompt Prompt string `toml:"PROMPT"` // lssh shell(parallel shell) prompt OPrompt string `toml:"OPROMPT"` // lssh shell(parallel shell) output prompt // message,title etc... Title string `toml:"title"` // history file HistoryFile string `toml:"histfile"` // pre | post command setting PreCmd string `toml:"pre_cmd"` PostCmd string `toml:"post_cmd"` // alias Alias map[string]ShellAliasConfig `toml:"alias"` // outexec OutexecCmdConfigs map[string]ShellOutexecCmdConfig `toml:"outexecs"` }
ShellConfig Structure for storing lssh-shell(parallel shell) settings.
type ShellOutexecCmdConfig ¶ added in v0.6.8
type ShellOutexecCmdConfig struct { // path Path string `toml:"path"` }
OutexecCmdConfig