config

package
v6.6.5 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigFile

func GetConfigFile() string

func GetServerUrl

func GetServerUrl() string

GetServerUrl returns the server URL the SDK should use, with support for layered fallbacks.

  ⚠️ WARNING: NEVER use viper.Get/os.Getenv to try to bypass this function! ⚠️
- In older versions this env var was bound to Viper. Viper does not support case-sensitive keys.
  This means someone could export `IoNoS_API_url` and it would work. So - don't try it. Would be breaking.
- Using viper.Get instead of this func means you rely on non-deterministic global behaviour. Which is hard to debug.
  You won't have the certainty that ArgServerUrl is bound to the chain (ArgServerUrl, EnvServerUrl, CfgServerUrl) when you call viper.Get(ArgServerUrl)
  so, a very natural reaction to this is checking the next chain variables yourself or leaving it blank - which creates a ton of technical debt and code duplication, or unpredictable behaviour for the user

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

This section is empty.

Jump to

Keyboard shortcuts

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