xray

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: 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 separatot.
	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 Childrens

type Childrens []*TreeNode

Childrens represents a collection of children nodes.

func (Childrens) Len

func (c Childrens) Len() int

Len returns the list size.

func (Childrens) Less

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

Less returns true if i < j.

func (Childrens) Swap

func (c Childrens) 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 {
	GVR, Path, Status string
	Parent            *NodeSpec
}

NodeSpec represents a node resource specification.

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 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 Childrens
	Parent   *TreeNode
	Extras   map[string]string
}

TreeNode represents a resource tree node.

func Hydrate

func Hydrate(refs []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(styles config.Xray) 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