Documentation
¶
Index ¶
Constants ¶
View Source
const (
ConfigFileFolder = ".moley"
)
Variables ¶
This section is empty.
Functions ¶
func GetConfigFilePath ¶
GetConfigFilePath returns the full path to the config file
func GetConfigFolderPath ¶
GetConfigFolderPath returns the path to the config folder
func SaveMoleyConfigToFile ¶
func SaveMoleyConfigToFile(cfg *MoleyConfig) error
SaveMoleyConfigToFile saves the Moley configuration to file
Types ¶
type CloudflareConfig ¶
type CloudflareConfig struct {
Token string `mapstructure:"token" yaml:"token"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides a simple way to manage global configuration
func GetManager ¶
func GetManager() *Manager
GetManager returns the singleton config manager instance
func (*Manager) Set ¶
func (m *Manager) Set(config *MoleyConfig)
Set updates the cached configuration
type MoleyConfig ¶
type MoleyConfig struct {
Cloudflare CloudflareConfig `mapstructure:"cloudflare" yaml:"cloudflare"`
}
func LoadFromFlags ¶
func LoadFromFlags(cmd *cobra.Command) (*MoleyConfig, error)
LoadFromFlags loads configuration from command line flags
func LoadMoleyConfig ¶
func LoadMoleyConfig() (*MoleyConfig, error)
LoadMoleyConfig loads the global Moley configuration from the user's home directory
func NewConfig ¶
func NewConfig() *MoleyConfig
NewConfig creates a new Config instance with default values
Click to show internal directories.
Click to hide internal directories.