Documentation
¶
Overview ¶
Package config parse /etc/os-release More about the os-release: https://www.linux.org/docs/man5/os-release.html We parse /etc/os-release, this is done specifically for a use case on Oracle Cloud Cloud Shell where DockerEngine is not available and Docker cli point to podman cli
Index ¶
- Constants
- Variables
- func GetContextsPath() string
- func GetCurrentVersion(url string) string
- func GetHomeDir() string
- func GetLatestVersion(url string) string
- func GetVersion(versionType string) string
- func Init() error
- func LoadConfiguration(c *cli.Context) error
- func ValidateContainerEngineType(containerEngineType string) error
- func WriteConfigValueToConfigFile(key, value string) error
- func WriteYamlFile(filename string, values *ContextMap) error
- type ContextFile
- type ContextMap
- type OSRelease
- type ViperConfigSource
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_CLOUDSHELL_ENV_VAR = "OCI_CLI_CLOUD_SHELL" OCI_CLOUDSHELL_OS_NAME = "Oracle Linux Server" OCI_CLOUDSHELL_OL8_VERSION_IDENTIFIER = "el8" DEFAULT_LINUX_OS_RELEASE_FILE_PATH = "/etc/os-release" OCI_CLI_AUTH_INSTANCE_PRINCIPAL = "instance_principal" OCI_CLI_AUTH_INSTANCE_OBO_USER = "instance_obo_user" DefaultContainerEngineType = "docker" )
Variables ¶
View Source
var EnvIsOL8CloudShell bool = false
View Source
var Version = "0.6.38"
Version of Fn CLI
Functions ¶
func GetContextsPath ¶
func GetContextsPath() string
GetContextsPath : Returns the path to the contexts directory.
func GetCurrentVersion ¶
func GetHomeDir ¶
func GetHomeDir() string
func GetLatestVersion ¶
func GetVersion ¶
func LoadConfiguration ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.