bucket

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingClient = errors.New("buckets need a kubernetes client for initialization")

Functions

This section is empty.

Types

type Buckets

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

func NewBuckets

func NewBuckets() *Buckets

func (*Buckets) Aliases

func (bs *Buckets) Aliases(name string) []string

func (*Buckets) Describe

func (bs *Buckets) Describe(name string) string

func (*Buckets) InitBucket

func (bs *Buckets) InitBucket(name string, config Config) (Interface, error)

InitBucket creates an instance of the named interface.

func (*Buckets) IsActive

func (bs *Buckets) IsActive(name string) bool

func (*Buckets) Register

func (bs *Buckets) Register(name string, aliases []string, description string, active bool, factory Factory)

Register registers a plugin Factory by name. This is expected to happen during app startup.

func (*Buckets) Registered

func (bs *Buckets) Registered() []string

Registered enumerates the names of all registered plugins.

func (*Buckets) RegisteredPassive

func (bs *Buckets) RegisteredPassive() []string

Registered enumerates the names of all passive registered plugins.

func (*Buckets) ResolveAlias

func (bs *Buckets) ResolveAlias(alias string) (string, bool)

type Config

type Config struct {
	Client      kubernetes.Interface
	Namespace   string
	Color       bool
	OutputWidth int
	// This options is specific to the admission plugin, is it to force creation even if we can't cleanup the mess with delete
	AdmForce bool
}

func NewConfig

func NewConfig() *Config

type ErrUnknownBucket

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

func (ErrUnknownBucket) Error

func (e ErrUnknownBucket) Error() string

type Factory

type Factory func(config Config) (Interface, error)

type Interface

type Interface interface {
	Runnable
}

type Results

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

func NewResults

func NewResults(name string) *Results

func (*Results) AddComment added in v1.1.0

func (r *Results) AddComment(comment string)

func (*Results) AddContent

func (r *Results) AddContent(content []interface{})

func (Results) Human

func (r Results) Human(opts ResultsOpts) string

func (Results) JSON

func (r Results) JSON(opts ResultsOpts) (string, error)

func (*Results) SetHeaders

func (r *Results) SetHeaders(headers []string)

type ResultsOpts

type ResultsOpts struct {
	ShowName     *bool
	ShowComments *bool
	ShowData     *bool
	OutputWidth  int
}

ResultsOpts uses pointers to have a default nil value that will be evaluated as true instead of bool defaut that is false.

type Runnable

type Runnable interface {
	Run() (Results, error)
}

Jump to

Keyboard shortcuts

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