kubernetes

package
v0.0.0-...-2f5b9ad Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogToChannel

func LogToChannel(ctx context.Context, ch chan string, req *rest.Request)

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

func (*Cluster) Connect

func (c *Cluster) Connect() error

func (*Cluster) GetContext

func (c *Cluster) GetContext() string

func (*Cluster) GetNamespaceEvent

func (c *Cluster) GetNamespaceEvent() NamespaceEvent

func (*Cluster) GetNamespaces

func (c *Cluster) GetNamespaces() (*v1.NamespaceList, error)

func (*Cluster) GetPodEvent

func (c *Cluster) GetPodEvent() PodEvent

func (*Cluster) GetPods

func (c *Cluster) GetPods(namespace string) (*v1.PodList, error)

func (*Cluster) RunK8mpassCommand

func (c *Cluster) RunK8mpassCommand(fn api.K8mpassCommand, namespace string) tea.Cmd

func (*Cluster) RunK8mpassCondition

func (c *Cluster) RunK8mpassCondition(fn api.K8mpassCondition, namespace string) bool

func (*Cluster) SendLogsToChannel

func (c *Cluster) SendLogsToChannel(ctx context.Context, nameSpace string, podName string, ch chan string) error

func (*Cluster) StopWatchingPods

func (c *Cluster) StopWatchingPods()

func (*Cluster) WatchNamespaces

func (c *Cluster) WatchNamespaces(resourceVersion string) error

func (*Cluster) WatchPods

func (c *Cluster) WatchPods(ctx context.Context, namespace string, resourceVersion string) error

type EventType

type EventType string
const (
	Added     EventType = "ADDED"
	Modified  EventType = "MODIFIED"
	Deleted   EventType = "DELETED"
	Unhandled EventType = "UNHANDLED"
	Error     EventType = "ERROR"
	Closed    EventType = "CLOSED"
)

type ICluster

type ICluster interface {
	Connect() error
	GetContext() string
}

type ILogService

type ILogService interface {
	SendLogsToChannel(ctx context.Context, nameSpace string, podName string, ch chan string) error
}

type INamespaceService

type INamespaceService interface {
	GetNamespaces() (*v1.NamespaceList, error)
	GetNamespaceEvent() NamespaceEvent
	WatchNamespaces(resourceVersion string) error
}

type IPodService

type IPodService interface {
	GetPods(namespace string) (*v1.PodList, error)
	GetPodEvent() PodEvent
	WatchPods(ctx context.Context, namespace string, resourceVersion string) error
	StopWatchingPods()
	RunK8mpassCondition(fn api.K8mpassCondition, namespace string) bool
	RunK8mpassCommand(fn api.K8mpassCommand, namespace string) tea.Cmd
}

type NamespaceEvent

type NamespaceEvent struct {
	Type      EventType
	Namespace *v1.Namespace
}

type PodEvent

type PodEvent struct {
	Type EventType
	Pod  *v1.Pod
}

Jump to

Keyboard shortcuts

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