api

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MPL-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareObjectStatus added in v0.5.0

func CompareObjectStatus(a, b client.Object) int

func InformerConnectProperty added in v0.5.0

func InformerConnectProperty[T client.Object](ctx context.Context, cluster *Cluster, gvr schema.GroupVersionResource, prop observer.Property[[]T]) error

func UpdateClusterPreferences added in v0.2.0

func UpdateClusterPreferences(prefs *ClusterPreferences, path, context string) error

Types

type Cluster

type Cluster struct {
	client.Client
	*kubernetes.Clientset
	Config             *rest.Config
	ClusterPreferences observer.Property[ClusterPreferences]
	Metrics            *Metrics
	Events             *Events
	RESTMapper         meta.RESTMapper
	DynamicClient      *dynamic.DynamicClient
	Scheme             *runtime.Scheme
	Encoder            *Encoder
	Resources          []metav1.APIResource
	// contains filtered or unexported fields
}

func NewCluster

func NewCluster(ctx context.Context, clusterPrefs observer.Property[ClusterPreferences]) (*Cluster, error)

func (*Cluster) AddInformerEventHandler added in v0.5.0

func (c *Cluster) AddInformerEventHandler(ctx context.Context, gvr schema.GroupVersionResource, handler cache.ResourceEventHandler) error

func (*Cluster) GVKToR added in v0.5.0

func (*Cluster) GVRToK added in v0.5.0

func (*Cluster) GetAPIResource added in v0.3.0

func (cluster *Cluster) GetAPIResource(gvk schema.GroupVersionKind) *metav1.APIResource

func (*Cluster) GetInformer added in v0.5.0

func (*Cluster) GetReference added in v0.3.0

func (cluster *Cluster) GetReference(ctx context.Context, ref corev1.ObjectReference) (client.Object, error)

func (*Cluster) SetObjectGVK added in v0.3.0

func (cluster *Cluster) SetObjectGVK(object client.Object) error

type ClusterPreferences

type ClusterPreferences struct {
	Kubeconfig  *Kubeconfig
	Name        string
	Host        string
	BearerToken string
	TLS         rest.TLSClientConfig
	Exec        *api.ExecConfig
	ReadOnly    bool
	Navigation  struct {
		Favourites []schema.GroupVersionResource
		Pins       []corev1.ObjectReference
	}
}

func (*ClusterPreferences) Defaults

func (c *ClusterPreferences) Defaults()

type Column

type Column struct {
	Name     string
	Priority int32
	Bind     func(cell *gtk.ColumnViewCell, object client.Object)
	Compare  func(a, b client.Object) int
}

type Encoder added in v0.3.0

type Encoder struct {
	*runtime.Scheme
}

func (*Encoder) Encode added in v0.3.0

func (s *Encoder) Encode(object client.Object) ([]byte, error)

func (*Encoder) EncodeYAML added in v0.3.0

func (s *Encoder) EncodeYAML(object client.Object) ([]byte, error)

type Events

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

func (*Events) For

func (e *Events) For(object client.Object) []*eventsv1.Event

type GroupProperty

type GroupProperty struct {
	ID       string
	Priority int32
	Name     string
	Children []Property
	Widget   func(gtk.Widgetter, *adw.NavigationView)
}

func (*GroupProperty) GetID

func (p *GroupProperty) GetID() string

func (*GroupProperty) GetPriority

func (p *GroupProperty) GetPriority() int32

type Kubeconfig added in v0.2.0

type Kubeconfig struct {
	Path    string
	Context string
}

type License added in v0.2.0

type License struct {
	ID        string
	Key       string
	ExpiresAt *time.Time
}

type Metrics

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

func (*Metrics) Container

func (m *Metrics) Container(pod types.NamespacedName, container string) *metricsv1beta1.ContainerMetrics

func (*Metrics) Node

func (m *Metrics) Node(name string) *metricsv1beta1.NodeMetrics

func (*Metrics) Pod

func (*Metrics) PodSum

type Preferences

type Preferences struct {
	Clusters []observer.Property[ClusterPreferences]
	// contains filtered or unexported fields
}

func LoadPreferences

func LoadPreferences() (*Preferences, error)

func (Preferences) Defaults

func (c Preferences) Defaults()

func (*Preferences) Save

func (c *Preferences) Save() error

type Property

type Property interface {
	GetID() string
	GetPriority() int32
}

type Status added in v0.5.0

type Status struct {
	Condition string
	Reason    string
	Type      StatusType
	Children  []*Status
}

func NewStatus added in v0.5.0

func NewStatus(cond string, reason string, typ StatusType) *Status

func NewStatusWithObject added in v0.5.0

func NewStatusWithObject(object client.Object) *Status

func (*Status) Icon added in v0.5.0

func (status *Status) Icon() *gtk.Image

func (*Status) Icons added in v0.5.0

func (status *Status) Icons() []*gtk.Image

func (*Status) Int added in v0.5.0

func (status *Status) Int() int

type StatusType added in v0.5.0

type StatusType string
const (
	StatusInfo    StatusType = "accent"
	StatusSuccess StatusType = "success"
	StatusWarning StatusType = "warning"
	StatusError   StatusType = "error"
	StatusUnknown StatusType = "unknown"
)

type TextProperty

type TextProperty struct {
	ID        string
	Priority  int32
	Name      string
	Value     string
	Reference *corev1.ObjectReference
	Widget    func(gtk.Widgetter, *adw.NavigationView)
}

func (*TextProperty) GetID

func (p *TextProperty) GetID() string

func (*TextProperty) GetPriority

func (p *TextProperty) GetPriority() int32

Jump to

Keyboard shortcuts

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