Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupArgsAndFlags(cmd *cobra.Command, args *[]string)
- func ConfigDir() string
- func CreateOrUpdateAuthConfig(authConfig AuthConfig) error
- func CreateOrUpdateGitHubPersonalAccessToken(gitHubPersonalAccessToken string) error
- func EnsureFile() (string, error)
- func GetClientTimeout() time.Duration
- func GetDefaultServiceAuthPublicKey() string
- func GetEnv(env, defaultValue string) string
- func GetEnvAsBoolean(envName, defaultValue string) bool
- func GetEnvAsFloat64(envName, defaultValue string) float64
- func GetEnvAsInt64(envName, defaultValue string) int64
- func GetEnvAsInteger(envName, defaultValue string) int
- func GetHost() string
- func GetHostScheme() string
- func GetLogFormat() string
- func GetLogLevel() string
- func GetRootDomain() string
- func GetToken() (string, error)
- func IsDebugLogLevel() bool
- func IsDryRun() bool
- func IsProd() bool
- func LookupGitHubPersonalAccessToken() (string, error)
- func RemoveAuthConfig() error
- func RemoveGitHubPersonalAccessToken() error
- type AuthConfig
- type ConfigFile
Constants ¶
const ( DefaultDir string = "~/.omnistrate" DefaultFile string = "config.yml" DefaultPermissions os.FileMode = 0700 )
Variables ¶
Functions ¶
func CleanupArgsAndFlags ¶
func ConfigDir ¶
func ConfigDir() string
ConfigDir returns the path to the omnistrate-ctl config directory.
func CreateOrUpdateAuthConfig ¶
func CreateOrUpdateAuthConfig(authConfig AuthConfig) error
CreateOrUpdateAuthConfig creates or updates the authentication configuration.
func CreateOrUpdateGitHubPersonalAccessToken ¶
CreateOrUpdateGitHubPersonalAccessToken creates or updates the authentication configuration.
func EnsureFile ¶
EnsureFile creates the root directory and config file.
func GetClientTimeout ¶
func GetDefaultServiceAuthPublicKey ¶
func GetDefaultServiceAuthPublicKey() string
GetDefaultServiceAuthPublicKey returns the default public key for environment creation
func GetEnvAsBoolean ¶ added in v0.10.2
func GetEnvAsFloat64 ¶ added in v0.10.2
func GetEnvAsInt64 ¶ added in v0.10.2
func GetEnvAsInteger ¶ added in v0.10.2
func GetHostScheme ¶
func GetHostScheme() string
GetHostScheme returns the scheme of the Omnistrate server
func GetLogFormat ¶ added in v0.10.2
func GetLogFormat() string
func GetLogLevel ¶ added in v0.10.2
func GetLogLevel() string
func GetRootDomain ¶
func GetRootDomain() string
GetRootDomain returns the root domain of the Omnistrate server
func IsDebugLogLevel ¶ added in v0.10.2
func IsDebugLogLevel() bool
func LookupGitHubPersonalAccessToken ¶
LookupGitHubPersonalAccessToken returns the authentication configuration.
func RemoveAuthConfig ¶
func RemoveAuthConfig() error
RemoveAuthConfig deletes the authentication configuration.
func RemoveGitHubPersonalAccessToken ¶
func RemoveGitHubPersonalAccessToken() error
RemoveGitHubPersonalAccessToken deletes the authentication configuration.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Token string `yaml:"token,omitempty"`
}
AuthConfig represents the authentication configuration.
func LookupAuthConfig ¶
func LookupAuthConfig() (AuthConfig, error)
LookupAuthConfig returns the authentication configuration.
type ConfigFile ¶
type ConfigFile struct {
AuthConfigs []AuthConfig `yaml:"auths"`
GitHubPersonalAccessToken string `yaml:"github_personal_access_token,omitempty"`
FilePath string `yaml:"-"`
}
ConfigFile represents the Omnistrate CTL config file.
func New ¶
func New(filePath string) (*ConfigFile, error)
New initializes a config file for the given file path.