core

package
v0.0.0-...-8018142 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MPL-2.0 Imports: 20 Imported by: 0

README

core

GoDoc

Documentation

Overview

Package core contains the main control loop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetArgs

GetArgs parses the command line flags and returns the subcommand we need and its parameters (if any)

Types

type App

type App struct {
	ControlServer *control.HTTPServer
	Discovery     discovery.Backend
	Jobs          []*jobs.Job
	Watches       []*watches.Watch
	Telemetry     *telemetry.Telemetry
	StopTimeout   int

	ConfigFlag string
	Bus        *events.EventBus
	// contains filtered or unexported fields
}

App encapsulates the state of ContainerPilot after the initial setup.

func EmptyApp

func EmptyApp() *App

EmptyApp creates an empty application

func NewApp

func NewApp(configFlag string) (*App, error)

NewApp creates a new App from the config

func (*App) Run

func (a *App) Run()

Run starts the application and blocks until finished

func (*App) SignalEvent

func (a *App) SignalEvent(sig string)

SignalEvent publishes a signal event onto the event bus

func (*App) Terminate

func (a *App) Terminate()

Terminate kills the application

type MultiFlag

type MultiFlag struct {
	Values map[string]string
}

MultiFlag provides a custom CLI flag that stores its unique values into a simple map.

func (MultiFlag) Len

func (f MultiFlag) Len() int

Len is the length of the slice of values for this MultiFlag.

func (*MultiFlag) Set

func (f *MultiFlag) Set(value string) error

Set satisfies the flag.Value interface by creating a map of all unique CLI flag values.

func (MultiFlag) String

func (f MultiFlag) String() string

String satisfies the flag.Value interface by joining together the flag values map into a single String.

Jump to

Keyboard shortcuts

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