Documentation ¶
Index ¶
- Variables
- func CreateDefaultConfigFile(location string) error
- func GetDefaultConfigLocation() string
- type Config
- func (config *Config) GetCommandsForRemote(remote *util.Remote) []string
- func (config *Config) GetEnvironmentVariablesForRemote(remote *util.Remote) map[string]string
- func (config *Config) GetFilesForRemote(remote *util.Remote) []File
- func (config *Config) GetServerConfig(remote *util.Remote) *ServerConfig
- type EnvVariables
- type File
- type GlobalConfig
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = &Config{ Global: GlobalConfig{ Env: EnvVariables{ Static: map[string]string{"LC_ENVSSH": "1"}, Moved: []string{"LANG", "EDITOR", "VISUAL"}, }, Files: []File{{Local: "$HOME/.bashrc", Remote: "$HOME/.bashrc"}}, Commands: []string{"export ENVSSH=1"}, }, Servers: []ServerConfig{ { Host: "localhost", Port: 22, Aliases: []string{"127.0.0.1"}, Env: EnvVariables{ Static: map[string]string{}, Moved: []string{}, }, Files: []File{}, Commands: []string{}, }, }, }
DefaultConfig is the default configuration for the tool that is written to the YAML file on first connect if it does not exist.
Functions ¶
func CreateDefaultConfigFile ¶
CreateDefaultConfigFile creates default configuration file to given location.
func GetDefaultConfigLocation ¶
func GetDefaultConfigLocation() string
GetDefaultConfigLocation returns default envssh configuration file location.
Types ¶
type Config ¶
type Config struct { Global GlobalConfig `yaml:"global"` Servers []ServerConfig `yaml:"servers"` }
Config contains global and server specific configurations.
func ParseConfig ¶
ParseConfig parses envssh configuration from given location. Creates new default configuration to the location if it does not exist.
func (*Config) GetCommandsForRemote ¶
GetCommandsForRemote returns a list of commands to run on remote.
func (*Config) GetEnvironmentVariablesForRemote ¶
GetEnvironmentVariablesForRemote returns a list of environment variables that are set to remote.
func (*Config) GetFilesForRemote ¶
GetFilesForRemote returns a list of files that are transferred to remote.
func (*Config) GetServerConfig ¶
func (config *Config) GetServerConfig(remote *util.Remote) *ServerConfig
GetServerConfig returns server specific config based on hostname if it exists in the Config struct.
type EnvVariables ¶
EnvVariables that should be set on remote.
type GlobalConfig ¶
type GlobalConfig struct { Env EnvVariables `yaml:"env"` Files []File `yaml:"files"` Commands []string `yaml:"commands"` }
GlobalConfig is base for all server configurations and is used for all remotes.
type ServerConfig ¶
type ServerConfig struct { Host string `yaml:"host"` Port uint16 `yaml:"port"` Aliases []string `yaml:"aliases"` Env EnvVariables `yaml:"env"` Files []File `yaml:"files"` Commands []string `yaml:"commands"` }
ServerConfig presents a single server configuration identified by the host name.