config

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SuffixConfigLoaderMap = make(map[string]Loader)

Functions

This section is empty.

Types

type Config

type Config struct {
	PromptForStop  bool                     `yaml:"promptForStop"`
	PromptForStart bool                     `yaml:"promptForStart"`
	ProcessConfigs ProcessConfigList        `yaml:"processes"`
	Traits         map[string]*TraitsConfig `yaml:"traits"`

	DependencyGraphContext *graph.Context
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*Config, error)

func (*Config) Context

func (c *Config) Context() string

func (*Config) Init

func (c *Config) Init() error

func (*Config) Validate

func (c *Config) Validate() error

type CoreProcessConfig

type CoreProcessConfig struct {
	Name     string            `yaml:"name"`
	Group    string            `yaml:"group"`
	Command  util.Command      `yaml:"command"`
	Metadata map[string]string `yaml:"metadata"`
	Trait    string            `yaml:"trait"`
}

type ExecConfig

type ExecConfig struct {
	Command       []string `yaml:"command"`
	ForwardStdout bool     `yaml:"forwardStdout"`
	ForwardStderr bool     `yaml:"forwardStderr"`
}

type HttpGetConfig

type HttpGetConfig struct {
	Path        string            `yaml:"path"`
	Port        int               `yaml:"port"`
	HttpHeaders map[string]string `yaml:"httpHeaders"`
}

type HttpHeader

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

type Loader

type Loader interface {
	Load(path string) (*Config, error)
}

func GetLoaderFromPath

func GetLoaderFromPath(path string) Loader

type ProbeConfig

type ProbeConfig struct {
	InitialDelay     string           `yaml:"initialDelay"`
	Period           string           `yaml:"period"`
	Timeout          string           `yaml:"timeout"`
	FailureThreshold int              `yaml:"failureThreshold"`
	SuccessThreshold int              `yaml:"successThreshold"`
	Exec             *ExecConfig      `yaml:"exec"`
	HttpGet          *HttpGetConfig   `yaml:"httpGet"`
	TcpSocket        *TcpSocketConfig `yaml:"tcpSocket"`
}

type ProcessConfig

type ProcessConfig struct {
	CoreProcessConfig `yaml:",inline"`
	TraitsConfig      `yaml:",inline"`
}

func (*ProcessConfig) FlatMap

func (c *ProcessConfig) FlatMap() *map[string]string

func (*ProcessConfig) IsMatchingSpecifier

func (c *ProcessConfig) IsMatchingSpecifier(specifier string) (bool, error)

func (*ProcessConfig) StopConfig

func (c *ProcessConfig) StopConfig() *StopConfig

func (*ProcessConfig) String

func (c *ProcessConfig) String() string

type ProcessConfigList

type ProcessConfigList []*ProcessConfig

func (*ProcessConfigList) CreateDependencyGraph

func (l *ProcessConfigList) CreateDependencyGraph() (*map[string][]string, error)

func (*ProcessConfigList) ExpectAndGetExactlyOneBySpecifier

func (l *ProcessConfigList) ExpectAndGetExactlyOneBySpecifier(specifier string) (*ProcessConfig, error)

func (*ProcessConfigList) FilterBySpecifier

func (l *ProcessConfigList) FilterBySpecifier(specifier string) (ProcessConfigList, error)

type SignalStopStrategyConfig

type SignalStopStrategyConfig struct {
	Signal       syscall.Signal
	SignalString string
}

func (*SignalStopStrategyConfig) GetSignal

func (s *SignalStopStrategyConfig) GetSignal() (syscall.Signal, error)

type StopConfig

type StopConfig struct {
	Exec    *ExecConfig               `yaml:"exec"`
	Signal  *SignalStopStrategyConfig `yaml:"signal"`
	Timeout string                    `yaml:"timeout"`
	Period  string                    `yaml:"period"`
}

func (*StopConfig) GetPeriod

func (s *StopConfig) GetPeriod() (time.Duration, error)

func (*StopConfig) GetTimeout

func (s *StopConfig) GetTimeout() (time.Duration, error)

type TcpSocketConfig

type TcpSocketConfig struct {
	Port int `yaml:"port"`
}

type TraitsConfig

type TraitsConfig struct {
	DependsOn    []string          `yaml:"dependsOn"`
	Stop         *StopConfig       `yaml:"stop"`
	StartupProbe *ProbeConfig      `yaml:"startupProbe"`
	Env          map[string]string `yaml:"env"`
}

Jump to

Keyboard shortcuts

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