Documentation ¶
Index ¶
- Constants
- Variables
- func AssertEqual(t *testing.T, expected, got Component)
- func TitleFromTitleComponent(tc []TitleComponent) (string, error)
- type Action
- type AdjList
- type Alert
- type AlertType
- type Annotations
- type AnnotationsConfig
- type Button
- type ButtonGroup
- func (bg *ButtonGroup) AddButton(button Button)
- func (b *ButtonGroup) GetMetadata() Metadata
- func (b *ButtonGroup) IsEmpty() bool
- func (b *ButtonGroup) LessThan(i interface{}) bool
- func (bg *ButtonGroup) MarshalJSON() ([]byte, error)
- func (b *ButtonGroup) SetAccessor(accessor string)
- func (b *ButtonGroup) String() string
- type ButtonGroupConfig
- type ButtonOption
- type Card
- func (c *Card) AddAction(action Action)
- func (b *Card) GetMetadata() Metadata
- func (b *Card) IsEmpty() bool
- func (b *Card) LessThan(i interface{}) bool
- func (c *Card) MarshalJSON() ([]byte, error)
- func (b *Card) SetAccessor(accessor string)
- func (c *Card) SetAlert(alert Alert)
- func (c *Card) SetBody(body Component)
- func (b *Card) String() string
- type CardConfig
- type CardList
- type CardListConfig
- type Component
- type Confirmation
- type ContainerDef
- type Containers
- func (t *Containers) Add(name string, image string)
- func (t *Containers) GetMetadata() Metadata
- func (b *Containers) IsEmpty() bool
- func (b *Containers) LessThan(i interface{}) bool
- func (t *Containers) MarshalJSON() ([]byte, error)
- func (b *Containers) SetAccessor(accessor string)
- func (b *Containers) String() string
- type ContainersConfig
- type ContentResponse
- type Edge
- type EdgeType
- type Error
- type ErrorConfig
- type ExpressionSelector
- func (t *ExpressionSelector) GetMetadata() Metadata
- func (b *ExpressionSelector) IsEmpty() bool
- func (t *ExpressionSelector) IsSelector()
- func (b *ExpressionSelector) LessThan(i interface{}) bool
- func (t *ExpressionSelector) MarshalJSON() ([]byte, error)
- func (t *ExpressionSelector) Name() string
- func (b *ExpressionSelector) SetAccessor(accessor string)
- func (b *ExpressionSelector) String() string
- type ExpressionSelectorConfig
- type FlexLayout
- func (fl *FlexLayout) AddSections(sections ...FlexLayoutSection)
- func (fl *FlexLayout) GetMetadata() Metadata
- func (b *FlexLayout) IsEmpty() bool
- func (b *FlexLayout) LessThan(i interface{}) bool
- func (fl *FlexLayout) MarshalJSON() ([]byte, error)
- func (b *FlexLayout) SetAccessor(accessor string)
- func (fl *FlexLayout) SetButtonGroup(group *ButtonGroup)
- func (b *FlexLayout) String() string
- type FlexLayoutConfig
- type FlexLayoutItem
- type FlexLayoutSection
- type Form
- type FormField
- type FormFieldCheckBox
- func (ff *FormFieldCheckBox) Configuration() map[string]interface{}
- func (bff FormFieldCheckBox) Label() string
- func (ff *FormFieldCheckBox) MarshalJSON() ([]byte, error)
- func (bff FormFieldCheckBox) Name() string
- func (bff FormFieldCheckBox) Type() string
- func (ff *FormFieldCheckBox) UnmarshalJSON(data []byte) error
- func (ff *FormFieldCheckBox) Value() interface{}
- type FormFieldHidden
- func (ff *FormFieldHidden) Configuration() map[string]interface{}
- func (bff FormFieldHidden) Label() string
- func (ff *FormFieldHidden) MarshalJSON() ([]byte, error)
- func (bff FormFieldHidden) Name() string
- func (bff FormFieldHidden) Type() string
- func (ff *FormFieldHidden) UnmarshalJSON(data []byte) error
- func (ff *FormFieldHidden) Value() interface{}
- type FormFieldNumber
- func (ff *FormFieldNumber) Configuration() map[string]interface{}
- func (bff FormFieldNumber) Label() string
- func (ff *FormFieldNumber) MarshalJSON() ([]byte, error)
- func (bff FormFieldNumber) Name() string
- func (bff FormFieldNumber) Type() string
- func (ff *FormFieldNumber) UnmarshalJSON(data []byte) error
- func (ff *FormFieldNumber) Value() interface{}
- type FormFieldPassword
- func (ff *FormFieldPassword) Configuration() map[string]interface{}
- func (bff FormFieldPassword) Label() string
- func (ff *FormFieldPassword) MarshalJSON() ([]byte, error)
- func (bff FormFieldPassword) Name() string
- func (bff FormFieldPassword) Type() string
- func (ff *FormFieldPassword) UnmarshalJSON(data []byte) error
- func (ff *FormFieldPassword) Value() interface{}
- type FormFieldRadio
- func (ff *FormFieldRadio) Configuration() map[string]interface{}
- func (bff FormFieldRadio) Label() string
- func (ff *FormFieldRadio) MarshalJSON() ([]byte, error)
- func (bff FormFieldRadio) Name() string
- func (bff FormFieldRadio) Type() string
- func (ff *FormFieldRadio) UnmarshalJSON(data []byte) error
- func (ff *FormFieldRadio) Value() interface{}
- type FormFieldSelect
- func (ff *FormFieldSelect) Configuration() map[string]interface{}
- func (bff FormFieldSelect) Label() string
- func (ff *FormFieldSelect) MarshalJSON() ([]byte, error)
- func (bff FormFieldSelect) Name() string
- func (bff FormFieldSelect) Type() string
- func (ff *FormFieldSelect) UnmarshalJSON(data []byte) error
- func (ff *FormFieldSelect) Value() interface{}
- type FormFieldText
- func (ff *FormFieldText) Configuration() map[string]interface{}
- func (bff FormFieldText) Label() string
- func (ff *FormFieldText) MarshalJSON() ([]byte, error)
- func (bff FormFieldText) Name() string
- func (bff FormFieldText) Type() string
- func (ff *FormFieldText) UnmarshalJSON(data []byte) error
- func (ff *FormFieldText) Value() interface{}
- type FormFieldTextarea
- func (ff *FormFieldTextarea) Configuration() map[string]interface{}
- func (bff FormFieldTextarea) Label() string
- func (ff *FormFieldTextarea) MarshalJSON() ([]byte, error)
- func (bff FormFieldTextarea) Name() string
- func (bff FormFieldTextarea) Type() string
- func (ff *FormFieldTextarea) UnmarshalJSON(data []byte) error
- func (ff *FormFieldTextarea) Value() interface{}
- type Graphviz
- type GraphvizConfig
- type InputChoice
- type LabelSelector
- func (t *LabelSelector) GetMetadata() Metadata
- func (b *LabelSelector) IsEmpty() bool
- func (t *LabelSelector) IsSelector()
- func (b *LabelSelector) LessThan(i interface{}) bool
- func (t *LabelSelector) MarshalJSON() ([]byte, error)
- func (t *LabelSelector) Name() string
- func (b *LabelSelector) SetAccessor(accessor string)
- func (b *LabelSelector) String() string
- type LabelSelectorConfig
- type Labels
- type LabelsConfig
- type Link
- func (t *Link) GetMetadata() Metadata
- func (b *Link) IsEmpty() bool
- func (t *Link) LessThan(i interface{}) bool
- func (t *Link) MarshalJSON() ([]byte, error)
- func (t *Link) Ref() string
- func (b *Link) SetAccessor(accessor string)
- func (t *Link) String() string
- func (t *Link) SupportsTitle()
- func (t *Link) Text() string
- type LinkConfig
- type List
- func (t *List) Add(items ...Component)
- func (b *List) GetMetadata() Metadata
- func (b *List) IsEmpty() bool
- func (b *List) LessThan(i interface{}) bool
- func (t *List) MarshalJSON() ([]byte, error)
- func (b *List) SetAccessor(accessor string)
- func (t *List) SetIcon(name, source string)
- func (b *List) String() string
- type ListConfig
- type Loading
- type LoadingConfig
- type Logs
- type LogsConfig
- type Metadata
- type Node
- type NodeStatus
- type Nodes
- type Operator
- type PodStatus
- func (ps *PodStatus) AddSummary(name string, details []Component, status NodeStatus)
- func (b *PodStatus) GetMetadata() Metadata
- func (b *PodStatus) IsEmpty() bool
- func (b *PodStatus) LessThan(i interface{}) bool
- func (ps *PodStatus) MarshalJSON() ([]byte, error)
- func (b *PodStatus) SetAccessor(accessor string)
- func (ps *PodStatus) Status() NodeStatus
- func (b *PodStatus) String() string
- type PodStatusConfig
- type PodSummary
- type Port
- type PortConfig
- type PortForwardState
- type Ports
- type PortsConfig
- type Quadrant
- func (t *Quadrant) GetMetadata() Metadata
- func (b *Quadrant) IsEmpty() bool
- func (b *Quadrant) LessThan(i interface{}) bool
- func (t *Quadrant) MarshalJSON() ([]byte, error)
- func (t *Quadrant) Set(pos QuadrantPosition, label, value string) error
- func (b *Quadrant) SetAccessor(accessor string)
- func (b *Quadrant) String() string
- type QuadrantConfig
- type QuadrantPosition
- type QuadrantValue
- type ResourceViewer
- func (rv *ResourceViewer) AddEdge(nodeID, childID string, edgeType EdgeType) error
- func (rv *ResourceViewer) AddNode(id string, node Node)
- func (rv *ResourceViewer) GetMetadata() Metadata
- func (b *ResourceViewer) IsEmpty() bool
- func (b *ResourceViewer) LessThan(i interface{}) bool
- func (rv *ResourceViewer) MarshalJSON() ([]byte, error)
- func (rv *ResourceViewer) Select(id string)
- func (b *ResourceViewer) SetAccessor(accessor string)
- func (b *ResourceViewer) String() string
- func (rv *ResourceViewer) Validate() error
- type ResourceViewerConfig
- type Selector
- type Selectors
- func (t *Selectors) Add(selectors ...Selector)
- func (t *Selectors) GetMetadata() Metadata
- func (b *Selectors) IsEmpty() bool
- func (b *Selectors) LessThan(i interface{}) bool
- func (t *Selectors) MarshalJSON() ([]byte, error)
- func (b *Selectors) SetAccessor(accessor string)
- func (b *Selectors) String() string
- type SelectorsConfig
- type Summary
- func (t *Summary) Add(sections ...SummarySection)
- func (t *Summary) AddAction(action Action)
- func (t *Summary) GetMetadata() Metadata
- func (b *Summary) IsEmpty() bool
- func (b *Summary) LessThan(i interface{}) bool
- func (t *Summary) MarshalJSON() ([]byte, error)
- func (t *Summary) Sections() []SummarySection
- func (b *Summary) SetAccessor(accessor string)
- func (t *Summary) SetAlert(alert Alert)
- func (b *Summary) String() string
- type SummaryConfig
- type SummarySection
- type SummarySections
- type Tab
- type Table
- func (t *Table) Add(rows ...TableRow)
- func (t *Table) AddColumn(name string)
- func (t *Table) AddFilter(columnName string, filter TableFilter)
- func (t *Table) Columns() []TableCol
- func (b *Table) GetMetadata() Metadata
- func (t *Table) IsEmpty() bool
- func (b *Table) LessThan(i interface{}) bool
- func (t *Table) MarshalJSON() ([]byte, error)
- func (t *Table) Rows() []TableRow
- func (b *Table) SetAccessor(accessor string)
- func (t *Table) SetIsLoading(isLoading bool)
- func (t *Table) SetPlaceholder(placeholder string)
- func (t *Table) Sort(name string, reverse bool)
- func (b *Table) String() string
- type TableCol
- type TableConfig
- type TableFilter
- type TableRow
- type Text
- func (t *Text) DisableMarkdown()
- func (t *Text) EnableMarkdown()
- func (b *Text) GetMetadata() Metadata
- func (b *Text) IsEmpty() bool
- func (t *Text) IsMarkdown() bool
- func (t *Text) LessThan(i interface{}) bool
- func (t *Text) MarshalJSON() ([]byte, error)
- func (b *Text) SetAccessor(accessor string)
- func (t *Text) String() string
- func (t *Text) SupportsTitle()
- type TextConfig
- type Timestamp
- type TimestampConfig
- type TitleComponent
- type TypedObject
- type YAML
- type YAMLConfig
Constants ¶
const ( // WidthQuarter is a quarter width section. WidthQuarter int = 6 // WidthHalf is a half width section. WidthHalf int = 12 // WidthFull is a full width section. WidthFull int = 24 )
const ( FieldTypeCheckBox = "checkbox" FieldTypeRadio = "radio" FieldTypeText = "text" FieldTypePassword = "password" FieldTypeNumber = "number" FieldTypeSelect = "select" FieldTypeTextarea = "textarea" FieldTypeHidden = "hidden" )
const ( // EdgeTypeImplicit is an implicit edge EdgeTypeImplicit = "implicit" // EdgeTypeExplicit is an explicit edge EdgeTypeExplicit = "explicit" )
Variables ¶
var EmptyContentResponse = ContentResponse{}
EmptyContentResponse is an empty content response.
Functions ¶
func AssertEqual ¶
AssertEqual asserts two components are equal.
func TitleFromTitleComponent ¶ added in v0.7.0
func TitleFromTitleComponent(tc []TitleComponent) (string, error)
TitleFromTitleComponent gets a title from a TitleComponent
Types ¶
type Action ¶
type Action struct { Name string `json:"name"` Title string `json:"title"` Form Form `json:"form"` }
Action is an action that can be performed on a component.
type AlertType ¶
type AlertType string
const ( // AlertTypeError is an error alert. AlertTypeError AlertType = "error" // AlertTypeWarning is a warning alert. AlertTypeWarning AlertType = "warning" // AlertTypeInfo is an info alert. AlertTypeInfo AlertType = "info" // AlertTypeSuccess is a success alert. AlertTypeSuccess AlertType = "success" )
type Annotations ¶
type Annotations struct { Config AnnotationsConfig `json:"config"` // contains filtered or unexported fields }
Annotations is a component representing key/value based annotations
func NewAnnotations ¶
func NewAnnotations(annotations map[string]string) *Annotations
NewAnnotations creates a annotations component
func (*Annotations) GetMetadata ¶
func (t *Annotations) GetMetadata() Metadata
GetMetadata accesses the components metadata. Implements Component.
func (*Annotations) IsEmpty ¶
func (t *Annotations) IsEmpty() bool
IsEmpty specifies whether the component is considered empty. Implements Component.
func (*Annotations) LessThan ¶
func (b *Annotations) LessThan(i interface{}) bool
LessThan returns false.
func (*Annotations) MarshalJSON ¶
func (t *Annotations) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*Annotations) SetAccessor ¶
func (b *Annotations) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type AnnotationsConfig ¶
AnnotationsConfig is the contents of Annotations
type Button ¶ added in v0.7.0
type Button struct { Name string `json:"name"` Payload action.Payload `json:"payload"` Confirmation *Confirmation `json:"confirmation,omitempty"` }
Button is a button in a group.
type ButtonGroup ¶ added in v0.7.0
type ButtonGroup struct { Config ButtonGroupConfig `json:"config"` // contains filtered or unexported fields }
ButtonGroup is a group of buttons.
func NewButtonGroup ¶ added in v0.7.0
func NewButtonGroup() *ButtonGroup
NewButtonGroup creates an instance of ButtonGroup.
func (*ButtonGroup) AddButton ¶ added in v0.7.0
func (bg *ButtonGroup) AddButton(button Button)
AddButton adds a button to the ButtonGroup.
func (*ButtonGroup) GetMetadata ¶ added in v0.7.0
func (b *ButtonGroup) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*ButtonGroup) IsEmpty ¶ added in v0.7.0
func (b *ButtonGroup) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*ButtonGroup) LessThan ¶ added in v0.7.0
func (b *ButtonGroup) LessThan(i interface{}) bool
LessThan returns false.
func (*ButtonGroup) MarshalJSON ¶ added in v0.7.0
func (bg *ButtonGroup) MarshalJSON() ([]byte, error)
MarshalJSON marshals a button group.
func (*ButtonGroup) SetAccessor ¶ added in v0.7.0
func (b *ButtonGroup) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type ButtonGroupConfig ¶ added in v0.7.0
type ButtonGroupConfig struct { // Buttons are buttons in the group. Buttons []Button `json:"buttons"` }
ButtonGroupConfig is configuration for a button group.
type ButtonOption ¶ added in v0.7.0
type ButtonOption func(button *Button)
ButtonOption is a function for configuring a Button.
func WithButtonConfirmation ¶ added in v0.7.0
func WithButtonConfirmation(title, body string) ButtonOption
WithButtonConfirmation configured a button with a confirmation.
type Card ¶
type Card struct { Config CardConfig `json:"config"` // contains filtered or unexported fields }
Card is a card component.
func (*Card) GetMetadata ¶
func (b *Card) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*Card) IsEmpty ¶
func (b *Card) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Card) MarshalJSON ¶
MarshalJSON marshals a card to JSON.
func (*Card) SetAccessor ¶
func (b *Card) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type CardConfig ¶
type CardConfig struct { // Body is the body of the card. Body Component `json:"body"` // Actions are actions for the card. Actions []Action `json:"actions"` // Alert is the alert to show for the card. Alert *Alert `json:"alert,omitempty"` }
CardConfig is configuration for the card component.
func (*CardConfig) UnmarshalJSON ¶
func (c *CardConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals a card config from JSON.
type CardList ¶
type CardList struct { Config CardListConfig `json:"config"` // contains filtered or unexported fields }
CardList is a component which comprises of a list of cards.
func NewCardList ¶
NewCardList creates a card list component.
func (*CardList) GetMetadata ¶
func (b *CardList) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*CardList) IsEmpty ¶
func (b *CardList) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*CardList) MarshalJSON ¶
MarshalJSON marshals a card list to JSON.
func (*CardList) SetAccessor ¶
func (b *CardList) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type CardListConfig ¶
type CardListConfig struct { // Cards is a slice of cads. Cards []Card `json:"cards"` }
CardListConfig is configuration for a card list.
func (*CardListConfig) UnmarshalJSON ¶
func (c *CardListConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals a card list config from JSON.
type Component ¶
type Component interface { json.Marshaler // GetMetadata returns metadata for the component. GetMetadata() Metadata // SetAccessor sets the accessfor the component. SetAccessor(string) // IsEmpty returns true if the component is "empty". IsEmpty() bool // String returns a string representation of the component. String() string // LessThan returns true if the components value is less than the other value. LessThan(other interface{}) bool }
Component is a common interface for the data representation of visual components as rendered by the UI.
type Confirmation ¶ added in v0.7.0
Confirmation is configuration for a confirmation dialog.
type ContainerDef ¶
ContainerDef defines an individual docker container
type Containers ¶
type Containers struct { Config ContainersConfig `json:"config"` // contains filtered or unexported fields }
Containers is a component wrapping multiple docker container definitions
func (*Containers) Add ¶
func (t *Containers) Add(name string, image string)
Add adds additional items to the tail of the containers.
func (*Containers) GetMetadata ¶
func (t *Containers) GetMetadata() Metadata
GetMetadata accesses the components metadata. Implements Component.
func (*Containers) IsEmpty ¶
func (b *Containers) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Containers) LessThan ¶
func (b *Containers) LessThan(i interface{}) bool
LessThan returns false.
func (*Containers) MarshalJSON ¶
func (t *Containers) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*Containers) SetAccessor ¶
func (b *Containers) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type ContainersConfig ¶
type ContainersConfig struct {
Containers []ContainerDef `json:"containers"`
}
ContainersConfig is the contents of a Containers wrapper
type ContentResponse ¶
type ContentResponse struct { Title []TitleComponent `json:"title,omitempty"` Components []Component `json:"viewComponents"` IconName string `json:"iconName,omitempty"` IconSource string `json:"iconSource,omitempty"` }
ContentResponse is a a content response. It contains a title and one or more components.
func NewContentResponse ¶
func NewContentResponse(title []TitleComponent) *ContentResponse
NewContentResponse creates an instance of ContentResponse.
func (*ContentResponse) Add ¶
func (c *ContentResponse) Add(components ...Component)
Add adds zero or more components to a content response.
func (*ContentResponse) UnmarshalJSON ¶
func (c *ContentResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals a content response from JSON.
type EdgeType ¶
type EdgeType string
EdgeType represents whether a relationship between resources is implicit or explicit
type Error ¶
type Error struct { Config ErrorConfig `json:"config"` // contains filtered or unexported fields }
Error is a component for freetext
func NewError ¶
func NewError(title []TitleComponent, err error) *Error
NewError creates a text component
func (*Error) GetMetadata ¶
func (b *Error) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*Error) IsEmpty ¶
func (b *Error) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Error) LessThan ¶
LessThan returns true if this component's value is less than the argument supplied.
func (*Error) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Error) SetAccessor ¶
func (b *Error) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
func (*Error) SupportsTitle ¶
func (t *Error) SupportsTitle()
SupportsTitle denotes this is a TextComponent.
type ErrorConfig ¶
type ErrorConfig struct {
Data string `json:"data,omitempty"`
}
ErrorConfig is the contents of Text
type ExpressionSelector ¶
type ExpressionSelector struct { Config ExpressionSelectorConfig `json:"config"` // contains filtered or unexported fields }
ExpressionSelector is a component for a single expression within a selector
func NewExpressionSelector ¶
func NewExpressionSelector(k string, o Operator, values []string) *ExpressionSelector
NewExpressionSelector creates a expressionSelector component
func (*ExpressionSelector) GetMetadata ¶
func (t *ExpressionSelector) GetMetadata() Metadata
GetMetadata accesses the components metadata. Implements Component.
func (*ExpressionSelector) IsEmpty ¶
func (b *ExpressionSelector) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*ExpressionSelector) IsSelector ¶
func (t *ExpressionSelector) IsSelector()
IsSelector marks the component as selector flavor. Implements Selector.
func (*ExpressionSelector) LessThan ¶
func (b *ExpressionSelector) LessThan(i interface{}) bool
LessThan returns false.
func (*ExpressionSelector) MarshalJSON ¶
func (t *ExpressionSelector) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*ExpressionSelector) Name ¶
func (t *ExpressionSelector) Name() string
Name is the name of the ExpressionSelector.
func (*ExpressionSelector) SetAccessor ¶
func (b *ExpressionSelector) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type ExpressionSelectorConfig ¶
type ExpressionSelectorConfig struct { Key string `json:"key"` Operator Operator `json:"operator"` Values []string `json:"values"` }
ExpressionSelectorConfig is the contents of ExpressionSelector
type FlexLayout ¶
type FlexLayout struct { Config FlexLayoutConfig `json:"config,omitempty"` // contains filtered or unexported fields }
FlexLayout is a flex layout view.
func NewFlexLayout ¶
func NewFlexLayout(title string) *FlexLayout
NewFlexLayout creates an instance of FlexLayout.
func (*FlexLayout) AddSections ¶
func (fl *FlexLayout) AddSections(sections ...FlexLayoutSection)
AddSections adds one or more sections to the flex layout.
func (*FlexLayout) GetMetadata ¶
func (fl *FlexLayout) GetMetadata() Metadata
GetMetadata returns the metadata for the flex layout view.
func (*FlexLayout) IsEmpty ¶
func (b *FlexLayout) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*FlexLayout) LessThan ¶
func (b *FlexLayout) LessThan(i interface{}) bool
LessThan returns false.
func (*FlexLayout) MarshalJSON ¶
func (fl *FlexLayout) MarshalJSON() ([]byte, error)
MarshalJSON marshals the flex layout to JSON.
func (*FlexLayout) SetAccessor ¶
func (b *FlexLayout) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
func (*FlexLayout) SetButtonGroup ¶ added in v0.7.0
func (fl *FlexLayout) SetButtonGroup(group *ButtonGroup)
type FlexLayoutConfig ¶
type FlexLayoutConfig struct { Sections []FlexLayoutSection `json:"sections,omitempty"` ButtonGroup *ButtonGroup `json:"buttonGroup,omitempty"` }
FlexLayoutConfig is configuration for the flex layout view.
type FlexLayoutItem ¶
type FlexLayoutItem struct { Width int `json:"width,omitempty"` View Component `json:"view,omitempty"` }
FlexLayoutItem is an item in a flex layout.
func (*FlexLayoutItem) UnmarshalJSON ¶
func (fli *FlexLayoutItem) UnmarshalJSON(data []byte) error
type FlexLayoutSection ¶
type FlexLayoutSection []FlexLayoutItem
FlexLayoutSection is a slice of items group together.
type Form ¶
type Form struct {
Fields []FormField `json:"fields"`
}
func CreateFormForObject ¶ added in v0.7.0
func CreateFormForObject(actionName string, object runtime.Object, fields ...FormField) (Form, error)
CreateFormForObject creates a form for an object with additional fields.
func (*Form) MarshalJSON ¶
func (*Form) UnmarshalJSON ¶
type FormFieldCheckBox ¶
type FormFieldCheckBox struct {
// contains filtered or unexported fields
}
func NewFormFieldCheckBox ¶
func NewFormFieldCheckBox(label, name string, choices []InputChoice) *FormFieldCheckBox
func (*FormFieldCheckBox) Configuration ¶
func (ff *FormFieldCheckBox) Configuration() map[string]interface{}
func (*FormFieldCheckBox) MarshalJSON ¶
func (ff *FormFieldCheckBox) MarshalJSON() ([]byte, error)
func (*FormFieldCheckBox) UnmarshalJSON ¶
func (ff *FormFieldCheckBox) UnmarshalJSON(data []byte) error
func (*FormFieldCheckBox) Value ¶
func (ff *FormFieldCheckBox) Value() interface{}
type FormFieldHidden ¶
type FormFieldHidden struct {
// contains filtered or unexported fields
}
func NewFormFieldHidden ¶
func NewFormFieldHidden(name, value string) *FormFieldHidden
func (*FormFieldHidden) Configuration ¶
func (ff *FormFieldHidden) Configuration() map[string]interface{}
func (*FormFieldHidden) MarshalJSON ¶
func (ff *FormFieldHidden) MarshalJSON() ([]byte, error)
func (*FormFieldHidden) UnmarshalJSON ¶
func (ff *FormFieldHidden) UnmarshalJSON(data []byte) error
func (*FormFieldHidden) Value ¶
func (ff *FormFieldHidden) Value() interface{}
type FormFieldNumber ¶
type FormFieldNumber struct {
// contains filtered or unexported fields
}
func NewFormFieldNumber ¶
func NewFormFieldNumber(label, name, value string) *FormFieldNumber
func (*FormFieldNumber) Configuration ¶
func (ff *FormFieldNumber) Configuration() map[string]interface{}
func (*FormFieldNumber) MarshalJSON ¶
func (ff *FormFieldNumber) MarshalJSON() ([]byte, error)
func (*FormFieldNumber) UnmarshalJSON ¶
func (ff *FormFieldNumber) UnmarshalJSON(data []byte) error
func (*FormFieldNumber) Value ¶
func (ff *FormFieldNumber) Value() interface{}
type FormFieldPassword ¶
type FormFieldPassword struct {
// contains filtered or unexported fields
}
func NewFormFieldPassword ¶
func NewFormFieldPassword(label, name, value string) *FormFieldPassword
func (*FormFieldPassword) Configuration ¶
func (ff *FormFieldPassword) Configuration() map[string]interface{}
func (*FormFieldPassword) MarshalJSON ¶
func (ff *FormFieldPassword) MarshalJSON() ([]byte, error)
func (*FormFieldPassword) UnmarshalJSON ¶
func (ff *FormFieldPassword) UnmarshalJSON(data []byte) error
func (*FormFieldPassword) Value ¶
func (ff *FormFieldPassword) Value() interface{}
type FormFieldRadio ¶
type FormFieldRadio struct {
// contains filtered or unexported fields
}
func NewFormFieldRadio ¶
func NewFormFieldRadio(label, name string, choices []InputChoice) *FormFieldRadio
func (*FormFieldRadio) Configuration ¶
func (ff *FormFieldRadio) Configuration() map[string]interface{}
func (*FormFieldRadio) MarshalJSON ¶
func (ff *FormFieldRadio) MarshalJSON() ([]byte, error)
func (*FormFieldRadio) UnmarshalJSON ¶
func (ff *FormFieldRadio) UnmarshalJSON(data []byte) error
func (*FormFieldRadio) Value ¶
func (ff *FormFieldRadio) Value() interface{}
type FormFieldSelect ¶
type FormFieldSelect struct {
// contains filtered or unexported fields
}
func NewFormFieldSelect ¶
func NewFormFieldSelect(label, name string, choices []InputChoice, multiple bool) *FormFieldSelect
func (*FormFieldSelect) Configuration ¶
func (ff *FormFieldSelect) Configuration() map[string]interface{}
func (*FormFieldSelect) MarshalJSON ¶
func (ff *FormFieldSelect) MarshalJSON() ([]byte, error)
func (*FormFieldSelect) UnmarshalJSON ¶
func (ff *FormFieldSelect) UnmarshalJSON(data []byte) error
func (*FormFieldSelect) Value ¶
func (ff *FormFieldSelect) Value() interface{}
type FormFieldText ¶
type FormFieldText struct {
// contains filtered or unexported fields
}
func NewFormFieldText ¶
func NewFormFieldText(label, name, value string) *FormFieldText
func (*FormFieldText) Configuration ¶
func (ff *FormFieldText) Configuration() map[string]interface{}
func (*FormFieldText) MarshalJSON ¶
func (ff *FormFieldText) MarshalJSON() ([]byte, error)
func (*FormFieldText) UnmarshalJSON ¶
func (ff *FormFieldText) UnmarshalJSON(data []byte) error
func (*FormFieldText) Value ¶
func (ff *FormFieldText) Value() interface{}
type FormFieldTextarea ¶
type FormFieldTextarea struct {
// contains filtered or unexported fields
}
func NewFormFieldTextarea ¶
func NewFormFieldTextarea(label, name, value string) *FormFieldTextarea
func (*FormFieldTextarea) Configuration ¶
func (ff *FormFieldTextarea) Configuration() map[string]interface{}
func (*FormFieldTextarea) MarshalJSON ¶
func (ff *FormFieldTextarea) MarshalJSON() ([]byte, error)
func (*FormFieldTextarea) UnmarshalJSON ¶
func (ff *FormFieldTextarea) UnmarshalJSON(data []byte) error
func (*FormFieldTextarea) Value ¶
func (ff *FormFieldTextarea) Value() interface{}
type Graphviz ¶
type Graphviz struct { Config GraphvizConfig `json:"config"` // contains filtered or unexported fields }
Graphviz is a component for displaying graphviz diagrams.
func NewGraphviz ¶
func (*Graphviz) GetMetadata ¶
func (b *Graphviz) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*Graphviz) IsEmpty ¶
func (b *Graphviz) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Graphviz) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Graphviz) SetAccessor ¶
func (b *Graphviz) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type GraphvizConfig ¶
type GraphvizConfig struct {
DOT string `json:"dot,omitempty"`
}
GraphvizConfig is the contents of Graphviz.
type InputChoice ¶
type LabelSelector ¶
type LabelSelector struct { Config LabelSelectorConfig `json:"config"` // contains filtered or unexported fields }
LabelSelector is a component for a single label within a selector
func NewLabelSelector ¶
func NewLabelSelector(k, v string) *LabelSelector
NewLabelSelector creates a labelSelector component
func (*LabelSelector) GetMetadata ¶
func (t *LabelSelector) GetMetadata() Metadata
GetMetadata accesses the components metadata. Implements Component.
func (*LabelSelector) IsEmpty ¶
func (b *LabelSelector) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*LabelSelector) IsSelector ¶
func (t *LabelSelector) IsSelector()
IsSelector marks the component as selector flavor. Implements Selector.
func (*LabelSelector) LessThan ¶
func (b *LabelSelector) LessThan(i interface{}) bool
LessThan returns false.
func (*LabelSelector) MarshalJSON ¶
func (t *LabelSelector) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*LabelSelector) Name ¶
func (t *LabelSelector) Name() string
Name is the name of the LabelSelector.
func (*LabelSelector) SetAccessor ¶
func (b *LabelSelector) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type LabelSelectorConfig ¶
LabelSelectorConfig is the contents of LabelSelector
type Labels ¶
type Labels struct { Config LabelsConfig `json:"config"` // contains filtered or unexported fields }
Labels is a component representing key/value based labels
func (*Labels) GetMetadata ¶
GetMetadata accesses the components metadata. Implements Component.
func (*Labels) IsEmpty ¶
func (b *Labels) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Labels) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will filter label keys specified in `labelsFilteredKeys`.
func (*Labels) SetAccessor ¶
func (b *Labels) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type LabelsConfig ¶
LabelsConfig is the contents of Labels
type Link ¶
type Link struct { Config LinkConfig `json:"config"` // contains filtered or unexported fields }
Link is a text component that contains a link.
func (*Link) GetMetadata ¶
GetMetadata accesses the components metadata. Implements Component.
func (*Link) IsEmpty ¶
func (b *Link) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Link) LessThan ¶
LessThan returns true if this component's value is less than the argument supplied.
func (*Link) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Link) SetAccessor ¶
func (b *Link) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
func (*Link) SupportsTitle ¶
func (t *Link) SupportsTitle()
SupportsTitle designates this is a TextComponent.
type LinkConfig ¶
LinkConfig is the contents of Link
type List ¶
type List struct { Config ListConfig `json:"config"` // contains filtered or unexported fields }
List contains other Components
func (*List) GetMetadata ¶
func (b *List) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*List) IsEmpty ¶
func (b *List) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*List) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*List) SetAccessor ¶
func (b *List) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type ListConfig ¶
type ListConfig struct { IconName string `json:"iconName"` IconSource string `json:"iconSource"` Items []Component `json:"items"` }
ListConfig is the contents of a List
func (*ListConfig) UnmarshalJSON ¶
func (t *ListConfig) UnmarshalJSON(data []byte) error
type Loading ¶
type Loading struct { Config LoadingConfig `json:"config"` // contains filtered or unexported fields }
Loading is a component for a spinner
func NewLoading ¶
func NewLoading(title []TitleComponent, message string) *Loading
NewLoading creates a loading component
func (*Loading) GetMetadata ¶
func (b *Loading) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*Loading) IsEmpty ¶
func (b *Loading) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Loading) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Loading) SetAccessor ¶
func (b *Loading) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
func (*Loading) SupportsTitle ¶
func (t *Loading) SupportsTitle()
SupportsTitle denotes this is a LoadingComponent.
type LoadingConfig ¶
type LoadingConfig struct {
Text string `json:"value"`
}
LoadingConfig is the contents of Loading
type Logs ¶
type Logs struct { Config LogsConfig `json:"config,omitempty"` // contains filtered or unexported fields }
func (*Logs) GetMetadata ¶
GetMetadata accesses the components metadata. Implements Component.
func (*Logs) IsEmpty ¶
func (b *Logs) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Logs) MarshalJSON ¶
func (*Logs) SetAccessor ¶
func (b *Logs) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type LogsConfig ¶
type Metadata ¶
type Metadata struct { Type string `json:"type"` Title []TitleComponent `json:"title,omitempty"` Accessor string `json:"accessor,omitempty"` }
Metadata collects common fields describing Components
func (*Metadata) SetTitleText ¶
SetTitleText sets the title using text components.
func (*Metadata) UnmarshalJSON ¶
type Node ¶
type Node struct { Name string `json:"name,omitempty"` APIVersion string `json:"apiVersion,omitempty"` Kind string `json:"kind,omitempty"` Status NodeStatus `json:"status,omitempty"` Details []Component `json:"details,omitempty"` Path *Link `json:"path,omitempty"` }
Node is a node in a graph, representing a kubernetes object IsNetwork is a hint to the layout engine.
type NodeStatus ¶
type NodeStatus string
const ( // NodeStatusOK means a node is in a health state NodeStatusOK NodeStatus = "ok" // NodeStatusWarning means ... NodeStatusWarning NodeStatus = "warning" // NodeStatusError means ... NodeStatusError NodeStatus = "error" )
type Operator ¶
type Operator string
Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
const ( // OperatorIn means a key value is in a set of possible values OperatorIn Operator = "In" // OperatorNotIn means a key value is not in a set of exclusionary values OperatorNotIn Operator = "NotIn" // OperatorExists means a key exists on the selected resource OperatorExists Operator = "Exists" // OperatorDoesNotExist means a key does not exists on the selected resource OperatorDoesNotExist Operator = "DoesNotExist" )
func MatchOperator ¶
MatchOperator matches an operator.
type PodStatus ¶
type PodStatus struct { Config PodStatusConfig `json:"config"` // contains filtered or unexported fields }
PodStatus represents the status for a group of pods.
func (*PodStatus) AddSummary ¶
func (ps *PodStatus) AddSummary(name string, details []Component, status NodeStatus)
AddSummary adds summary for a pod.
func (*PodStatus) GetMetadata ¶
func (b *PodStatus) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*PodStatus) IsEmpty ¶
func (b *PodStatus) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*PodStatus) LessThan ¶
func (b *PodStatus) LessThan(i interface{}) bool
LessThan returns false.
func (*PodStatus) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*PodStatus) SetAccessor ¶
func (b *PodStatus) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
func (*PodStatus) Status ¶
func (ps *PodStatus) Status() NodeStatus
type PodStatusConfig ¶
type PodStatusConfig struct {
Pods map[string]PodSummary `json:"pods,omitempty"`
}
PodStatusConfig is config for PodStatus.
type PodSummary ¶
type PodSummary struct { Details []Component `json:"details,omitempty"` Status NodeStatus `json:"status,omitempty"` }
PodSummary is a status summary for a pod.
func (*PodSummary) UnmarshalJSON ¶
func (podSummary *PodSummary) UnmarshalJSON(data []byte) error
type Port ¶
type Port struct { Config PortConfig `json:"config"` // contains filtered or unexported fields }
Port is a component for a port
func NewPort ¶
func NewPort(namespace, apiVersion, kind, name string, port int, protocol string, pfs PortForwardState) *Port
NewPort creates a port component
func (*Port) GetMetadata ¶
GetMetadata accesses the components metadata. Implements Component.
func (*Port) IsEmpty ¶
func (b *Port) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Port) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Port) SetAccessor ¶
func (b *Port) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type PortConfig ¶
type PortConfig struct { Namespace string `json:"namespace,omitempty"` APIVersion string `json:"apiVersion,omitempty"` Kind string `json:"kind,omitempty"` Name string `json:"name,omitempty"` Port int `json:"port,omitempty"` Protocol string `json:"protocol,omitempty"` State PortForwardState `json:"state,omitempty"` }
PortConfig is the contents of Port
type PortForwardState ¶
type Ports ¶
type Ports struct { Config PortsConfig `json:"config,omitempty"` // contains filtered or unexported fields }
func (*Ports) GetMetadata ¶
func (*Ports) IsEmpty ¶
func (b *Ports) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Ports) MarshalJSON ¶
func (*Ports) SetAccessor ¶
func (b *Ports) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type PortsConfig ¶
type PortsConfig struct {
Ports []Port `json:"ports,omitempty"`
}
type Quadrant ¶
type Quadrant struct { Config QuadrantConfig `json:"config"` // contains filtered or unexported fields }
func NewQuadrant ¶
NewQuadrant creates a quadrant component
func (*Quadrant) GetMetadata ¶
GetMetadata accesses the components metadata. Implements Component.
func (*Quadrant) IsEmpty ¶
func (b *Quadrant) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Quadrant) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Quadrant) Set ¶
func (t *Quadrant) Set(pos QuadrantPosition, label, value string) error
Set adds additional panels to the quadrant
func (*Quadrant) SetAccessor ¶
func (b *Quadrant) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type QuadrantConfig ¶
type QuadrantConfig struct { NW QuadrantValue `json:"nw,omitempty"` NE QuadrantValue `json:"ne,omitempty"` SE QuadrantValue `json:"se,omitempty"` SW QuadrantValue `json:"sw,omitempty"` }
QuadrantConfig is the contents of a Quadrant
type QuadrantPosition ¶
type QuadrantPosition int
QuadrantPosition denotes a position within a quadrant
const ( // QuadNW denotes the north-west position within a quadrant QuadNW QuadrantPosition = iota // QuadNE denotes the north-east position within a quadrant QuadNE // QuadSE denotes the south-east position within a quadrant QuadSE // QuadSW denotes the south-west position within a quadrant QuadSW )
type QuadrantValue ¶
type ResourceViewer ¶
type ResourceViewer struct { Config ResourceViewerConfig `json:"config,omitempty"` // contains filtered or unexported fields }
ResourceView is a resource viewer component.
func NewResourceViewer ¶
func NewResourceViewer(title string) *ResourceViewer
NewResourceViewer creates a resource viewer component.
func (*ResourceViewer) AddEdge ¶
func (rv *ResourceViewer) AddEdge(nodeID, childID string, edgeType EdgeType) error
func (*ResourceViewer) AddNode ¶
func (rv *ResourceViewer) AddNode(id string, node Node)
func (*ResourceViewer) GetMetadata ¶
func (rv *ResourceViewer) GetMetadata() Metadata
func (*ResourceViewer) IsEmpty ¶
func (b *ResourceViewer) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*ResourceViewer) LessThan ¶
func (b *ResourceViewer) LessThan(i interface{}) bool
LessThan returns false.
func (*ResourceViewer) MarshalJSON ¶
func (rv *ResourceViewer) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*ResourceViewer) Select ¶
func (rv *ResourceViewer) Select(id string)
func (*ResourceViewer) SetAccessor ¶
func (b *ResourceViewer) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
func (*ResourceViewer) String ¶
func (b *ResourceViewer) String() string
String returns an empty string. If a component wants to provide a value it can override this function.
func (*ResourceViewer) Validate ¶
func (rv *ResourceViewer) Validate() error
type ResourceViewerConfig ¶
type ResourceViewerConfig struct { Edges AdjList `json:"edges,omitempty"` Nodes Nodes `json:"nodes,omitempty"` Selected string `json:"selected,omitempty"` }
ResourceViewerConfig is configuration for a resource viewer.
type Selector ¶
type Selector interface { IsSelector() Name() string }
Selector identifies a Component as being a selector flavor.
type Selectors ¶
type Selectors struct { Config SelectorsConfig `json:"config"` // contains filtered or unexported fields }
Selectors contains other Components
func NewSelectors ¶
NewSelectors creates a selectors component
func (*Selectors) GetMetadata ¶
GetMetadata accesses the components metadata. Implements Component.
func (*Selectors) IsEmpty ¶
func (b *Selectors) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Selectors) LessThan ¶
func (b *Selectors) LessThan(i interface{}) bool
LessThan returns false.
func (*Selectors) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Selectors) SetAccessor ¶
func (b *Selectors) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type SelectorsConfig ¶
type SelectorsConfig struct {
Selectors []Selector `json:"selectors"`
}
SelectorsConfig is the contents of a Selectors
func (*SelectorsConfig) UnmarshalJSON ¶
func (t *SelectorsConfig) UnmarshalJSON(data []byte) error
type Summary ¶
type Summary struct { Config SummaryConfig `json:"config"` // contains filtered or unexported fields }
Summary contains other Components
func NewSummary ¶
func NewSummary(title string, sections ...SummarySection) *Summary
NewSummary creates a summary component
func (*Summary) Add ¶
func (t *Summary) Add(sections ...SummarySection)
Add adds additional items to the tail of the summary.
func (*Summary) GetMetadata ¶
GetMetadata accesses the components metadata. Implements Component.
func (*Summary) IsEmpty ¶
func (b *Summary) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Summary) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Summary) Sections ¶
func (t *Summary) Sections() []SummarySection
Sections returns sections for the summary.
func (*Summary) SetAccessor ¶
func (b *Summary) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type SummaryConfig ¶
type SummaryConfig struct { Sections []SummarySection `json:"sections"` Actions []Action `json:"actions,omitempty"` Alert *Alert `json:"alert,omitempty"` }
SummaryConfig is the contents of a Summary
type SummarySection ¶
SummarySection is a section within a summary
func (*SummarySection) UnmarshalJSON ¶
func (t *SummarySection) UnmarshalJSON(data []byte) error
type SummarySections ¶
type SummarySections []SummarySection
SummarySections is a slice of summary sections
func (*SummarySections) Add ¶
func (s *SummarySections) Add(header string, view Component)
func (*SummarySections) AddText ¶
func (s *SummarySections) AddText(header string, text string)
AddText adds a section with a single text component
type Tab ¶
type Tab struct { Name string Contents FlexLayout }
Tab represents a tab. A tab is a flex layout with a name.
func NewTabWithContents ¶ added in v0.6.0
func NewTabWithContents(flexLayout FlexLayout) *Tab
NewTabWithContents creates a tab with contents.
type Table ¶
type Table struct { Config TableConfig `json:"config"` // contains filtered or unexported fields }
Table contains other Components
func NewTableWithRows ¶
NewTableWithRows creates a table with rows.
func (*Table) Add ¶
Add adds additional items to the tail of the table. Use this function to add rows in a concurrency safe fashion.
func (*Table) AddFilter ¶ added in v0.7.0
func (t *Table) AddFilter(columnName string, filter TableFilter)
AddFilter adds a filter to the table. Each column can only have a single filter.
func (*Table) GetMetadata ¶
func (b *Table) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*Table) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Table) SetAccessor ¶
func (b *Table) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
func (*Table) SetIsLoading ¶ added in v0.6.0
func (*Table) SetPlaceholder ¶ added in v0.6.0
type TableCol ¶
TableCol describes a column from a table. Accessor is the key this column will appear as in table rows, and must be unique within a table.
func NewTableCols ¶
NewTableCols returns a slice of table columns, each with name/accessor set according to the provided keys arguments.
type TableConfig ¶
type TableConfig struct { Columns []TableCol `json:"columns"` Rows []TableRow `json:"rows"` EmptyContent string `json:"emptyContent"` Loading bool `json:"loading"` Filters map[string]TableFilter `json:"filters"` }
TableConfig is the contents of a Table
type TableFilter ¶ added in v0.7.0
TableFilter describer a text filter for a table.
type TableRow ¶
TableRow is a row in table. Each key->value represents a particular column in the row.
func (*TableRow) UnmarshalJSON ¶
type Text ¶
type Text struct { Config TextConfig `json:"config"` // contains filtered or unexported fields }
Text is a component for text
func NewMarkdownText ¶
NewMarkdownText creates a text component styled with markdown.
func (*Text) DisableMarkdown ¶
func (t *Text) DisableMarkdown()
DisableMarkdown disables markdown for this text component.
func (*Text) EnableMarkdown ¶
func (t *Text) EnableMarkdown()
EnableMarkdown enables markdown for this text component.
func (*Text) GetMetadata ¶
func (b *Text) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*Text) IsEmpty ¶
func (b *Text) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Text) IsMarkdown ¶
IsMarkdown returns if this component is markdown.
func (*Text) LessThan ¶
LessThan returns true if this component's value is less than the argument supplied.
func (*Text) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Text) SetAccessor ¶
func (b *Text) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
func (*Text) SupportsTitle ¶
func (t *Text) SupportsTitle()
SupportsTitle denotes this is a TextComponent.
type TextConfig ¶
TextConfig is the contents of Text
type Timestamp ¶
type Timestamp struct { Config TimestampConfig `json:"config"` // contains filtered or unexported fields }
Timestamp is a component representing a point in time
func NewTimestamp ¶
NewTimestamp creates a timestamp component
func (*Timestamp) GetMetadata ¶
func (b *Timestamp) GetMetadata() Metadata
GetMetadata returns the component's metadata.
func (*Timestamp) IsEmpty ¶
func (b *Timestamp) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*Timestamp) LessThan ¶
LessThan returns true if this component's value is less than the argument supplied.
func (*Timestamp) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Timestamp) SetAccessor ¶
func (b *Timestamp) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type TimestampConfig ¶
type TimestampConfig struct {
Timestamp int64 `json:"timestamp"`
}
TimestampConfig is the contents of Timestamp
type TitleComponent ¶
type TitleComponent interface { Component SupportsTitle() }
TitleComponent is a view component that can be used for a title.
func Title ¶
func Title(components ...TitleComponent) []TitleComponent
Title is a convenience method for creating a title.
func TitleFromString ¶
func TitleFromString(s string) []TitleComponent
TitleFromString is a convenience method for create a title from a string.
type TypedObject ¶
type TypedObject struct { Config json.RawMessage `json:"config,omitempty"` Metadata Metadata `json:"metadata,omitempty"` }
func (*TypedObject) ToComponent ¶
func (to *TypedObject) ToComponent() (Component, error)
type YAML ¶
type YAML struct { Config YAMLConfig `json:"config,omitempty"` // contains filtered or unexported fields }
func NewYAML ¶
func NewYAML(title []TitleComponent, data string) *YAML
func (*YAML) GetMetadata ¶
GetMetadata returns the component's metadata.
func (*YAML) IsEmpty ¶
func (b *YAML) IsEmpty() bool
IsEmpty returns false by default. Let the components that wrap base determine if they are empty or not if they wish.
func (*YAML) MarshalJSON ¶
func (*YAML) SetAccessor ¶
func (b *YAML) SetAccessor(accessor string)
SetAccessor sets the accessor for the object.
type YAMLConfig ¶
type YAMLConfig struct {
Data string `json:"data,omitempty"`
}
Source Files ¶
- action.go
- alert.go
- annotations.go
- base.go
- button.go
- card.go
- component.go
- container.go
- error.go
- expression_selector.go
- flexlayout.go
- form.go
- graphviz.go
- label_selector.go
- labels.go
- link.go
- list.go
- loading.go
- logs.go
- pod_status.go
- port.go
- quadrant.go
- resource_viewer.go
- selectors.go
- summary.go
- table.go
- testing.go
- text.go
- timestamp.go
- unmarshal.go
- yaml.go