kubeconfig

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Name string
	WithPath
}

type ContextLoader

type ContextLoader struct {
	Loader *Loader
}

ContextLoader struct to load contexts from kubeconfigs

func NewContextLoader

func NewContextLoader(loader *Loader) *ContextLoader

NewContextLoader returns a new ContextLoader

func (*ContextLoader) LoadContexts

func (c *ContextLoader) LoadContexts() ([]Context, error)

LoadContexts method to load all contexts from all kubeconfigs

type FileSystemProvider

type FileSystemProvider struct {
	IncludePatterns []string
	ExcludePatterns []string
}

FileSystemProvider struct to load kubeconfigs from filesystem

func NewFileSystemProvider

func NewFileSystemProvider(IncludePatterns, ExcludePatterns []string) *FileSystemProvider

NewFileSystemProvider returns a new FileSystemProvider

func (*FileSystemProvider) Load

func (f *FileSystemProvider) Load() ([]WithPath, error)

type Loader

type Loader struct {
	Providers []Provider
}

Loader struct to handle multiple providers

func NewLoader

func NewLoader(providers ...Provider) *Loader

NewLoader returns a new Loader with given providers

func (*Loader) LoadAll

func (l *Loader) LoadAll() ([]WithPath, error)

LoadAll method to load all kubeconfigs from all providers

type Provider

type Provider interface {
	Load() ([]WithPath, error)
}

Provider interface for different kubeconfig sources

type WithPath

type WithPath struct {
	Config   *api.Config
	FilePath string
}

WithPath struct to hold the kubeconfig and its file path

Jump to

Keyboard shortcuts

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