kube

package
v0.0.0-...-de05cad Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogDeleting = logDouble(
	"Deleting %s...\n",
	"Successfully deleted %s\n",
	"Error deleting %s\n",
)
View Source
var LogLoading = logDouble(
	"Loading %s...\n",
	"Successfully loaded %s\n",
	"Error loading %s\n",
)

Logs "loading xxx" when entering a function and returns a function that logs on exit Use defer to invoke the return value with the error result:

func LoadSomething(param int) (err error) {
    defer LogLoading("something(%d)", param)(err)
}

Functions

func SplitFileExtension

func SplitFileExtension(name string) (string, string)

func SplitGroupVersion

func SplitGroupVersion(groupVersion string) (string, string)

Types

type Context

type Context struct {
	*Settings
	f.BaseDir

	ContextName string
	// contains filtered or unexported fields
}

func (*Context) Get

func (c *Context) Get(name string) (f.Node, error)

func (*Context) List

func (c *Context) List() ([]string, error)

type Item

type Item struct {
	f.BaseFile
	Resource         *Resource
	Name             string
	Extension        string
	OriginalContents []byte
}

func (*Item) Delete

func (i *Item) Delete() (err error)

func (*Item) ReadEntireContents

func (i *Item) ReadEntireContents() ([]byte, error)

func (*Item) Write

func (i *Item) Write(data []byte) error

type Kubernetes

type Kubernetes struct {
	*Settings
	f.BaseDir

	Contexts map[string]*Context
	// contains filtered or unexported fields
}

func (*Kubernetes) Get

func (k *Kubernetes) Get(name string) (f.Node, error)

func (*Kubernetes) List

func (k *Kubernetes) List() ([]string, error)

func (*Kubernetes) LoadConfig

func (k *Kubernetes) LoadConfig(kubeconfig string) error

type NamespacedResource

type NamespacedResource struct {
	f.BaseDir
	Context      *Context
	ResourceType metav1.APIResource
	GVR          schema.GroupVersionResource
	GVK          schema.GroupVersionKind
}

func (*NamespacedResource) Get

func (n *NamespacedResource) Get(name string) (f.Node, error)

func (*NamespacedResource) List

func (n *NamespacedResource) List() ([]string, error)

type Resource

type Resource struct {
	f.BaseDir
	Context      *Context
	ResourceType metav1.APIResource
	GVR          schema.GroupVersionResource
	GVK          schema.GroupVersionKind
	Namespace    string
}

func (*Resource) Get

func (r *Resource) Get(name string) (f.Node, error)

func (*Resource) List

func (r *Resource) List() ([]string, error)

type Settings

type Settings struct {
	ShowJsonFiles bool
	ShowYamlFiles bool
	PrettyJson    bool
	Readonly      bool
}

Jump to

Keyboard shortcuts

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