Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureViper(executable string, configFile string) error
- func ErrConfigLoadFailed(cause error) error
- func ErrHomeDirFailed(cause error) error
- func ErrWorkingDirFailed(cause error) error
- func NewClient(target string, debug bool) (*client.Cludod, error)
- type AWSRoleConfig
- type ClientConfig
- type Config
- type GithubConfig
- type ServerConfig
- type UserConfig
- type UserRolesConfig
Constants ¶
View Source
const CludoExecutable = "cludo"
View Source
const CludodExecutable = "cludod"
View Source
const DefaultClientConfig = "default"
View Source
const EnvPrefix = "CLUDO"
EnvPrefix defines a prefix required on all environment variables bound to Config. For example the path "number" is bound to CLUDO_NUMBER.
Variables ¶
View Source
var ErrConfigNotFound = errors.New("Failed to load configuration file: File not found")
Functions ¶
func ConfigureViper ¶
func ErrConfigLoadFailed ¶
func ErrHomeDirFailed ¶
func ErrWorkingDirFailed ¶
Types ¶
type AWSRoleConfig ¶
type ClientConfig ¶
type ClientConfig struct { Interactive bool `mapstructure:"interactive"` ShellPath string `mapstructure:"shell_path"` }
func (*ClientConfig) NewDefaultClientSigner ¶
func (cc *ClientConfig) NewDefaultClientSigner(pkey string) (*auth.Signer, error)
NewDefaultClientSigner attempts to read and decode the provided private key and then generate a signer that can be used to sign requests to the server. It returns a *auth.Signer and any errors that were encountered.
type Config ¶
type Config struct { Client *ClientConfig `mapstructure:"client"` Server *ServerConfig `mapstructure:"server"` Target string `mapstructure:"target"` SSHKeyPaths []string `mapstructure:"ssh_key_paths"` }
func NewConfigFromViper ¶
type GithubConfig ¶
type GithubConfig struct {
APIEndpoint string `mapstructure:"api_endpoint"`
}
type ServerConfig ¶
type ServerConfig struct { Port int `yaml:"port"` Targets map[string]*UserRolesConfig `mapstructure:"targets"` Github *GithubConfig `mapstructure:"github"` Users []*UserConfig `mapstructure:"users"` }
func (*ServerConfig) GetUser ¶
func (sc *ServerConfig) GetUser(id string) (*UserConfig, bool)
func (*ServerConfig) NewConfigAuthorizer ¶
func (sc *ServerConfig) NewConfigAuthorizer() (*auth.Authorizer, error)
func (*ServerConfig) NewGithubAuthorizer ¶
func (sc *ServerConfig) NewGithubAuthorizer() (*auth.Authorizer, error)
type UserConfig ¶
type UserConfig struct { PublicKey string `mapstructure:"public_key"` Name string `mapstructure:"name"` GithubID string `mapstructure:"github_id"` Targets []string `mapstructure:"targets"` }
func (*UserConfig) ID ¶
func (uc *UserConfig) ID() string
type UserRolesConfig ¶
type UserRolesConfig struct {
AWS *AWSRoleConfig `mapstructure:"aws"`
}
Click to show internal directories.
Click to hide internal directories.