config

package
v6.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Username         = "userdata.name"
	Password         = "userdata.password"
	Token            = "userdata.token"
	ServerUrl        = "userdata.api-url"
	CLIHttpUserAgent = "cli-user-agent"
)

Variables

This section is empty.

Functions

func GetConfigFile

func GetConfigFile() string

func GetServerUrl

func GetServerUrl() string

GetServerUrl returns the API URL from flags, config or env in order of priority. The caller must ensure to load config or env vars beforehand, so they can be included.

Priority: 1. Explicit flag 2. Env/config file 3. Flag default value

func GetUserData

func GetUserData() map[string]string

func Load

func Load() (err error)

Load binds environment variables (IONOS_USERNAME, IONOS_PASSWORD) to viper, and attempts to read config file for setting fallbacks for these newly-bound viper vars

func LoadFile

func LoadFile() error

func WriteFile

func WriteFile() error

Types

type Client

type Client struct {
	CloudClient        *cloudv6.APIClient
	AuthClient         *sdkgoauth.APIClient
	CertManagerClient  *certmanager.APIClient
	PostgresClient     *postgres.APIClient
	MongoClient        *mongo.APIClient
	DataplatformClient *dataplatform.APIClient
}

func GetClient

func GetClient() (*Client, error)

func NewTestClient

func NewTestClient(name, pwd, token, hostUrl string) (*Client, error)

NewTestClient - function used only for tests. Bypasses the singleton check, not recommended for normal use. TO BE REMOVED ONCE TESTS ARE REFACTORED

Jump to

Keyboard shortcuts

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