config

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo added in v0.13.0

type BuildInfo struct {
	Version string
	Commit  string
	Time    string
}

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 Context

type Context struct {
	Name             string
	DefaultNamespace string
}

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

	KubeConfigPath() string

	UseContext(ctx context.Context, contextName string) error

	ContextName() string

	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 Live

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

Live is a live version of dash config.

func NewLiveConfig

func NewLiveConfig(
	clusterClient cluster.ClientInterface,
	crdWatcher CRDWatcher,
	kubeConfigPath string,
	logger log.Logger,
	moduleManager module.ManagerInterface,
	objectStore store.Store,
	errorStore internalErr.ErrorStore,
	pluginManager plugin.ManagerInterface,
	portForwarder portforward.PortForwarder,
	currentContextName string,
	restConfigOptions cluster.RESTConfigOptions,
	buildInfo BuildInfo,
) *Live

NewLiveConfig creates an instance of Live.

func (*Live) BuildInfo added in v0.13.0

func (l *Live) BuildInfo() (string, string, string)

BuildInfo returns build ldflag strings for version, commit hash, and build time

func (*Live) CRDWatcher

func (l *Live) CRDWatcher() CRDWatcher

CRDWatcher returns a CRD watcher.

func (*Live) ClusterClient

func (l *Live) ClusterClient() cluster.ClientInterface

ClusterClient returns a cluster client.

func (*Live) ContextName

func (l *Live) ContextName() string

ContextName returns the current context name

func (*Live) DefaultNamespace

func (l *Live) DefaultNamespace() string

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) KubeConfigPath

func (l *Live) KubeConfigPath() string

KubeConfigPath returns the kube config path.

func (*Live) Logger

func (l *Live) Logger() log.Logger

Logger returns a logger.

func (*Live) ModuleManager

func (l *Live) ModuleManager() module.ManagerInterface

func (*Live) ObjectPath

func (l *Live) ObjectPath(namespace, apiVersion, kind, name string) (string, error)

ObjectPath returns the path given an object description.

func (*Live) ObjectStore

func (l *Live) ObjectStore() store.Store

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) UseContext

func (l *Live) UseContext(ctx context.Context, contextName string) error

UseContext switches context name. This process should have synchronously.

func (*Live) Validate

func (l *Live) Validate() error

Validate validates the configuration and returns an error if there is an issue.

type ObjectHandler

type ObjectHandler func(ctx context.Context, object *unstructured.Unstructured)

ObjectHandler is a function that is run when a new object is available.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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