render

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Less

func Less(isNumber, isDuration bool, id1, id2, v1, v2 string) bool

Less return true if c1 < c2.

Types

type Alias

type Alias struct {
}

Alias renders a aliases to screen.

func (Alias) Header

func (Alias) Header(ns string) Header

Header returns a header row.

func (Alias) Render

func (Alias) Render(o interface{}, ns string, r *Row) error

Render renders a K8s resource to screen. BOZO!! Pass in a row with pre-alloc fields??

type AliasRes

type AliasRes struct {
	Resource string
	Aliases  []string
}

AliasRes represents an alias resource.

func (AliasRes) DeepCopyObject

func (a AliasRes) DeepCopyObject() interface{}

DeepCopyObject returns a container copy.

type BObj

type BObj struct {
}

func (BObj) Header

func (obj BObj) Header() Header

func (BObj) Render

func (obj BObj) Render(o interface{}, ns string, row *Row) error

type EBS

type EBS struct {
}

func (EBS) Header

func (ebs EBS) Header() Header

Header returns a header row.

func (EBS) Render

func (ebs EBS) Render(o interface{}, ns string, row *Row) error

type EC2

type EC2 struct {
}

func (EC2) Header

func (e EC2) Header() Header

Header returns a header row.

func (EC2) Render

func (e EC2) Render(o interface{}, ns string, row *Row) error

type EC2I

type EC2I struct {
}

func (EC2I) Header

func (ei EC2I) Header() Header

func (EC2I) Render

func (ei EC2I) Render(o interface{}, ns string, row *Row) error

type EC2S

type EC2S struct {
}

func (EC2S) Header

func (es EC2S) Header() Header

func (EC2S) Render

func (es EC2S) Render(o interface{}, ns string, row *Row) error

type Fields

type Fields []string

Fields represents a collection of row fields.

func (Fields) Clone

func (f Fields) Clone() Fields

Clone returns a copy of the fields.

func (Fields) Customize

func (f Fields) Customize(cols []int, out Fields)

Customize returns a subset of fields.

type Header []HeaderColumn

Header represents a table header.

func (Header) Clone

func (h Header) Clone() Header

Clone duplicates a header.

func (Header) Columns

func (h Header) Columns(wide bool) []string

Columns return header as a collection of strings.

func (Header) Customize

func (h Header) Customize(cols []string, wide bool) Header

Customize builds a header from custom col definitions.

func (Header) Dump

func (h Header) Dump()

Dump for debugging.

func (Header) IndexOf

func (h Header) IndexOf(colName string, includeWide bool) int

IndexOf returns the col index or -1 if none.

func (Header) IsMetricsCol

func (h Header) IsMetricsCol(col int) bool

IsMetricsCol checks if given column index represents metrics.

func (Header) IsTimeCol

func (h Header) IsTimeCol(col int) bool

IsTimeCol checks if given column index represents a timestamp.

func (Header) MapIndices

func (h Header) MapIndices(cols []string, wide bool) []int

MapIndices returns a collection of mapped column indices based of the requested columns.

type HeaderColumn

type HeaderColumn struct {
	Name             string
	SortIndicatorIdx int
	Align            int
	Hide             bool
	Wide             bool
	MX               bool
	Time             bool
}

HeaderColumn represent a table header. SortIndicatorIdx is the position of alphabet in header name to highlight. Set SortIndicatorIdx to -1 to ignore highlighting any alphabet in header name.

func (HeaderColumn) Clone

func (h HeaderColumn) Clone() HeaderColumn

Clone copies a header.

type IAMU

type IAMU struct {
}

func (IAMU) Header

func (iamu IAMU) Header() Header

func (IAMU) Render

func (iamu IAMU) Render(o interface{}, ns string, row *Row) error

type IAMUG

type IAMUG struct {
}

func (IAMUG) Header

func (iamug IAMUG) Header() Header

func (IAMUG) Render

func (iamug IAMUG) Render(o interface{}, ns string, row *Row) error

type IamGroupUser

type IamGroupUser struct {
}

func (IamGroupUser) Header

func (igu IamGroupUser) Header() Header

func (IamGroupUser) Render

func (igu IamGroupUser) Render(o interface{}, ns string, row *Row) error

type IamRole

type IamRole struct {
}

func (IamRole) Header

func (ir IamRole) Header() Header

func (IamRole) Render

func (ir IamRole) Render(o interface{}, ns string, row *Row) error

type IamRolePloicy

type IamRolePloicy struct {
}

func (IamRolePloicy) Header

func (irp IamRolePloicy) Header() Header

func (IamRolePloicy) Render

func (irp IamRolePloicy) Render(o interface{}, ns string, row *Row) error

type IamUserGroupPloicy

type IamUserGroupPloicy struct {
}

func (IamUserGroupPloicy) Header

func (iugp IamUserGroupPloicy) Header() Header

func (IamUserGroupPloicy) Render

func (iugp IamUserGroupPloicy) Render(o interface{}, ns string, row *Row) error

type IamUserPloicy

type IamUserPloicy struct {
}

func (IamUserPloicy) Header

func (iup IamUserPloicy) Header() Header

func (IamUserPloicy) Render

func (iup IamUserPloicy) Render(o interface{}, ns string, row *Row) error

type Lambda

type Lambda struct {
}

func (Lambda) Header

func (l Lambda) Header() Header

Header returns a header row.

func (Lambda) Render

func (l Lambda) Render(o interface{}, ns string, row *Row) error

type ResEvent

type ResEvent int

ResEvent represents a resource event.

const (
	// EventUnchanged notifies listener resource has not changed.
	EventUnchanged ResEvent = 1 << iota

	// EventAdd notifies listener of a resource was added.
	EventAdd

	// EventUpdate notifies listener of a resource updated.
	EventUpdate

	// EventDelete  notifies listener of a resource was deleted.
	EventDelete

	// EventClear the stack was reset.
	EventClear
)

type Row

type Row struct {
	ID     string
	Fields Fields
}

Row represents a collection of columns.

func NewRow

func NewRow(size int) Row

NewRow returns a new row with initialized fields.

func (Row) Clone

func (r Row) Clone() Row

Clone copies a row.

func (Row) Customize

func (r Row) Customize(cols []int) Row

Customize returns a row subset based on given col indices.

func (Row) Len

func (r Row) Len() int

Len returns the length of the row.

type RowEvent

type RowEvent struct {
	Kind ResEvent
	Row  Row
}

RowEvent tracks resource instance events.

func NewRowEvent

func NewRowEvent(kind ResEvent, row Row) RowEvent

NewRowEvent returns a new row event.

func (RowEvent) Clone

func (r RowEvent) Clone() RowEvent

Clone returns a row event deep copy.

func (RowEvent) Customize

func (r RowEvent) Customize(cols []int) RowEvent

Customize returns a new subset based on the given column indices.

type RowEventSorter

type RowEventSorter struct {
	Events     RowEvents
	Index      int
	IsNumber   bool
	IsDuration bool
	Asc        bool
}

RowEventSorter sorts row events by a given colon.

func (RowEventSorter) Len

func (r RowEventSorter) Len() int

func (RowEventSorter) Less

func (r RowEventSorter) Less(i, j int) bool

func (RowEventSorter) Swap

func (r RowEventSorter) Swap(i, j int)

type RowEvents

type RowEvents []RowEvent

RowEvents a collection of row events.

func (RowEvents) Clear

func (r RowEvents) Clear() RowEvents

Clear delete all row events.

func (RowEvents) Clone

func (r RowEvents) Clone() RowEvents

Clone returns a rowevents deep copy.

func (RowEvents) Customize

func (r RowEvents) Customize(cols []int) RowEvents

Customize returns custom row events based on columns layout.

func (RowEvents) Delete

func (r RowEvents) Delete(id string) RowEvents

Delete removes an element by id.

func (RowEvents) FindIndex

func (r RowEvents) FindIndex(id string) (int, bool)

FindIndex locates a row index by id. Returns false is not found.

func (RowEvents) Sort

func (r RowEvents) Sort(sortCol int, isDuration, numCol, asc bool)

Sort rows based on column index and order.

func (RowEvents) Upsert

func (r RowEvents) Upsert(re RowEvent) RowEvents

Upsert add or update a row if it exists.

type Rows

type Rows []Row

Rows represents a collection of rows.

func (Rows) Delete

func (rr Rows) Delete(id string) Rows

Delete removes an element by id.

func (Rows) Find

func (rr Rows) Find(id string) (int, bool)

Find locates a row by id. Returns false is not found.

func (Rows) Upsert

func (rr Rows) Upsert(r Row) Rows

Upsert adds a new item.

type S3

type S3 struct {
}

func (S3) Header

func (s3 S3) Header() Header

func (S3) Render

func (s3 S3) Render(o interface{}, ns string, row *Row) error

type SG

type SG struct {
}

func (SG) Header

func (sg SG) Header() Header

func (SG) Render

func (sg SG) Render(o interface{}, ns string, row *Row) error

type SQS

type SQS struct {
}

func (SQS) Header

func (sqs SQS) Header() Header

Header returns a header row.

func (SQS) Render

func (sqs SQS) Render(o interface{}, ns string, row *Row) error

type Subnet

type Subnet struct {
}

func (Subnet) Header

func (sn Subnet) Header() Header

func (Subnet) Render

func (sn Subnet) Render(o interface{}, ns string, row *Row) error

type TableData

type TableData struct {
	Header    Header
	RowEvents RowEvents
	// contains filtered or unexported fields
}

func NewTableData

func NewTableData() *TableData

NewTableData returns a new table.

func (*TableData) Clear

func (t *TableData) Clear()

Clear clears out the entire table.

func (*TableData) Clone

func (t *TableData) Clone() *TableData

Clone returns a copy of the table.

func (*TableData) Count

func (t *TableData) Count() int

Count returns the number of entries.

func (*TableData) Customize

func (t *TableData) Customize(cols []string, wide bool) *TableData

Customize returns a new model with customized column layout.

func (*TableData) Delete

func (t *TableData) Delete(newKeys map[string]struct{})

Delete removes items in cache that are no longer valid.

func (*TableData) Empty

func (t *TableData) Empty() bool

Empty checks if there are no entries.

func (*TableData) IndexOfHeader

func (t *TableData) IndexOfHeader(h string) int

IndexOfHeader return the index of the header.

func (*TableData) SetHeader

func (t *TableData) SetHeader(h Header)

SetHeader sets table header.

func (*TableData) Update

func (t *TableData) Update(rows Rows)

Update computes row deltas and update the table data.

type VPC

type VPC struct {
}

func (VPC) Header

func (v VPC) Header() Header

func (VPC) Render

func (v VPC) Render(o interface{}, ns string, row *Row) error

Jump to

Keyboard shortcuts

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