kube

package
v0.0.10-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFieldTree

func CreateFieldTree(gvk schema.GroupVersionKind) (map[string]*Field, error)

func CreateNodeTree

func CreateNodeTree(fieldTree map[string]*Field, objs []*unstructured.Unstructured, nodePrefix []string) map[string]*Node

func CurrentContext

func CurrentContext() (string, error)

func DiscoveryClient

func DiscoveryClient() (discovery.DiscoveryInterface, error)

func DynamicClient

func DynamicClient() (dynamic.Interface, error)

func FindGVK

func FindGVK(document *spec3.OpenAPI, paths []string) *schema.GroupVersionKind

func FindSchema

func FindSchema(document *spec3.OpenAPI, gvk schema.GroupVersionKind) (*spec.Schema, error)

FindSchema searches for a schema with the given GVK in the OpenAPI document

func GetDocument

func GetDocument(gvr schema.GroupVersionResource) (*spec3.OpenAPI, error)

func GetGVKs

func GetGVKs() ([]schema.GroupVersionKind, error)

func UpdateNodeTree

func UpdateNodeTree(existing map[string]*Node, fieldTree map[string]*Field, objs []*unstructured.Unstructured, nodePrefix []string) map[string]*Node

TODO: refactor, pull up traverse with create to function TODO: besides, expandedNodes should be a state of the schemaModel(ideally expand would not be a state of node)

func ValStr

func ValStr(node *Node, obj *unstructured.Unstructured) string

Types

type Field

type Field struct {
	Name     string
	Prefix   []string // TODO: rename to Ancestors?
	Level    int      // ? move to node?
	Type     string
	Required bool
	// optional
	Enum     []string
	Children map[string]*Field
}

field is a struct parsed from schema doc array, object types are indented to have children with two levels difference this would be enriched as Node when create node tree from fields

func (*Field) IsArray

func (f *Field) IsArray() bool

func (*Field) IsMap

func (f *Field) IsMap() bool

func (*Field) IsObject

func (f *Field) IsObject() bool

func (*Field) IsPrimitive

func (f *Field) IsPrimitive() bool

type Node

type Node struct {
	Expanded bool
	Selected bool
	// contains filtered or unexported fields
}

func (*Node) Children

func (n *Node) Children() map[string]*Node

func (*Node) Foldable

func (n *Node) Foldable() bool

func (*Node) FullPath

func (n *Node) FullPath() []string

TODO: move to kube*Field, use for digging array or map(ref?) val to create node

func (*Node) HeaderName

func (n *Node) HeaderName() string

func (*Node) Level

func (n *Node) Level() int

func (*Node) Name

func (n *Node) Name() string

func (*Node) NodeFullPath

func (n *Node) NodeFullPath() []string

func (*Node) Pickable

func (n *Node) Pickable(objs []*unstructured.Unstructured) bool

func (*Node) Prefix

func (n *Node) Prefix() []string

func (*Node) Renderable

func (n *Node) Renderable(objs []*unstructured.Unstructured) bool

func (*Node) Required

func (n *Node) Required() bool

func (*Node) SetExpanded

func (n *Node) SetExpanded(expanded bool)

func (*Node) ToggleFolder

func (n *Node) ToggleFolder()

line things

func (*Node) Type

func (n *Node) Type() string

type ResourceController

type ResourceController struct {
	// contains filtered or unexported fields
}

func (*ResourceController) EventEmitted

func (i *ResourceController) EventEmitted() <-chan emitMsg

func (*ResourceController) Inform

func (i *ResourceController) Inform() (chan struct{}, error)

func (*ResourceController) Objects

Jump to

Keyboard shortcuts

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