config

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config implements configuration loading and parsing

Index

Constants

View Source
const (
	// DefaultConfigFile is the default path to the config file
	DefaultConfigFile = "~/.swo-cli.yml"
	// DefaultAPIURL is the default URL of the SWO API
	DefaultAPIURL = "https://api.na-01.cloud.solarwinds.com"
	// APIURLContextKey is the context key for the API URL
	APIURLContextKey = "api-url"
	// TokenContextKey is the context key for the API token
	TokenContextKey = "token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIURL string `yaml:"api-url"`
	Token  string `yaml:"token"`
}

Config represents the base configuration for the SWO CLI

func Init

func Init(configPath string, apiURL string, apiToken string) (*Config, error)

Init initializes the configuration by loading from the specified config file, environment variables, and command line flags. Precedence: CLI flags, environment, config file

Jump to

Keyboard shortcuts

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