Documentation
¶
Index ¶
- Variables
- func DeleteAlias(name string) error
- func GetAlias(name string) (string, error)
- func GetConfigPath() (string, error)
- func ImportAliases(filepath string) error
- func IsOnCallSite(site string) bool
- func LoadAliases() (map[string]string, error)
- func SaveAliases(aliases map[string]string) error
- func SetAlias(name, command string) error
- type AliasConfig
- type Config
Constants ¶
This section is empty.
Variables ¶
var ConfigPathFunc = getDefaultConfigPath
ConfigPathFunc is a function variable that returns the config file path This can be overridden in tests
Functions ¶
func GetConfigPath ¶
GetConfigPath returns the path to the config file
func ImportAliases ¶
ImportAliases imports aliases from a YAML file
func IsOnCallSite ¶ added in v0.15.0
IsOnCallSite returns true if the site is an on-call domain (contains "oncall"). On-call domains like navy.oncall.datadoghq.com are already fully-qualified and should not have "api." prepended.
func LoadAliases ¶
LoadAliases loads aliases from the config file
func SaveAliases ¶
SaveAliases saves aliases to the config file
Types ¶
type AliasConfig ¶
AliasConfig represents the alias configuration structure
type Config ¶
Config holds the application configuration
func (*Config) GetAPIHost ¶ added in v0.15.0
GetAPIHost returns the host portion of the API URL (without scheme). On-call domains are returned as-is; all other sites get "api.{site}".
func (*Config) GetAPIURL ¶
GetAPIURL returns the full API URL for the configured site. On-call domains are used as-is; all other sites get "https://api.{site}".