cliconfig

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

cliconfig package will provide functions for getting the correct configuration for the client, it will correctly handling on disk configuration and overrides

Index

Constants

View Source
const ConfigPathEnvVarName = "MIACONFIG"

Variables

This section is empty.

Functions

func CacheFolderPath

func CacheFolderPath() string

func ConfigFilePath

func ConfigFilePath() string

func ConfigFilePathString

func ConfigFilePathString() string

func CredentialsFilePath

func CredentialsFilePath() string

Types

type AuthReadWriter

type AuthReadWriter struct {
	// contains filtered or unexported fields
}

func NewAuthReadWriter

func NewAuthReadWriter(locator *ConfigPathLocator, config *api.ContextConfig, auth *api.AuthConfig) *AuthReadWriter

func (*AuthReadWriter) ReadJWTToken

func (rw *AuthReadWriter) ReadJWTToken() *oauth2.Token

func (*AuthReadWriter) WriteJWTToken

func (rw *AuthReadWriter) WriteJWTToken(jwt *oauth2.Token)

type ConfigOverrides

type ConfigOverrides struct {
	Endpoint              string
	CertificateAuthority  string
	InsecureSkipTLSVerify bool
	CompanyID             string
	ProjectID             string
	Context               string
	AuthName              string
	Environment           string
}

type ConfigPathLocator

type ConfigPathLocator struct {
	ExplicitPath string
	// contains filtered or unexported fields
}

func NewConfigPathLocator

func NewConfigPathLocator() *ConfigPathLocator

func (*ConfigPathLocator) ConfigLocation

func (cr *ConfigPathLocator) ConfigLocation() string

func (*ConfigPathLocator) DefaultConfigPath

func (cr *ConfigPathLocator) DefaultConfigPath() string

func (*ConfigPathLocator) ReadConfig

func (cr *ConfigPathLocator) ReadConfig() (*api.Config, error)

func (*ConfigPathLocator) WriteConfig

func (cr *ConfigPathLocator) WriteConfig(config *api.Config) error

type ConfigReader

type ConfigReader struct {
	// contains filtered or unexported fields
}

func NewConfigReader

func NewConfigReader(config *api.Config, overrides *ConfigOverrides) *ConfigReader

func (*ConfigReader) ClientConfig

func (cr *ConfigReader) ClientConfig(locator *ConfigPathLocator) (*client.Config, error)

Directories

Path Synopsis
package api contains the definitions of the struct for the miactl configuration
package api contains the definitions of the struct for the miactl configuration

Jump to

Keyboard shortcuts

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