config

package
v0.0.0-...-b183826 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Servers []ServerConfig `yaml:"servers" json:"servers"`
}

func DecodeConfig

func DecodeConfig(data []byte) (*Config, error)

func Load

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

func (*Config) Encode

func (c *Config) Encode() ([]byte, error)

type MonitorConfig

type MonitorConfig struct {
	Threshold                      float64 `yaml:"threshold" json:"threshold"`
	MaxSampleSize                  int     `yaml:"maxSampleSize" json:"maxSampleSize"`
	MinStdDeviationMillis          float64 `yaml:"minStdDeviationMillis" json:"minStdDeviationMillis"`
	AcceptableHeartbeatPauseMillis int64   `yaml:"acceptableHeartbeatPauseMillis" json:"acceptableHeartbeatPauseMillis"`
	FirstHeartbeatEstimateMillis   int64   `yaml:"firstHeartbeatEstimateMillis" json:"firstHeartbeatEstimateMillis"`
}

type ServerConfig

type ServerConfig struct {
	Name    string        `yaml:"name" json:"name"`
	URL     string        `yaml:"url" json:"url"`
	Monitor MonitorConfig `yaml:"monitor" json:"monitor"`
}

func DecodeServerConfig

func DecodeServerConfig(data []byte) (*ServerConfig, error)

func (*ServerConfig) Encode

func (s *ServerConfig) Encode() ([]byte, error)

func (*ServerConfig) UnmarshalYAML

func (s *ServerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for ServerConfig

Jump to

Keyboard shortcuts

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