Documentation ¶
Index ¶
- Constants
- func FormatWatcherID(gvr schema.GroupVersionResource, namespace string, watcherType WatcherType) string
- func NewBaseWatcher(config WatcherConfig, watcherType WatcherType) *baseWatcher
- type KubeConnection
- type KubeService
- func (ks *KubeService) Discover(ctx context.Context, kubeContext string) ([]*metav1.APIResourceList, error)
- func (ks *KubeService) GetContextNames() []string
- func (ks *KubeService) GetDefaultContext() string
- func (ks *KubeService) ListResource(ctx context.Context, kubeContext string, gvr schema.GroupVersionResource, ...) ([]*unstructured.Unstructured, error)
- func (ks *KubeService) ListResourceTabular(ctx context.Context, kubeContext string, gvr schema.GroupVersionResource, ...) (*metav1.Table, error)
- func (ks *KubeService) Stop()
- type ListWatcher
- type TableWatcher
- type Watcher
- type WatcherConfig
- type WatcherType
Constants ¶
View Source
const ( // DefaultDialTimeout is the default timeout for the connection DefaultDialTimeout = 5 * time.Second // MaxResourceWatchers is the maximum number of resource watchers that can be active at the same time MaxWatchers = 10 )
View Source
const (
DefaultWatchTimeout = 120 * time.Second
)
View Source
const (
// MaxConnections is the maximum number of connections that can be active at the same time
MaxConnections = 3
)
Variables ¶
This section is empty.
Functions ¶
func FormatWatcherID ¶ added in v0.2.0
func FormatWatcherID(gvr schema.GroupVersionResource, namespace string, watcherType WatcherType) string
func NewBaseWatcher ¶ added in v0.2.0
func NewBaseWatcher(config WatcherConfig, watcherType WatcherType) *baseWatcher
Types ¶
type KubeConnection ¶
func NewKubeConnection ¶
func NewKubeConnection(kubeConfig *api.Config, kubeContext string) (*KubeConnection, error)
func (*KubeConnection) Discover ¶ added in v0.2.0
func (kc *KubeConnection) Discover(ctx context.Context) ([]*metav1.APIResourceList, error)
func (*KubeConnection) GetWatcher ¶ added in v0.2.0
func (kc *KubeConnection) GetWatcher(gvr schema.GroupVersionResource, namespace string, watcherType WatcherType) (Watcher, error)
func (*KubeConnection) Stop ¶
func (kc *KubeConnection) Stop()
type KubeService ¶
type KubeService struct {
// contains filtered or unexported fields
}
func NewKubeService ¶
func NewKubeService() *KubeService
func (*KubeService) Discover ¶ added in v0.2.0
func (ks *KubeService) Discover(ctx context.Context, kubeContext string) ([]*metav1.APIResourceList, error)
func (*KubeService) GetContextNames ¶
func (ks *KubeService) GetContextNames() []string
func (*KubeService) GetDefaultContext ¶
func (ks *KubeService) GetDefaultContext() string
func (*KubeService) ListResource ¶
func (ks *KubeService) ListResource(ctx context.Context, kubeContext string, gvr schema.GroupVersionResource, namespace string) ([]*unstructured.Unstructured, error)
func (*KubeService) ListResourceTabular ¶ added in v0.2.0
func (ks *KubeService) ListResourceTabular(ctx context.Context, kubeContext string, gvr schema.GroupVersionResource, namespace string) (*metav1.Table, error)
func (*KubeService) Stop ¶
func (ks *KubeService) Stop()
type ListWatcher ¶ added in v0.2.0
type ListWatcher struct {
// contains filtered or unexported fields
}
func NewListWatcher ¶ added in v0.2.0
func NewListWatcher(clientConfig *rest.Config, config WatcherConfig) (*ListWatcher, error)
func (ListWatcher) GetLastUsed ¶ added in v0.2.0
func (ListWatcher) GetType ¶ added in v0.2.0
func (bw ListWatcher) GetType() WatcherType
func (*ListWatcher) List ¶ added in v0.2.0
func (lw *ListWatcher) List(ctx context.Context) ([]*unstructured.Unstructured, error)
func (ListWatcher) UpdateLastUsed ¶ added in v0.2.0
func (bw ListWatcher) UpdateLastUsed()
type TableWatcher ¶ added in v0.2.0
type TableWatcher struct {
// contains filtered or unexported fields
}
func NewTableWatcher ¶ added in v0.2.0
func NewTableWatcher(clientConfig *rest.Config, config WatcherConfig) (*TableWatcher, error)
func (TableWatcher) GetLastUsed ¶ added in v0.2.0
func (TableWatcher) GetType ¶ added in v0.2.0
func (bw TableWatcher) GetType() WatcherType
func (TableWatcher) UpdateLastUsed ¶ added in v0.2.0
func (bw TableWatcher) UpdateLastUsed()
type Watcher ¶ added in v0.2.0
type Watcher interface { Stop() GetLastUsed() time.Time UpdateLastUsed() GetType() WatcherType GetID() string }
type WatcherConfig ¶ added in v0.2.0
type WatcherConfig struct { KubeContext string GVR schema.GroupVersionResource Namespace string // contains filtered or unexported fields }
type WatcherType ¶ added in v0.2.0
type WatcherType string
const ( WatcherTypeList WatcherType = "list" WatcherTypeTable WatcherType = "table" WatcherTypeResource WatcherType = "resource" )
Click to show internal directories.
Click to hide internal directories.