Version: v0.22.0 Latest Latest

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 49 Imported by: 3




This section is empty.


This section is empty.


func ValidateKubeConfig

func ValidateKubeConfig(logger log.Logger, kubeConfig string, fs afero.Fs) (string, error)

ValidateKubeConfig returns a valid file list of kube config(s)


type ConfigWatcher

type ConfigWatcher struct {
	FileWatcher FileWatcher
	// contains filtered or unexported fields

ConfigWatcher watches kubernetes configurations.

func NewConfigWatcher

func NewConfigWatcher(wc WatcherConfig, options ...ConfigWatcherOption) (*ConfigWatcher, error)

NewConfigWatcher creates an instance of ConfigWatcher.

func (*ConfigWatcher) Add

func (cw *ConfigWatcher) Add(ctx context.Context, names ...string) error

Add adds file names to be watched.

func (*ConfigWatcher) Watch

func (cw *ConfigWatcher) Watch(ctx context.Context)

Watch runs the config watcher loop

type ConfigWatcherOption

type ConfigWatcherOption func(cw *ConfigWatcher)

ConfigWatcherOption is an option for configuration ConfigWatcher.

func ConfigWatcherFileWatcher

func ConfigWatcherFileWatcher(fw FileWatcher) ConfigWatcherOption

ConfigWatcherFileWatcher sets the file watcher for ConfigWatcher.

type DefaultFileWatcher

type DefaultFileWatcher struct {
	// contains filtered or unexported fields

DefaultFileWatcher wraps fsnotify.Watcher so it can adhere to the FileWatcher API.

func NewDefaultFileWatcher

func NewDefaultFileWatcher() (*DefaultFileWatcher, error)

NewDefaultFileWatcher creates an instance of DefaultFileWatcher.

func (*DefaultFileWatcher) Add

func (d *DefaultFileWatcher) Add(name string) error

Add adds a file name to be watched.

func (DefaultFileWatcher) Errors

func (d DefaultFileWatcher) Errors() chan error

Errors returns a channel of errors.

func (*DefaultFileWatcher) Events

func (d *DefaultFileWatcher) Events() chan fsnotify.Event

Events returns a channel of fsnotify events.

type FileWatcher

type FileWatcher interface {
	// Add adds a file to watch.
	Add(name string) error
	// Events returns a channel with fsnotify events.
	Events() chan fsnotify.Event
	// Errors returns errors.
	Errors() chan error

FileWatcher watches files.

type Options

type Options struct {
	BrowserPath            string
	BuildInfo              config.BuildInfo
	ClientBurst            int
	ClientQPS              float32
	Context                string
	DisableClusterOverview bool
	EnableMemStats         bool
	EnableOpenCensus       bool
	FrontendURL            string
	KubeConfig             string
	Listener               net.Listener
	Namespace              string
	Namespaces             []string
	UserAgent              string
	// contains filtered or unexported fields

type Runner

type Runner struct {
	// contains filtered or unexported fields

func NewRunner

func NewRunner(ctx context.Context, logger log.Logger, opts ...RunnerOption) (*Runner, error)

func (*Runner) Start

func (r *Runner) Start(startupCh, shutdownCh chan bool, opts ...RunnerOption) error

type RunnerOption

type RunnerOption struct {
	// contains filtered or unexported fields

func WithBrowserPath

func WithBrowserPath(browserPath string) RunnerOption

func WithBuildInfo

func WithBuildInfo(buildInfo config.BuildInfo) RunnerOption

func WithClientBurst

func WithClientBurst(burst int) RunnerOption

func WithClientQPS

func WithClientQPS(qps float32) RunnerOption

func WithClientUserAgent

func WithClientUserAgent(userAgent string) RunnerOption

func WithClusterClient

func WithClusterClient(client cluster.ClientInterface) RunnerOption

func WithContext

func WithContext(context string) RunnerOption

func WithDynamicSharedInformerFactory

func WithDynamicSharedInformerFactory(factory dynamicinformer.DynamicSharedInformerFactory) RunnerOption

WithDynamicSharedInformerFactory allows overriding the DynamicSharedInformerFactory that is used by the default ObjectStore implementation. This is used for embedded uses of Octant and testing. If the WithObjectStore option is provided, this option is ignored.

func WithFrontendURL

func WithFrontendURL(frontendURL string) RunnerOption

func WithKubeConfig

func WithKubeConfig(kubeConfig string) RunnerOption

func WithListener

func WithListener(listener net.Listener) RunnerOption

func WithMemStats

func WithMemStats() RunnerOption

func WithNamespace

func WithNamespace(namespace string) RunnerOption

func WithNamespaces

func WithNamespaces(namespaces []string) RunnerOption

func WithObjectStore

func WithObjectStore(objectStore store.Store) RunnerOption

WithObjectStore allows overriding the default ObjectStore implementation with a custom object store. This is for embedded uses of Octant and testing purposes. When using this option the WithDynamicSharedInformerFactory option is ignored.

func WithOpenCensus

func WithOpenCensus() RunnerOption

func WithStreamingClientFactory

func WithStreamingClientFactory(factory api.StreamingClientFactory) RunnerOption

func WithoutClusterOverview

func WithoutClusterOverview() RunnerOption

type WatcherConfig

type WatcherConfig interface {
	CurrentContext() string
	UseFSContext(ctx context.Context) error
	UseContext(ctx context.Context, name string) error

WatcherConfig is an interface with configuration for ConfigWatcher.


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