Documentation ¶
Index ¶
- Constants
- Variables
- func GarbageCollectKeyPairs(fs afero.Fs) error
- func Initialize(fs afero.Fs, configDirPath string) error
- func InitializeWithLogger(fs afero.Fs, configDirPath string, loggerToUse io.Writer) error
- func IsAliasMustBeUniqueError(err error) bool
- func IsCredentialsRequiredError(err error) bool
- func IsEndpointNotDefinedError(err error) bool
- func IsEndpointProviderIsImmuttableError(err error) bool
- func IsGarbageCollectionFailedError(err error) bool
- func IsGarbageCollectionPartiallyFailedError(err error) bool
- func IsNoEndpointSelectedError(err error) bool
- func IsUnableToRefreshTokenErrorr(err error) bool
- func UserAgent() string
- func WriteToFile() error
Constants ¶
const ( // ConfigFileType is the type of config file we use. ConfigFileType = "yaml" // ConfigFileName is the name of the configuration file, without ending. ConfigFileName = "config" // ConfigFilePermission is the rights mask for the config file. ConfigFilePermission = 0600 // ProgramName is the name of this program. ProgramName = "gsctl" // VersionCheckURL is the URL telling us what the latest gsctl version is. VersionCheckURL = "https://github.com/giantswarm/gsctl/releases/latest" // VersionCheckInterval is the minimum time to wait between two version checks. VersionCheckInterval = time.Hour * 24 )
Variables ¶
var ( // Config is an object holding all configuration fields. Config = newConfigStruct() // Version is the version number, to be set on build by the go linker. Version string // BuildDate is the build date, to be set on build by the go linker. BuildDate string // Commit is the latest git commit hash, to be set on build by the go linker. Commit string // FileSystem is the afero filesystem used to store the config file and certificates. FileSystem afero.Fs // HomeDirPath is the path to the user's home directory. HomeDirPath string // DefaultConfigDirPath is the default config dir path to use. DefaultConfigDirPath string // ConfigDirPath is the actual path of the config dir. ConfigDirPath string // CertsDirPath is the path of the directory holding certificates. CertsDirPath string // ConfigFilePath is the path of the configuration file. ConfigFilePath string // KubeConfigPaths is the path(s) of kubeconfig files as slice of strings. KubeConfigPaths []string // SystemUser is the current system user as user.User (os/user). SystemUser *user.User )
Functions ¶
func GarbageCollectKeyPairs ¶
GarbageCollectKeyPairs removes files from expired key pairs.
func Initialize ¶
Initialize sets up all configuration. It's distinct from init() on purpose, so it's execution can be triggered in a controlled way. It's supposed to be called after init(). The configDirPath argument can be given to override the DefaultConfigDirPath.
func InitializeWithLogger ¶ added in v0.2.3
InitializeWithLogger sets up all configuration. It's distinct from init() on purpose, so it's execution can be triggered in a controlled way. It's supposed to be called after init(). The configDirPath argument can be given to override the DefaultConfigDirPath. the loggerToUse argument specifies the io.Writer to write log messages to.
func IsAliasMustBeUniqueError ¶
IsAliasMustBeUniqueError asserts aliasMustBeUniqueError.
func IsCredentialsRequiredError ¶
IsCredentialsRequiredError asserts credentialsRequiredError.
func IsEndpointNotDefinedError ¶
IsEndpointNotDefinedError asserts endpointNotDefinedError.
func IsEndpointProviderIsImmuttableError ¶
IsEndpointProviderIsImmuttableError asserts endpointProviderIsImmuttableError.
func IsGarbageCollectionFailedError ¶
IsGarbageCollectionFailedError asserts garbageCollectionFailedError.
func IsGarbageCollectionPartiallyFailedError ¶
IsGarbageCollectionPartiallyFailedError asserts garbageCollectionPartiallyFailedError.
func IsNoEndpointSelectedError ¶
IsNoEndpointSelectedError asserts noEndpointSelectedError.
func IsUnableToRefreshTokenErrorr ¶
IsUnableToRefreshTokenErrorr asserts unableToRefreshTokenError.
func UserAgent ¶
func UserAgent() string
UserAgent returns the user agent string identifying us in HTTP requests.
func WriteToFile ¶
func WriteToFile() error
WriteToFile writes the configuration data to a YAML file.
Types ¶
This section is empty.