Documentation
¶
Index ¶
- Constants
- func DefaultConfigDir() (newConfigPath, userHomeDir string)
- func GetTokenFilePath() (string, error)
- func LoadToken() (*oauth2.Token, error)
- func ReadGWSFile(fileName string) (absoluteFile string, data []byte, err error)
- func SaveToken(token oauth2.Token) error
- func SetToken(token oauth2.Token) error
- type Config
- type Context
- type Dir
- type File
- type FilePatch
- type GCloud
- type TokenStorage
Constants ¶
View Source
const ( ConfigFileName = "config.yaml" ConfigDir = ".config/gws" DirectionUp = "up" DirectionDown = "down" )
View Source
const TokenFileName = "token.yaml"
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigDir ¶
func DefaultConfigDir() (newConfigPath, userHomeDir string)
func GetTokenFilePath ¶
Types ¶
type Config ¶
type Config struct {
Contexts map[string]*Context `validate:"required,dive,required" yaml:"contexts"`
CurrentContextName string ` yaml:"currentContext"`
FilePath string ` yaml:"-"`
TokenCheck bool ` yaml:"-"`
FilePatches map[string]FilePatch ` yaml:"filePatches,omitempty"`
SSHTimeoutSeconds int ` yaml:"sshTimeoutSeconds,omitempty"`
Token *TokenStorage ` yaml:"-"`
// contains filtered or unexported fields
}
func (*Config) CurrentContext ¶
func (*Config) SSHTimeout ¶
type Context ¶
type Context struct {
Host string `validate:"required" yaml:"host"`
Port int `validate:"required" yaml:"port"`
User string ` yaml:"user"`
PrivateKeyFile string `validate:"omitempty,file" yaml:"privateKeyFile"`
KnownHostsFile string `validate:"omitempty,file" yaml:"knownHostsFile"`
PostConnectCommand []string `yaml:"postConnectCommand,omitempty"`
GCloud *GCloud `yaml:"gcloud"`
Dirs []Dir `yaml:"dirs,omitempty"`
Files []File `yaml:"files,omitempty" validate:"dive,required"`
}
type TokenStorage ¶
Click to show internal directories.
Click to hide internal directories.