config

package
v0.0.0-...-e6503be Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROLE_WORKER = "worker"
	ROLE_API    = "api"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	BaseURL string `mapstructure:"base-url"`
	ApiKey  string `mapstructure:"api-key"`
	Timeout int    `mapstructure:"timeout"`
}

type Config

type Config struct {
	Role         string       `mapstructure:"role"`
	DataCenter   string       `mapstructure:"datacenter"`
	Environment  string       `mapstructure:"environment"`
	PublicHTTP   HTTPConfig   `mapstructure:"public-http"`
	Log          LogConfig    `mapstructure:"log"`
	PDNS         PDNSConfig   `mapstructure:"pdns"`
	Consul       ConsulConfig `mapstructure:"consul"`
	LDAP         LDAPConfig   `mapstructure:"ldap"`
	InternalHTTP HTTPConfig   `mapstructure:"internal-http"`
	Version      string
	Build        string
}

func Init

func Init(version, build string) (*Config, error)

type ConsulConfig

type ConsulConfig struct {
	Address string `mastructure:"address"`
}

type HTTPConfig

type HTTPConfig struct {
	Address string            `mapstructure:"listen-address"`
	Port    string            `mapstructure:"listen-port"`
	Timeout HTTPTimeoutConfig `mapstructure:"timeout"`
}

type HTTPTimeoutConfig

type HTTPTimeoutConfig struct {
	Read  int `mapstructure:"read"`
	Write int `mapstructure:"write"`
}

type LDAPConfig

type LDAPConfig struct {
	Enabled      bool   `mapstructure:"enabled"`
	URL          string `mapstructure:"url"`
	User         string `mapstructure:"user"`
	Password     string `mapstructure:"password"`
	BaseDN       string `mapstructure:"base-dn"`
	SearchBase   string `mapstructure:"search-base"`
	SearchFilter string `mapstructure:"search-filter"`
	Debug        bool   `mapstructure:"debug"`
}

LDAPConfig represents LDAP settings in config

type LogConfig

type LogConfig struct {
	Level string `mapstructure:"level"`
	File  string `mapstructure:"file"`
}

type PDNSConfig

type PDNSConfig struct {
	RecursorConfig RecursorConfig `mapstructure:"recursor"`
	AuthConfig     AuthConfig     `mapstructure:"auth"`
}

type RecursorConfig

type RecursorConfig struct {
	BaseURL string `mapstructure:"base-url"`
	ApiKey  string `mapstructure:"api-key"`
	Timeout int    `mapstructure:"timeout"`
}

Jump to

Keyboard shortcuts

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