Documentation ¶
Overview ¶
Package tkgconfigreaderwriter provides utilities to read/write configs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // ClusterConfigClient returns clusterctl config client ClusterConfigClient() config.Client // TKGConfigReaderWriter returns reader writer interface to read/write values from/to config TKGConfigReaderWriter() TKGConfigReaderWriter }
Client implements tkg config client interface
func NewWithReaderWriter ¶
func NewWithReaderWriter(readerWriter TKGConfigReaderWriter) (Client, error)
NewWithReaderWriter creates new tkgConfigClient with readerWriter client
type TKGConfigReaderWriter ¶
type TKGConfigReaderWriter interface { config.Reader MergeInConfig(configFilePath string) error SetMap(data map[string]string) }
TKGConfigReaderWriter defines methods of reader which is implemented using viper for reading from environment variables and from a tkg config file. Also defines methods of writer to set/update the variables and config file
func NewReaderWriterFromConfigFile ¶
func NewReaderWriterFromConfigFile(clusterConfigPath, tkgConfigPath string) (TKGConfigReaderWriter, error)
NewReaderWriterFromConfigFile returns new reader writer from config file NOTE: This function should only be used for testing purpose and/or for read only operations for config values which cannot be updated by tkgcli internally Please use this function causiously as it might not be required for your usecase as most of the clients has readerwrite client