bucket

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 9 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 Bucket added in v1.2.0

type Bucket struct {
	Name        string
	Description string
	Aliases     []string
	Factory     Factory
	// has side-effects on its environment or is just readonly
	SideEffects bool
	// requires a client to communicate with the API server
	RequireClient bool
}

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) HasSideEffects added in v1.2.0

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

func (*Buckets) InitBucket

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

InitBucket creates an instance of the named interface.

func (*Buckets) Register

func (bs *Buckets) Register(b Bucket)

Register registers a plugin Factory by name. This is expected to happen during app startup. Register does not return an error but panic

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) RequiresClient added in v1.2.0

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

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
	// This options is specific to the admission plugin, is it to actually create
	// pod instead of use the dry run
	AdmCreate bool
}

func NewConfig

func NewConfig() *Config

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

type UnknownBucketError added in v1.4.0

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

func (UnknownBucketError) Error added in v1.4.0

func (e UnknownBucketError) Error() string

Jump to

Keyboard shortcuts

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