xray

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyParent indicates a parent node context key.
	KeyParent TreeRef = "parent"

	// KeySAAutomount indicates whether an automount sa token is active or not.
	KeySAAutomount TreeRef = "automount"

	// PathSeparator represents a node path separator.
	PathSeparator = "::"

	// StatusKey status map key.
	StatusKey = "status"

	// InfoKey state map key.
	InfoKey = "info"

	// OkStatus stands for all is cool.
	OkStatus = "ok"

	// ToastStatus stands for a resource is not up to snuff
	// aka not running or incomplete.
	ToastStatus = "toast"

	// CompletedStatus stands for a completed resource.
	CompletedStatus = "completed"

	// MissingRefStatus stands for a non existing resource reference.
	MissingRefStatus = "noref"
)

Variables

This section is empty.

Functions

func EmojiInfo added in v0.13.3

func EmojiInfo() map[string]string

EmojiInfo returns emoji help.

Types

type ChildNodes added in v0.24.8

type ChildNodes []*TreeNode

ChildNodes represents a collection of children nodes.

func (ChildNodes) Len added in v0.24.8

func (c ChildNodes) Len() int

Len returns the list size.

func (ChildNodes) Less added in v0.24.8

func (c ChildNodes) Less(i, j int) bool

Less returns true if i < j.

func (ChildNodes) Swap added in v0.24.8

func (c ChildNodes) Swap(i, j int)

Swap swaps list values.

type Container

type Container struct{}

Container represents an xray renderer.

func (*Container) Render

func (c *Container) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type DaemonSet

type DaemonSet struct{}

DaemonSet represents an xray renderer.

func (*DaemonSet) Render

func (d *DaemonSet) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type Deployment

type Deployment struct{}

Deployment represents an xray renderer.

func (*Deployment) Render

func (d *Deployment) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type Generic

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

Generic renders a generic resource to screen.

func (*Generic) Render

func (g *Generic) Render(ctx context.Context, ns string, o interface{}) error

Render renders a K8s resource to screen.

func (*Generic) SetTable

func (g *Generic) SetTable(t *metav1beta1.Table)

SetTable sets the tabular resource.

type Namespace

type Namespace struct{}

Namespace represents an xray renderer.

func (*Namespace) Render

func (n *Namespace) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type NodeSpec

type NodeSpec struct {
	GVRs, Paths, Statuses []string
}

NodeSpec represents a node resource specification.

func (NodeSpec) AsGVR added in v0.14.1

func (s NodeSpec) AsGVR() string

AsGVR returns a gvr hierarchy as string.

func (NodeSpec) AsPath added in v0.14.1

func (s NodeSpec) AsPath() string

AsPath returns path hierarchy as string.

func (NodeSpec) AsStatus added in v0.14.1

func (s NodeSpec) AsStatus() string

AsStatus returns a status hierarchy as string.

func (NodeSpec) GVR

func (s NodeSpec) GVR() string

GVR returns the current GVR.

func (NodeSpec) ParentGVR added in v0.14.1

func (s NodeSpec) ParentGVR() *string

ParentGVR returns the parent GVR.

func (NodeSpec) ParentPath added in v0.14.1

func (s NodeSpec) ParentPath() *string

ParentPath returns the parent path.

func (NodeSpec) Path

func (s NodeSpec) Path() string

Path returns the current path.

func (NodeSpec) Status

func (s NodeSpec) Status() string

Status returns the current status.

type Pod

type Pod struct{}

Pod represents an xray renderer.

func (*Pod) Render

func (p *Pod) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type ReplicaSet added in v0.13.1

type ReplicaSet struct{}

ReplicaSet represents an xray renderer.

func (*ReplicaSet) Render added in v0.13.1

func (r *ReplicaSet) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type Section added in v0.19.0

type Section struct {
	render.Base
}

Section represents an xray renderer.

func (*Section) Render added in v0.19.0

func (s *Section) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type Service

type Service struct{}

Service represents an xray renderer.

func (*Service) Render

func (s *Service) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type ServiceAccount

type ServiceAccount struct{}

ServiceAccount represents an xray renderer.

func (*ServiceAccount) Render

func (s *ServiceAccount) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type StatefulSet

type StatefulSet struct{}

StatefulSet represents an xray renderer.

func (*StatefulSet) Render

func (s *StatefulSet) Render(ctx context.Context, ns string, o interface{}) error

Render renders an xray node.

type TreeNode

type TreeNode struct {
	GVR, ID  string
	Children ChildNodes
	Parent   *TreeNode
	Extras   map[string]string
}

TreeNode represents a resource tree node.

func Hydrate

func Hydrate(specs []NodeSpec) *TreeNode

Hydrate hydrates a full tree bases on a collection of specifications.

func NewTreeNode

func NewTreeNode(gvr, id string) *TreeNode

NewTreeNode returns a new instance.

func (*TreeNode) Add

func (t *TreeNode) Add(c *TreeNode)

Add adds a new child node.

func (*TreeNode) Blank

func (t *TreeNode) Blank() bool

Blank returns true if this node is unset.

func (*TreeNode) Clear

func (t *TreeNode) Clear()

Clear delete all descendant nodes.

func (*TreeNode) Count

func (t *TreeNode) Count(gvr string) int

Count all the nodes from this node.

func (*TreeNode) CountChildren

func (t *TreeNode) CountChildren() int

CountChildren returns the children count.

func (*TreeNode) Diff

func (t *TreeNode) Diff(d *TreeNode) bool

Diff computes a tree diff.

func (*TreeNode) Dump

func (t *TreeNode) Dump()

Dump for debug...

func (*TreeNode) DumpStdOut

func (t *TreeNode) DumpStdOut()

DumpStdOut to stdout for debug.

func (*TreeNode) Filter

func (t *TreeNode) Filter(q string, filter func(q, path string) bool) *TreeNode

Filter filters the node based on query.

func (*TreeNode) Find

func (t *TreeNode) Find(gvr, id string) *TreeNode

Find locates a node given a gvr/id spec.

func (*TreeNode) Flatten

func (t *TreeNode) Flatten() []NodeSpec

Flatten returns a collection of node specs.

func (*TreeNode) IsLeaf

func (t *TreeNode) IsLeaf() bool

IsLeaf returns true if node has no children.

func (*TreeNode) IsRoot

func (t *TreeNode) IsRoot() bool

IsRoot returns true if node is top node.

func (*TreeNode) Level

func (t *TreeNode) Level() int

Level computes the current node level.

func (*TreeNode) MaxDepth

func (t *TreeNode) MaxDepth(depth int) int

MaxDepth computes the max tree depth.

func (*TreeNode) Root

func (t *TreeNode) Root() *TreeNode

Root returns the current tree root node.

func (*TreeNode) ShallowClone

func (t *TreeNode) ShallowClone() *TreeNode

ShallowClone performs a shallow node clone.

func (*TreeNode) Sort

func (t *TreeNode) Sort()

Sort sorts the tree nodes.

func (*TreeNode) Spec

func (t *TreeNode) Spec() NodeSpec

Spec returns this node specification.

func (*TreeNode) Title

func (t *TreeNode) Title(noIcons bool) string

Title computes the node title.

type TreeRef

type TreeRef string

TreeRef namespaces tree context values.

Jump to

Keyboard shortcuts

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