config

package
v1.62.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VCAP_SERVICES    = "VCAP_SERVICES"
	VCAP_APPLICATION = "VCAP_APPLICATION"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseInfo

type BaseInfo struct {
	BaseURL  string `yaml:"base_url"`
	Support  string `yaml:"support"`
	Contact  string `yaml:"contact"`
	Title    string `yaml:"title"`
	TimeZone string `yaml:"time_zone"`
}

func (*BaseInfo) Validate added in v1.32.0

func (b *BaseInfo) Validate(listen string) error

type Component

type Component struct {
	Name        string
	Description string
	Group       string
}

func (Component) String

func (c Component) String() string

type Components

type Components []Component

func (Components) Inline

func (cs Components) Inline() []string

func (Components) Regroups

func (cs Components) Regroups() map[string][]Component

type Config

type Config struct {
	Targets    Targets    `yaml:"targets"`
	Listen     string     `yaml:"listen"`
	Log        *Log       `yaml:"log"`
	Components Components `yaml:"components"`
	BaseInfo   *BaseInfo  `yaml:"base_info"`
	Username   string     `yaml:"username"`
	Password   string     `yaml:"password"`

	CookieKey string     `yaml:"cookie_key"`
	Notifiers []Notifier `yaml:"notifiers"`

	Theme *Theme `yaml:"theme"`
}

func LoadConfig

func LoadConfig(content []byte) (Config, error)

func LoadConfigFromEnv added in v1.32.0

func LoadConfigFromEnv() (Config, error)

func LoadConfigFromFile added in v1.32.0

func LoadConfigFromFile(filename string) (Config, error)

func (*Config) Merge added in v1.32.0

func (c *Config) Merge(other Config)

func (*Config) Validate added in v1.32.0

func (c *Config) Validate() error

type ForComponent

type ForComponent struct {
	RequireAll bool     `yaml:"require_all"`
	GroupMatch []string `yaml:"groups"`
	NameMatch  []string `yaml:"names"`
}

func (ForComponent) MatchComponent

func (lm ForComponent) MatchComponent(component models.Component) bool

func (ForComponent) MatchComponents

func (lm ForComponent) MatchComponents(components models.Components) bool

type Log

type Log struct {
	Level   string `yaml:"level"`
	NoColor bool   `yaml:"no_color"`
	InJson  bool   `yaml:"in_json"`
}

func (*Log) Validate added in v1.32.0

func (c *Log) Validate() error

type Notifier

type Notifier struct {
	For    ForComponent           `yaml:"for"`
	Type   string                 `yaml:"type"`
	Params map[string]interface{} `yaml:"params"`
}

type Target added in v1.32.0

type Target string

func (Target) Validate added in v1.32.0

func (t Target) Validate() (*url.URL, error)

type Targets added in v1.32.0

type Targets []Target

func (Targets) Validate added in v1.32.0

func (t Targets) Validate() error

type Theme

type Theme struct {
	PreStatus  string `yaml:"pre_status"`
	PostStatus string `yaml:"post_status"`

	PreTimeline  string `yaml:"pre_timeline"`
	PostTimeline string `yaml:"post_timeline"`

	PreMaintenance  string `yaml:"pre_maintenance"`
	PostMaintenance string `yaml:"post_maintenance"`

	PersistentDisplayName string `yaml:"persistent_display_name"`
	PrePersistent         string `yaml:"pre_persistent"`
	PostPersistent        string `yaml:"post_persistent"`

	Footer string `yaml:"footer"`
}

func (*Theme) Validate added in v1.32.0

func (t *Theme) Validate() error

Jump to

Keyboard shortcuts

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