Documentation
¶
Index ¶
- Constants
- func StaticClusterClient(client cluster.ClientInterface) *staticClusterClient
- type BuildInfo
- type CRDWatchConfig
- type CRDWatcher
- type Context
- type Dash
- type KubeContextDecorator
- type Live
- func (l *Live) BuildInfo() (string, string, string)
- func (l *Live) CRDWatcher() CRDWatcher
- func (l *Live) ClusterClient() cluster.ClientInterface
- func (l *Live) Contexts() []kubeconfig.Context
- func (l *Live) CurrentContext() string
- func (l *Live) DefaultNamespace() string
- func (l *Live) ErrorStore() internalErr.ErrorStore
- func (l *Live) Logger() log.Logger
- func (l *Live) ModuleManager() module.ManagerInterface
- func (l *Live) ObjectPath(namespace, apiVersion, kind, name string) (string, error)
- func (l *Live) ObjectStore() store.Store
- func (l *Live) PluginManager() plugin.ManagerInterface
- func (l *Live) PortForwarder() portforward.PortForwarder
- func (l *Live) SetContextChosenInUI(contextChosen bool)
- func (l *Live) UseContext(ctx context.Context, contextName string) error
- func (l *Live) UseFSContext(ctx context.Context) error
- func (l *Live) Validate() error
- type ObjectHandler
Constants ¶
const UseFSContext = ""
UseFSContext is used to indicate a context switch to the file system Kubeconfig context
Variables ¶
This section is empty.
Functions ¶
func StaticClusterClient ¶ added in v0.18.0
func StaticClusterClient(client cluster.ClientInterface) *staticClusterClient
Types ¶
type CRDWatchConfig ¶
type CRDWatchConfig struct { Add ObjectHandler Delete ObjectHandler IsNamespaced bool }
CRDWatchConfig is configuration for CRDWatcher.
func (*CRDWatchConfig) CanPerform ¶
func (c *CRDWatchConfig) CanPerform(u *unstructured.Unstructured) bool
CanPerform returns true if config can perform actions on an object.
type CRDWatcher ¶
type CRDWatcher interface { Watch(ctx context.Context) error AddConfig(config *CRDWatchConfig) error }
CRDWatcher watches for CRDs.
type Dash ¶
type Dash interface { octant.LinkGenerator octant.Storage ClusterClient() cluster.ClientInterface CRDWatcher() CRDWatcher ErrorStore() internalErr.ErrorStore Logger() log.Logger PluginManager() plugin.ManagerInterface PortForwarder() portforward.PortForwarder SetContextChosenInUI(contextChosen bool) UseFSContext(ctx context.Context) error UseContext(ctx context.Context, contextName string) error CurrentContext() string Contexts() []kubeconfig.Context DefaultNamespace() string Validate() error ModuleManager() module.ManagerInterface BuildInfo() (string, string, string) }
Config is configuration for dash. It has knowledge of the all the major sections of dash.
type KubeContextDecorator ¶ added in v0.18.0
type KubeContextDecorator interface { SwitchContext(context.Context, string) error ClusterClient() cluster.ClientInterface CurrentContext() string Contexts() []kubeconfig.Context }
KubeContextDecorator handles context changes
type Live ¶
type Live struct {
// contains filtered or unexported fields
}
Live is a live version of dash config.
func NewLiveConfig ¶
func NewLiveConfig( kubeContextDecorator KubeContextDecorator, crdWatcher CRDWatcher, logger log.Logger, moduleManager module.ManagerInterface, objectStore store.Store, errorStore internalErr.ErrorStore, pluginManager plugin.ManagerInterface, portForwarder portforward.PortForwarder, restConfigOptions cluster.RESTConfigOptions, buildInfo BuildInfo, contextChosenInUI bool, ) *Live
NewLiveConfig creates an instance of Live.
func (*Live) BuildInfo ¶ added in v0.13.0
BuildInfo returns build ldflag strings for version, commit hash, and build time
func (*Live) ClusterClient ¶
func (l *Live) ClusterClient() cluster.ClientInterface
ClusterClient returns a cluster client.
func (*Live) Contexts ¶ added in v0.18.0
func (l *Live) Contexts() []kubeconfig.Context
Contexts returns the set of all contexts
func (*Live) CurrentContext ¶ added in v0.18.0
CurrentContext returns the current context name
func (*Live) DefaultNamespace ¶
DefaultNamespace returns the default namespace for the current cluster..
func (*Live) ErrorStore ¶
func (l *Live) ErrorStore() internalErr.ErrorStore
ErrorStore returns an error store.
func (*Live) ModuleManager ¶
func (l *Live) ModuleManager() module.ManagerInterface
func (*Live) ObjectPath ¶
ObjectPath returns the path given an object description.
func (*Live) ObjectStore ¶
ObjectStore returns an object store.
func (*Live) PluginManager ¶
func (l *Live) PluginManager() plugin.ManagerInterface
PluginManager returns a plugin manager.
func (*Live) PortForwarder ¶
func (l *Live) PortForwarder() portforward.PortForwarder
PortForwarder returns a port forwarder.
func (*Live) SetContextChosenInUI ¶ added in v0.18.0
func (*Live) UseContext ¶
UseContext switches context name. This process should have synchronously.
type ObjectHandler ¶
type ObjectHandler func(ctx context.Context, object *unstructured.Unstructured)
ObjectHandler is a function that is run when a new object is available.