config

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{}
View Source
var DefaultGlobal = Global{
	SDSyncTime:  model.Duration(10 * time.Second),
	DataDir:     "data",
	AnsibleTOFU: true,
	AnsibleUser: "ansible",
	EnableARA:   true,
	ARAListen:   "127.0.0.1:8089",
}

Functions

func JoinDir

func JoinDir(directory, relPath string) string

Types

type Config

type Config struct {
	Global       Global        `yaml:"global"`
	TargetGroups []TargetGroup `yaml:"target_groups"`
}

func LoadFile

func LoadFile(filePath string) (*Config, error)

func (*Config) SetDirectory

func (c *Config) SetDirectory(directory string)

type Global

type Global struct {
	AnsibleSSHKeyPath         string         `yaml:"ansible_ssh_key_path"`
	AnsibleBecomePasswordFile string         `yaml:"ansible_become_password_file"`
	AnsibleUser               string         `yaml:"ansible_user"`
	SDSyncTime                model.Duration `yaml:"sd_sync_time"`
	DataDir                   string         `yaml:"data_directory"`
	AnsibleTOFU               bool           `yaml:"ansible_trust_on_firs_use"`
	EnableARA                 bool           `yaml:"enable_ara"`
	ARAListen                 string         `yaml:"ara_listen_address"`
}

func (*Global) SetDirectory

func (g *Global) SetDirectory(directory string)

func (*Global) UnmarshalYAML

func (g *Global) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Modules

type Modules struct {
	ModulesConfigs modules.Configs `yaml:"-"`
}

func (*Modules) UnmarshalYAML

func (m *Modules) UnmarshalYAML(unmarshal func(interface{}) error) error

type TargetGroup

type TargetGroup struct {
	Name    string   `yaml:"name"`
	Modules *Modules `yaml:"modules"`
	Targets *Targets `yaml:"targets"`
}

func (*TargetGroup) SetDirectory

func (t *TargetGroup) SetDirectory(directory string)

type Targets

type Targets struct {
	ServiceDiscoveryConfigs discovery.Configs `yaml:"-"`
	RelabelConfigs          []*relabel.Config `yaml:"relabel_configs,omitempty"`
}

func (*Targets) SetDirectory

func (t *Targets) SetDirectory(directory string)

func (*Targets) UnmarshalYAML

func (t *Targets) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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