konf

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KonfID

type KonfID string

ID unifies ID and File management that konf uses Currently an ID is defined by the context and clustername of the config, separated by an underscore I have chosen this combination as it is fairly unique among multiple configs. I decided against using just context.name as a lot of times the context is just called "default", which results in lots of naming collisions Some special characters that are reserved by the filesystem, will be replaced by a "-" character

func IDFromClusterAndContext

func IDFromClusterAndContext(cluster, context string) KonfID

IDFromClusterAndContext creates an id based on the cluster and context It escapes any illegal file characters and is filesafe

func IDFromFileInfo

func IDFromFileInfo(fi fs.FileInfo) KonfID

IDFromFileInfo creates an ID from the name of a file

func IDFromProcessID

func IDFromProcessID(pid int) KonfID

IDFromProcessID creates a KonfID based on the supplied processID

func (KonfID) ActivePath

func (id KonfID) ActivePath() string

ActivePath creates a valid filepath inside the configured activeDir

func (KonfID) StorePath

func (id KonfID) StorePath() string

StorePathForID creates a valid filepath inside the configured storeDir

type Konfig

type Konfig struct {
	Id         KonfID
	Kubeconfig k8s.Config
	StorePath  string
}

func KonfsFromKubeconfig

func KonfsFromKubeconfig(kubeconfig io.Reader) (konfs []*Konfig, err error)

KonfsFromKubeconfig takes in the content of a kubeconfig and splits it into one or multiple konfs.

No error is being returned if the kubeconfig contains no contexts, instead konfs is simply an empty slice

Jump to

Keyboard shortcuts

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