Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFavorite ¶
AddFavorite adds a named favorite to the config. Returns an error if the name already exists. Defaults provider to "azure" if empty.
func ConfigPath ¶
func ConfigPath() string
ConfigPath returns the config file path, respecting the GRANT_CONFIG env var.
func RemoveFavorite ¶
RemoveFavorite removes a named favorite. Returns an error if not found.
Types ¶
type Config ¶
type Config struct {
Profile string `yaml:"profile"`
DefaultProvider string `yaml:"default_provider"`
Favorites map[string]Favorite `yaml:"favorites"`
}
Config holds the grant application configuration.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config with default values.
type Favorite ¶
type Favorite struct {
Provider string `yaml:"provider"`
Target string `yaml:"target"`
Role string `yaml:"role"`
}
Favorite represents a saved elevation target.
type FavoriteEntry ¶
FavoriteEntry pairs a favorite name with its data, used for sorted listing.
func ListFavorites ¶
func ListFavorites(cfg *Config) []FavoriteEntry
ListFavorites returns all favorites sorted alphabetically by name.
Click to show internal directories.
Click to hide internal directories.