Documentation
¶
Index ¶
- func GlobalConfigDir() string
- func GlobalConfigPath() (string, error)
- func ResolveExtensionID(flagValue string, cfg *Config) (string, error)
- func ResolveSource(argValue string, cfg *Config) string
- func ValidateAuth(cfg *Config) error
- func WriteConfig(path string, cfg *Config) error
- type AuthConfig
- type Config
- type ExtensionConfig
- type ExtensionsConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GlobalConfigDir ¶
func GlobalConfigDir() string
GlobalConfigDir returns the path to the global config directory.
func GlobalConfigPath ¶
GlobalConfigPath returns the path to the global config file. Returns an error if the home directory cannot be determined.
func ResolveExtensionID ¶
ResolveExtensionID returns the extension ID from the flag override or config.
func ResolveSource ¶
ResolveSource returns the source path from the flag override or config.
func ValidateAuth ¶
ValidateAuth checks that all required auth fields are present.
func WriteConfig ¶
WriteConfig writes a config file to the specified path.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
ClientID string `mapstructure:"client_id" toml:"client_id"`
ClientSecret string `mapstructure:"client_secret" toml:"client_secret"`
RefreshToken string `mapstructure:"refresh_token" toml:"refresh_token"`
}
AuthConfig holds OAuth2 credentials.
type Config ¶
type Config struct {
PublisherID string `mapstructure:"publisher_id" toml:"publisher_id"`
Auth AuthConfig `mapstructure:"auth" toml:"auth"`
Extensions ExtensionsConfig `mapstructure:"extensions" toml:"extensions,omitempty"`
}
Config holds all configuration for the CLI.
type ExtensionConfig ¶
type ExtensionConfig struct {
ID string `mapstructure:"id" toml:"id,omitempty"`
Source string `mapstructure:"source" toml:"source,omitempty"`
}
ExtensionConfig holds configuration for a single extension.
type ExtensionsConfig ¶
type ExtensionsConfig struct {
Default ExtensionConfig `mapstructure:"default" toml:"default,omitempty"`
}
ExtensionsConfig holds extension configurations (designed for multi-extension M2 support).