Documentation ¶
Index ¶
- Constants
- Variables
- func Debugln(val ...interface{}) error
- func DeploymentFilter(vs []appsv1.Deployment, f func(appsv1.Deployment) bool) []appsv1.Deployment
- func DeploymentLineHelper(deployment appsv1.Deployment) []string
- func Errorln(val ...interface{}) error
- func Infoln(val ...interface{}) error
- func NamespaceLineHelper(ns corev1.Namespace) []string
- func PodFilter(vs []v1.Pod, f func(v1.Pod) bool) []v1.Pod
- func PodLineHelper(pod corev1.Pod) []string
- func PodNameFromLine(line string) (string, error)
- type DebugEntities
- type DeploymentEntities
- func (e *DeploymentEntities) ClearFilter(g1 *gocui.Gui)
- func (e *DeploymentEntities) CursorMove(g1 *gocui.Gui, delta int)
- func (e *DeploymentEntities) LoadDeploymentData(g1 *gocui.Gui, deployments *appsv1.DeploymentList)
- func (e *DeploymentEntities) SetCursor(g1 *gocui.Gui, pos int)
- func (e *DeploymentEntities) SetFilter(g1 *gocui.Gui, filter string)
- type EntitiesReducer
- type ErrorEntities
- type ModalKind
- type ModalSize
- type ModalView
- func (mv *ModalView) CursorMove(g1 *gocui.Gui, delta int)
- func (mv *ModalView) SetCursor(g1 *gocui.Gui, pos int)
- func (mv *ModalView) SetKind(g1 *gocui.Gui, kind ModalKind)
- func (mv *ModalView) SetLines(g1 *gocui.Gui, lines []string)
- func (mv *ModalView) SetSize(g1 *gocui.Gui, size ModalSize)
- func (mv *ModalView) SetTitle(g1 *gocui.Gui, title string)
- type NamespaceEntities
- type ParsedFlags
- type PodEntities
- type ResourceEntities
- type Screen
- type State
- type TableKind
- type TableView
- type UIReducer
Constants ¶
const ( // ModalSizeSmall represents a Small modal ModalSizeSmall = "Small" // ModalSizeMedium represents a Medium modal ModalSizeMedium = "Medium" // ModalSizeLarge represents a Large modal ModalSizeLarge = "Large" // ModalSizeExtraLarge represents a ExtraLarge modal ModalSizeExtraLarge = "ExtraLarge" )
Variables ¶
var DeploymentListHeaders = []string{"Namespace", "Name", "Pods", "Age"}
DeploymentListHeaders are the headers needed for the Deployment list
var NamespaceListHeaders = []string{"Status", "Name", "Age"}
NamespaceListHeaders are the headers needed for the Namespace list
var PodListHeaders = []string{"Namespace", "Name", "Restarts", "Age", "Ready", "Status"}
PodListHeaders are the headers needed for the Pod list
Functions ¶
func DeploymentFilter ¶
func DeploymentFilter(vs []appsv1.Deployment, f func(appsv1.Deployment) bool) []appsv1.Deployment
DeploymentFilter is a collection function that filters deployments based on a predicate
func DeploymentLineHelper ¶
func DeploymentLineHelper(deployment appsv1.Deployment) []string
DeploymentLineHelper is the column helper for Deployments
func NamespaceLineHelper ¶
NamespaceLineHelper is the column helper for Namespaces
func PodLineHelper ¶
PodLineHelper is the column helper for Pods
func PodNameFromLine ¶
PodNameFromLine returns a pods name from a line in a table
Types ¶
type DebugEntities ¶
type DebugEntities struct {
Lines []interface{}
}
DebugEntities contains the data for Debugs
type DeploymentEntities ¶
type DeploymentEntities struct { Cursor int Filter string FilterKind string Selected string Deployments *appsv1.DeploymentList `json:"-"` SendingRequest bool Size int }
DeploymentEntities contains the data for deployments from the API
func (*DeploymentEntities) ClearFilter ¶
func (e *DeploymentEntities) ClearFilter(g1 *gocui.Gui)
ClearFilter updates the DeploymentEntities state with an empty filter
func (*DeploymentEntities) CursorMove ¶
func (e *DeploymentEntities) CursorMove(g1 *gocui.Gui, delta int)
CursorMove updates the DeploymentEntities state with a new cursor position (delta)
func (*DeploymentEntities) LoadDeploymentData ¶
func (e *DeploymentEntities) LoadDeploymentData(g1 *gocui.Gui, deployments *appsv1.DeploymentList)
LoadDeploymentData updates the DeploymentEntities state with new data
type EntitiesReducer ¶
type EntitiesReducer struct { Pods *PodEntities Debug *DebugEntities Errors *ErrorEntities Namespaces *NamespaceEntities Resources *ResourceEntities Deployments *DeploymentEntities }
EntitiesReducer contains the data for Entities
type ErrorEntities ¶
ErrorEntities contains the data for Errors
type ModalKind ¶
type ModalKind string
ModalKind is the type of Modal
const ( // KindDebug is a special debug modal KindDebug ModalKind = "Debug" // KindModalNamespaces represents a modal of the type namespace KindModalNamespaces ModalKind = "Namespaces" // KindModalResources represents a modal of the type resource KindModalResources ModalKind = "Resources" // KindModalSelectContainer represents a modal of the type container selection KindModalSelectContainer ModalKind = "Container" // KindModalContainerLogs represents a modal of the type container logs KindModalContainerLogs ModalKind = "ContainerLogs" )
type ModalView ¶
type ModalView struct { Title string Kind ModalKind Cursor int Selected string Lines []string Size ModalSize }
ModalView is the UI state of the modal component
func (*ModalView) CursorMove ¶
CursorMove updates the UI state with a new cursor position (delta)
type NamespaceEntities ¶
type NamespaceEntities struct { Size int Cursor int Filter string FilterKind string Namespaces *v1.NamespaceList `json:"-"` SendingRequest bool }
NamespaceEntities contains the data for namespaces
func (*NamespaceEntities) CursorMove ¶
func (e *NamespaceEntities) CursorMove(g *gocui.Gui, delta int)
CursorMove updates the namespace state with a new cursor position (delta)
func (*NamespaceEntities) LoadNamespaces ¶
func (e *NamespaceEntities) LoadNamespaces(g1 *gocui.Gui, ns *v1.NamespaceList)
LoadNamespaces updates the namespace state with a new dataset
type ParsedFlags ¶
type ParsedFlags struct { KubeConfigPath string RefreshInterval int AutoRefresh bool LogFilePath string LogToFile bool Prod bool Debug bool Test bool }
ParsedFlags will contain the config for the app
type PodEntities ¶
type PodEntities struct { Cursor int Filter string FilterKind string Pods *v1.PodList `json:"-"` SendingRequest bool Size int }
PodEntities represents the Pod data
func (*PodEntities) ClearFilter ¶
func (e *PodEntities) ClearFilter(g1 *gocui.Gui)
ClearFilter updates the PodEntities state with an empty filter
func (*PodEntities) CursorMove ¶
func (e *PodEntities) CursorMove(g1 *gocui.Gui, delta int)
CursorMove updates the PodEntities state with a new filter
func (*PodEntities) LoadPodData ¶
func (e *PodEntities) LoadPodData(g1 *gocui.Gui, pods *v1.PodList)
LoadPodData updates the PodEntities state with a new filter
type ResourceEntities ¶
type ResourceEntities struct {
Resources []string
}
ResourceEntities contains the data for Resources
type State ¶
type State struct { UI *UIReducer Entities *EntitiesReducer }
State is the top level reducer
func (*State) JSONString ¶
JSONString returns a string representation of the top level reducer for debugging purposes
type TableKind ¶
type TableKind string
TableKind is the type of Table
const ( // KindTableDeployments is the table of type Deployments KindTableDeployments TableKind = "DeploymentsTable" // KindTablePods is the table of type Pods KindTablePods TableKind = "PodsTable" // KindTableNamespaces is the table of type Namespaces KindTableNamespaces TableKind = "NamespacesTable" )
type TableView ¶
type TableView struct {
Kind TableKind
}
TableView is the state for the table component