app

package
v0.0.0-...-9632032 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 30 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelOnInterrupt

func CancelOnInterrupt(ctx context.Context, f context.CancelFunc)

CancelOnInterrupt calls f when os.Interrupt or SIGTERM is received. It ignores subsequent interrupts on purpose - program should exit correctly after the first signal.

Types

type App

type App struct {
	Logger *zap.Logger

	options.GenericNamespacedControllerOptions
	options.LeaderElectionOptions
	options.RestClientOptions
	options.LoggerOptions

	MainClient         kubernetes.Interface
	PrometheusRegistry PrometheusRegistry

	// Name is the name of the application. It must only contain alphanumeric
	// characters.
	Name        string
	RestConfig  *rest.Config
	Controllers []ctrl.Constructor
	AuxListenOn string
	Debug       bool
}

func NewFromFlags

func NewFromFlags(name string, controllers []ctrl.Constructor, flagset *flag.FlagSet, arguments []string) (*App, error)

func (*App) Run

func (a *App) Run(ctx context.Context) (retErr error)

type AuxServer

type AuxServer struct {
	Logger *zap.Logger
	// Name is the name of the application.
	Name     string
	Addr     string // TCP address to listen on, ":http" if empty
	Gatherer prometheus.Gatherer
	IsReady  func() bool
	Debug    bool
}

func (*AuxServer) Run

func (a *AuxServer) Run(ctx context.Context) error

type PrometheusRegistry

type PrometheusRegistry interface {
	prometheus.Registerer
	prometheus.Gatherer
}

Jump to

Keyboard shortcuts

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