app

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllExecutableTypes = []ExecutableType{
	Daemon,
	Control,
	Generic,
}

AllExecutableTypes contains all possible variants of ExecutableType.

Functions

func NewAppFor

func NewAppFor(platform string, executableType ExecutableType) *kingpin.Application

NewAppFor creates a new instance of the command line parser (cli.App) for the given executableType.

func NewAppsFor added in v0.2.0

func NewAppsFor(platform string) map[ExecutableType]*kingpin.Application

NewAppsFor creates new instances of the command line parser (cli.App) for every ExecutableType.

Types

type ConfigWrapper

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

ConfigWrapper wraps the config of caretakerd and triggers the loading of this config file when calling Set(string).

func NewConfigWrapperFor added in v0.2.0

func NewConfigWrapperFor(platform string) *ConfigWrapper

NewConfigWrapperFor creates a new instance of ConfigWrapper.

func (ConfigWrapper) Instance

func (instance ConfigWrapper) Instance() *caretakerd.Config

Instance returns the final caretakerd Config instance.

func (ConfigWrapper) ListenAddress added in v0.2.0

func (instance ConfigWrapper) ListenAddress() *FlagWrapper

ListenAddress returns the listenAddress FlagWrapper

func (ConfigWrapper) PemFile added in v0.2.0

func (instance ConfigWrapper) PemFile() *FlagWrapper

PemFile returns the pemFile FlagWrapper

func (*ConfigWrapper) ProvideConfig added in v0.2.0

func (instance *ConfigWrapper) ProvideConfig(forDaemon bool) (*caretakerd.Config, error)

ProvideConfig will either return the already loaded configuration or will load it

func (*ConfigWrapper) Set

func (instance *ConfigWrapper) Set(value string) error

Set sets the given string to the current object from a string. Returns an error object if there are problems while transforming the string.

func (ConfigWrapper) String

func (instance ConfigWrapper) String() string

type ExecutableType

type ExecutableType int

ExecutableType represents a type of the caretakerd executable.

const (
	// Daemon indicates that this executable is the caretaker daemon itself.
	Daemon ExecutableType = 0
	// Control indicates that this executable is the caretaker control binary.
	Control ExecutableType = 1
	// Generic indicates that this executable is the caretaker binary which combines
	// daemon and control binary together.
	Generic ExecutableType = 2
)

func (ExecutableType) String

func (instance ExecutableType) String() string

type FlagWrapper

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

FlagWrapper wraps generic command line flags.

func NewFlagWrapper

func NewFlagWrapper(initialValue Stringer) *FlagWrapper

NewFlagWrapper creates a new instance of FlagWrapper.

func (FlagWrapper) AssignIfExplicitSet

func (instance FlagWrapper) AssignIfExplicitSet(to interface{})

AssignIfExplicitSet assigns the wrapped value to given object if it was explicitly set before.

func (FlagWrapper) IsExplicitSet

func (instance FlagWrapper) IsExplicitSet() bool

IsExplicitSet returns true if the Set(string) method has been called before.

func (*FlagWrapper) Set

func (instance *FlagWrapper) Set(value string) error

Set sets the given string to the current object from a string. Returns an error object if there are problems while transforming the string.

func (FlagWrapper) String

func (instance FlagWrapper) String() string

func (FlagWrapper) Value

func (instance FlagWrapper) Value() Stringer

Value returns the wrapped generic command line flag.

type Stringer added in v0.2.0

type Stringer interface {
	Set(value string) error
	String() string
}

Jump to

Keyboard shortcuts

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