config

package
v0.0.0-...-e6112dc Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 15 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"
)
View Source
const (
	RequestInfoMessage     = "Request ID: %v Execution Time: %v"
	RequestTimeMessage     = "Request Execution Time: %v"
	StatusDeletingAll      = "Status: Deleting %v with ID: %v..."
	StatusRemovingAll      = "Status: Removing %v with ID: %v..."
	DeleteAllAppendErr     = "error occurred removing %v with ID: %v. error: %w"
	WaitDeleteAllAppendErr = "error occurred waiting on removing %v with ID: %v. error: %w"
)

Some legacy messages, which might need looking into

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
	DbaasClient       *dbaas.APIClient
}

func GetClient

func GetClient() (*Client, error)

func NewTestClient

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

NewTestClient - function used only for tests 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
JackTT - Gopher 🇻🇳