Documentation
¶
Index ¶
- func CreateFieldTree(gvk schema.GroupVersionKind) (map[string]*Field, error)
- func CreateNodeTree(fieldTree map[string]*Field, objs []*unstructured.Unstructured, ...) map[string]*Node
- func CurrentContext() (string, error)
- func DiscoveryClient() (discovery.DiscoveryInterface, error)
- func DynamicClient() (dynamic.Interface, error)
- func FindGVK(document *spec3.OpenAPI, paths []string) *schema.GroupVersionKind
- func FindSchema(document *spec3.OpenAPI, gvk schema.GroupVersionKind) (*spec.Schema, error)
- func GetDocument(gvr schema.GroupVersionResource) (*spec3.OpenAPI, error)
- func GetGVKs() ([]schema.GroupVersionKind, error)
- func GetGVR(gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
- func UpdateNodeTree(existing map[string]*Node, fieldTree map[string]*Field, ...) map[string]*Node
- func ValStr(node *Node, obj *unstructured.Unstructured) string
- type Field
- type Node
- func (n *Node) Children() map[string]*Node
- func (n *Node) Foldable() bool
- func (n *Node) FullPath() []string
- func (n *Node) HeaderName() string
- func (n *Node) Level() int
- func (n *Node) Name() string
- func (n *Node) NodeFullPath() []string
- func (n *Node) Pickable(objs []*unstructured.Unstructured) bool
- func (n *Node) Prefix() []string
- func (n *Node) Renderable(objs []*unstructured.Unstructured) bool
- func (n *Node) Required() bool
- func (n *Node) SetExpanded(expanded bool)
- func (n *Node) ToggleFolder()
- func (n *Node) Type() string
- type ResourceController
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 DiscoveryClient ¶
func DiscoveryClient() (discovery.DiscoveryInterface, error)
func DynamicClient ¶
func FindSchema ¶
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 GetGVR ¶
func GetGVR(gvk schema.GroupVersionKind) (schema.GroupVersionResource, 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) IsPrimitive ¶
type Node ¶
func (*Node) FullPath ¶
TODO: move to kube*Field, use for digging array or map(ref?) val to create node
func (*Node) HeaderName ¶
func (*Node) NodeFullPath ¶
func (*Node) Pickable ¶
func (n *Node) Pickable(objs []*unstructured.Unstructured) bool
func (*Node) Renderable ¶
func (n *Node) Renderable(objs []*unstructured.Unstructured) bool
func (*Node) SetExpanded ¶
type ResourceController ¶
type ResourceController struct {
// contains filtered or unexported fields
}
func NewResourceController ¶
func NewResourceController(gvr schema.GroupVersionResource) *ResourceController
func (*ResourceController) EventEmitted ¶
func (i *ResourceController) EventEmitted() <-chan emitMsg
func (*ResourceController) Inform ¶
func (i *ResourceController) Inform() (chan struct{}, error)
func (*ResourceController) Objects ¶
func (i *ResourceController) Objects() []*unstructured.Unstructured
Click to show internal directories.
Click to hide internal directories.