tkgconfigreaderwriter

package
v0.0.0-...-b25b198 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

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 New

func New(tkgConfigPath string) (Client, error)

New creates new tkgConfigClient from tkg config file

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

Jump to

Keyboard shortcuts

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