config

package
v1.9.10 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig(indent string) []byte

func RegisterFlag

func RegisterFlag(prefix string, Command *spfcbr.Command, Viper *spfvpr.Viper) error

Types

type ConfigStatus

type ConfigStatus struct {
	// Mandatory define if the component must be available for the api.
	// If yes, api status will be KO if this component is down.
	// If no, api status can be OK if this component is down.
	Mandatory bool `json:"mandatory" yaml:"mandatory" toml:"mandatory" mapstructure:"mandatory"`

	// MessageOK define the message if the status is OK. Default is "OK"
	MessageOK string `json:"message_ok" yaml:"message_ok" toml:"message_ok" mapstructure:"message_ok" validate:"printascii"`

	// MessageKO define the message if the status is KO. Default is "KO"
	MessageKO string `json:"message_ko" yaml:"message_ko" toml:"message_ko" mapstructure:"message_ko" validate:"printascii"`

	// CacheTimeoutInfo define the time between checking the component information (name, release, ...), to prevent asking it too many. Default is 1 hour.
	CacheTimeoutInfo time.Duration `json:"cache_timeout_info" yaml:"cache_timeout_info" toml:"cache_timeout_info" mapstructure:"cache_timeout_info"`

	// CacheTimeoutHealth define the time between checking the component health to prevent asking it too many. Default is 5 second.
	CacheTimeoutHealth time.Duration `json:"cache_timeout_health" yaml:"cache_timeout_health" toml:"cache_timeout_health" mapstructure:"cache_timeout_health"`
}

func (*ConfigStatus) Component

func (c *ConfigStatus) Component(fctInfo libsts.FctInfo, fctHealth libsts.FctHealth) libsts.Component

func (*ConfigStatus) RegisterStatus

func (c *ConfigStatus) RegisterStatus(sts libsts.RouteStatus, key string, fctInfo libsts.FctInfo, fctHealth libsts.FctHealth)

Jump to

Keyboard shortcuts

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