config

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrDefault

func GetOrDefault(value, defaultValue string) string

GetOrDefault returns the value or default if empty

Types

type Config

type Config struct {
	PublicKey       string `mapstructure:"public_key"`
	SecretKey       string `mapstructure:"secret_key"`
	APIEndpoint     string `mapstructure:"api_endpoint"`
	StorageEndpoint string `mapstructure:"storage_endpoint"`
	Region          string `mapstructure:"region"`
}

func Load

func Load(cmd *cobra.Command, profile string) (*Config, error)

Load reads configuration with the following precedence (highest to lowest):

  1. CLI flags
  2. Environment variables
  3. Profile from config file
  4. Default values

type ConfigFile

type ConfigFile struct {
	Profiles map[string]Config `mapstructure:"profiles"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL