Documentation ¶
Index ¶
- type ClusterNamespaces
- type Container
- type ContainerDelta
- type ContainerDeltaSet
- type ContainerListener
- type ContainerState
- type ContainerStatus
- type Entity
- func (e Entity) AssertIsContainer() error
- func (e Entity) EqualTo(other Entity) bool
- func (e Entity) Equals(other interface{}) bool
- func (e Entity) IsChildContainerOfCluster(cluster Entity) bool
- func (e Entity) IsChildContainerOfDeployment(deployment Entity) bool
- func (e Entity) IsChildContainerOfNamespace(namespace Entity) bool
- func (e Entity) IsChildContainerOfPod(pod Entity) bool
- func (e Entity) IsContainer() bool
- func (e Entity) IsSelected() bool
- func (e Entity) Render() string
- func (e Entity) Type() string
- type EntityTree
- type Log
- type LogScanner
- type NewSelectorArgs
- type PageLog
- type PageLogContainer
- type PageLogContainerNames
- type PageLogTimestamps
- type Selectors
- type SinceTime
- type ValidRegex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterNamespaces ¶
type Container ¶
type Container struct {
Cluster, Namespace, Deployment, Pod, Name string
Status ContainerStatus
}
func (Container) HumanReadable ¶
type ContainerDelta ¶
type ContainerDeltaSet ¶
type ContainerDeltaSet struct {
// contains filtered or unexported fields
}
ContainerDeltaSet sorts ContainerDeltas by time, Container ID ascending
func (*ContainerDeltaSet) Add ¶
func (cds *ContainerDeltaSet) Add(delta ContainerDelta)
func (ContainerDeltaSet) OrderedDeltas ¶
func (cds ContainerDeltaSet) OrderedDeltas() []ContainerDelta
func (*ContainerDeltaSet) Size ¶
func (cds *ContainerDeltaSet) Size() int
type ContainerListener ¶
type ContainerListener struct { Cluster string Namespace string ContainerDeltaChan chan ContainerDelta StopChan chan struct{} CleanupFunc func() }
type ContainerState ¶
type ContainerState int
const ( ContainerUnknown ContainerState = iota ContainerRunning ContainerTerminated ContainerWaiting )
func (ContainerState) String ¶
func (s ContainerState) String() string
type ContainerStatus ¶
type ContainerStatus struct { State ContainerState RunningSince time.Time }
type Entity ¶
type Entity struct { Container Container IsCluster, IsNamespace, IsDeployment, IsPod bool LogScanner *LogScanner LogScannerPending bool Terminated bool Prefix string }
Entity represents a renderable & selectable kubernetes entity (cluster, namespace, deployment, pod, or container)
func (Entity) AssertIsContainer ¶
func (Entity) IsChildContainerOfCluster ¶
func (Entity) IsChildContainerOfDeployment ¶
func (Entity) IsChildContainerOfNamespace ¶
func (Entity) IsChildContainerOfPod ¶
func (Entity) IsContainer ¶
func (Entity) IsSelected ¶
IsSelected corresponds anything in the tree that is visually selected, i.e. has [x] in code, it corresponds to having a non-nil LogScanner if an entity isn't selected, there should be no logs displayed for it
type EntityTree ¶
type EntityTree interface { // AddOrReplace adds or updates an entity in the tree // if a Container entity is added that doesn't have the relevant parents in the tree already, // the parents are also added // if a Container entity is added in a namespace that the tree isn't aware of yet, the namespace will // be inserted in alphabetical order AddOrReplace(entity Entity) // GetEntities returns all entities in the tree // within a cluster and namespace, sorted by deployment, pod, and container GetEntities() []Entity // GetVisibleEntities returns all entities that match the filter, any of their children match the filter, // or any of their parents match the filter. Returns in same order as GetEntities GetVisibleEntities(filter filter.Model) []Entity // GetClusterNamespaces returns all cluster namespaces GetClusterNamespaces() []ClusterNamespaces // AnyPendingContainers returns true if any container in the tree is pending AnyPendingContainers() bool // IsVisibleGivenFilter returns true if the entity or any of its children or parents match the filter IsVisibleGivenFilter(entity Entity, filter filter.Model) bool // GetContainerEntities returns all entities that are containers in the tree GetContainerEntities() []Entity // Remove removes an entity from the tree. If it is the last entity in a parent, the parent is also removed, // all the way up the tree Remove(entity Entity) // GetSelectionActions returns a map of container Entity's to a boolean indicating if they // should be activated or deactivated based on the current selection // If an Entity doesn't match the filter, it is not included in the map // If an Entity is pending, it is not included in the map // If the selection is a container, only the selection is returned // If it is a cluster, namespace, deployment, or pod, all children containers are returned // If the request is to activate, only running containers are returned GetSelectionActions(selectedEntity Entity, filter filter.Model) map[Entity]bool // GetEntity gets an entity by its Container GetEntity(container Container) *Entity // UpdatePrettyPrintPrefixes updates the Prefix field of all entities in the tree // such that the tree renders as a nice visual tree given the current filter UpdatePrettyPrintPrefixes(filter filter.Model) // ContainerToShortName returns a function mapping a container to its short name // Short names are unique identifiers given all the other containers in the tree ContainerToShortName(minCharsEachSide int) func(Container) (string, error) }
EntityTree is a tree of entities with hierarchy Cluster > Namespace > Deployment > Pod > Container can contain multiple clusters
func NewEntityTree ¶
func NewEntityTree(allClusterNamespaces []ClusterNamespaces) EntityTree
type LogScanner ¶
type LogScanner struct { Container Container LogChan chan Log ErrChan chan error // contains filtered or unexported fields }
func NewLogScanner ¶
func NewLogScanner(container Container, scanner *bufio.Scanner, cancelK8sStream context.CancelFunc) LogScanner
func (LogScanner) Cancel ¶
func (ls LogScanner) Cancel()
func (LogScanner) Equals ¶
func (ls LogScanner) Equals(other LogScanner) bool
func (LogScanner) StartReadingLogs ¶
func (ls LogScanner) StartReadingLogs()
StartReadingLogs starts a goroutine that reads logs from the scanner and sends them to the LogChan
type NewSelectorArgs ¶
type PageLog ¶
type PageLog struct { Log Log ContainerNames PageLogContainerNames CurrentName string Timestamps PageLogTimestamps CurrentTimestamp string Terminated bool }
type PageLogContainer ¶
type PageLogContainer struct {
// contains filtered or unexported fields
}
func NewPageLogContainer ¶
func NewPageLogContainer(ascending bool) *PageLogContainer
func (*PageLogContainer) AppendLog ¶
func (lc *PageLogContainer) AppendLog(log PageLog, _ interface{})
func (PageLogContainer) Ascending ¶
func (lc PageLogContainer) Ascending() bool
func (PageLogContainer) GetOrderedLogs ¶
func (lc PageLogContainer) GetOrderedLogs() []PageLog
func (*PageLogContainer) RemoveAllLogs ¶
func (lc *PageLogContainer) RemoveAllLogs()
func (*PageLogContainer) ToggleAscending ¶
func (lc *PageLogContainer) ToggleAscending()
type PageLogContainerNames ¶
type PageLogTimestamps ¶
type Selectors ¶
type Selectors struct {
// contains filtered or unexported fields
}
func NewSelectors ¶
func NewSelectors(args NewSelectorArgs) (*Selectors, error)
func (Selectors) SelectContainer ¶
type SinceTime ¶
func (SinceTime) TimeToNextUpdate ¶
type ValidRegex ¶
func NewValidRegex ¶
func NewValidRegex(pattern string) (*ValidRegex, error)
Click to show internal directories.
Click to hide internal directories.