config

package
v0.0.0-...-d52247b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 17 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DefaultProvider = "default"

	ReadWritePerms = os.FileMode(0755)

	CurrentContext      = "current-context"
	ContextProvider     = "provider"
	CurrentCliVersion   = "cli-version"
	ContainerEngineType = "container-enginetype"

	EnvFnRegistry = "registry"
	EnvFnContext  = "context"

	OCI_CLI_AUTH_ENV_VAR            = "OCI_CLI_AUTH"
	OCI_CLI_AUTH_INSTANCE_PRINCIPAL = "instance_principal"
	OCI_CLI_AUTH_INSTANCE_OBO_USER  = "instance_obo_user"
	DefaultContainerEngineType      = "docker"
)

Variables

View Source
var Version = "0.6.32"

Version of Fn CLI

Functions

func GetContextsPath

func GetContextsPath() string

GetContextsPath : Returns the path to the contexts directory.

func GetCurrentVersion

func GetCurrentVersion(url string) string

func GetHomeDir

func GetHomeDir() string

func GetLatestVersion

func GetLatestVersion(url string) string

func GetVersion

func GetVersion(versionType string) string

func Init

func Init() error

Init : Initialise/load config direc

func LoadConfiguration

func LoadConfiguration(c *cli.Context) error

func ValidateContainerEngineType

func ValidateContainerEngineType(containerEngineType string) error

func WriteConfigValueToConfigFile

func WriteConfigValueToConfigFile(key, value string) error

func WriteYamlFile

func WriteYamlFile(filename string, values *ContextMap) error

Types

type ContextFile

type ContextFile struct {
	ContextProvider string `yaml:"provider" json:"provider"`
	EnvFnAPIURL     string `yaml:"api-url" json:"apiUrl"`
	EnvFnRegistry   string `yaml:"registry" json:"registry"`
}

ContextFile defines the internal structure of a default context

func NewContextFile

func NewContextFile(filePath string) (*ContextFile, error)

NewContextFile creates a new instance of the context YAML file

type ContextMap

type ContextMap map[string]string

func DecodeYAMLFile

func DecodeYAMLFile(filename string) (*ContextMap, error)

func DefaultContextConfigContents

func DefaultContextConfigContents() (contextMap *ContextMap)

type ViperConfigSource

type ViperConfigSource struct {
}

func (*ViperConfigSource) GetBool

func (*ViperConfigSource) GetBool(key string) bool

func (*ViperConfigSource) GetString

func (*ViperConfigSource) GetString(key string) string

func (*ViperConfigSource) IsSet

func (*ViperConfigSource) IsSet(key string) bool

Jump to

Keyboard shortcuts

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