Documentation ¶
Index ¶
- func ChangeViperValues(key string, value interface{}) error
- func ExistingKeys() []string
- func ExistsKey(key string) bool
- func GetCliClient() controller.Interface
- func GetCliOutput() io.Writer
- func GetConfiguredScope() string
- func GetConfiguredServerIP() string
- func GetScope() (string, error)
- func InitViperConfig()
- func ProcessArg(arg, scope string) (string, string, error)
- func ReadViperConfig(basePath string) error
- func SetClient(url string)
- func SetMockedClient(err error)
- func SetOutput(out io.Writer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeViperValues ¶
ChangeViperValues - changes the values of the viper configuration and saves it in the config file of inspr, if the file is not created it will return an error.
func ExistingKeys ¶
func ExistingKeys() []string
ExistingKeys - returns to the user all available keys in viper's configs.
func ExistsKey ¶
ExistsKey - informs to the user if the key passed exists in the default keys that are saved in the inspr config file
func GetCliClient ¶
func GetCliClient() controller.Interface
GetCliClient returns the default controller client for cli.
func GetConfiguredScope ¶
func GetConfiguredScope() string
GetConfiguredScope is responsible for returning config value for scope. Avoids having to constants public.
func GetConfiguredServerIP ¶
func GetConfiguredServerIP() string
GetConfiguredServerIP is responsible for returning config value for serverIp. Avoids having to constants public.
func GetScope ¶
GetScope retreives a path for use as base on insprd request. Takes into consideration viper config and scope flag.
func InitViperConfig ¶
func InitViperConfig()
InitViperConfig - sets defaults values and where is the file in which new values can be read
func ProcessArg ¶
ProcessArg is responsible for separating a path into an component name and it's parent's path. < path, name, error >
func ReadViperConfig ¶
ReadViperConfig - reads the inspr's viper config, in case it didn't found any, it creates one with the defaults values
func SetMockedClient ¶
func SetMockedClient(err error)
SetMockedClient configures singleton's client as a mocked client given a error
Types ¶
This section is empty.