config

package
v0.12.9 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config provides the definition of Config and a method to parse it from a []byte

Index

Constants

This section is empty.

Variables

View Source
var CfgViper *viper.Viper

CfgViper is the instance of config

Functions

This section is empty.

Types

type Config

type Config struct {
	// Interval between pollings in manager
	Interval int
	// LogLevel: 0-5 is acceptable
	LogLevel log.Level
	// ConcurrentLimit: how many worker can run at the same time
	ConcurrentLimit int `mapstructure:"concurrent_limit"`
	// LogStashConfig represents configurations for logstash
	LogStashConfig LogStashConfig `mapstructure:"logstash"`
	// ExporterAddr is the address to expose metrics, :8080 for default
	ExporterAddr string `mapstructure:"exporter_address"`
	// JsonAPIConfig specifies configuration of JSON restful API
	JsonAPIConfig JsonAPIConfig `mapstructure:"json_api"`
	// Worker sync checkpoint path
	Checkpoint string `mapstructure:"checkpoint"`
	// Config for each repo is represented as an array of RepoConfig. Nested structure is disallowed
	Repos []RepoConfig
	// A dummy section that will not be used in our program.
	Dummy interface{} `mapstructure:"dummy"`
}

Config stores all configuration of lug

func (*Config) Parse

func (c *Config) Parse(in io.Reader) (err error)

Parse creates config from a reader

type JsonAPIConfig

type JsonAPIConfig struct {
	// The address that lug listens for JSON API
	Address string
}

type LogStashConfig

type LogStashConfig struct {
	Address          string
	AdditionalFields map[string]interface{} `mapstructure:"additional_fields"`
}

type RepoConfig

type RepoConfig map[string]interface{}

RepoConfig stores config of each repo in a map

Jump to

Keyboard shortcuts

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