app

package
v0.0.0-...-2118aee Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand creates a new instance of spectacles, which can be executed as part of an existing application.

func NewCommandWithOptions

func NewCommandWithOptions(o *Options) *cobra.Command

NewCommandWithOptions creates a new instance of spectacles with a set of options. The resulting command can be executed as part of a larger app.

Types

type CleanupFunc

type CleanupFunc func()

CleanupFunc is an operation to cleanup resources that may be left behind.

func NewStandalone

func NewStandalone(o *Options) (*cobra.Command, CleanupFunc)

NewStandalone creates a new instance of spectacles, but also initializes the Kubernetes logger mechanism for when the command is being run as a standalone. The second return is a cleanup function that must be called after the function is executed, e.g.:

o := app.NewOptions()
cmd, cleanup := app.NewStandalone(o)
defer cleanup()
err := cmd.Execute()

type Options

type Options struct {
	Kubeconfig string
	Master     string

	HealthzPort int32
	MetricsPort int32

	ResyncPeriod *metav1.Duration

	Sink  sinks.Writer
	Sinks map[string]sinks.Writer
}

Options encapsulates all application options.

func NewOptions

func NewOptions() *Options

NewOptions initializes a structure to encapsulate application options.

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

AddFlags injects application options into the flagset.

func (*Options) Complete

func (o *Options) Complete() error

Complete checks command line argument combinations.

func (*Options) Validate

func (o *Options) Validate(args []string) error

Validate checks that the correct options are specified.

Jump to

Keyboard shortcuts

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