config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientIdFlag      string = "client-id"
	ClientSecretFlag  string = "client-secret"
	APIEndpointFlag   string = "api-endpoint"
	TokenEndpointFlag string = "token-endpoint"
)

Common flags

Variables

This section is empty.

Functions

func AddCommandWithConfigPreCheck

func AddCommandWithConfigPreCheck(parentCmd *cobra.Command, cmd *cobra.Command)

addCommandWithConfigPreCheck adds a command to the parentCmd configuring a PreRunE function to ensure the configure command is executed before any other command

func ConfigPreCheck

func ConfigPreCheck(cmd *cobra.Command, args []string) error

configPreCheck verifies if the base configuration is set

func CreateConfigFile

func CreateConfigFile(home string, name string, ext string) (string, error)

CreateConfigFile creates the config file if it does not exist

func CreateFakeConfigFile

func CreateFakeConfigFile(t *testing.T) string

CreateFakeConfigFile configures viper to write to a temporary file

func GetString

func GetString(key string) string

GetString returns a configuration string

func InitConfig

func InitConfig()

initConfig reads in config file and ENV variables if set

func Set

func Set(key string, value interface{})

Set defines a configuration value

func WriteAuthenticationConfig

func WriteAuthenticationConfig(
	clientId,
	clientSecret,
	apiEndpoint,
	tokenEndpoint string) error

WriteAuthenticationConfig persists the authentication configuration

Types

This section is empty.

Jump to

Keyboard shortcuts

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