config

package
v0.0.0-...-0174093 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEnvVariableHookFunc

func ParseEnvVariableHookFunc() mapstructure.DecodeHookFunc

func ToDurationHookFunc

func ToDurationHookFunc() mapstructure.DecodeHookFunc

Types

type Config

type Config struct {
	System   SystemConfig   `json:"system" yaml:"system"`
	Services ServicesConfig `json:"services" yaml:"services"`
}

func FromEnv

func FromEnv(prefix string) (config Config, err error)

func FromFile

func FromFile(path string) (config Config, err error)

type DynamicConfig

type DynamicConfig map[string]any

func (DynamicConfig) Bind

func (config DynamicConfig) Bind(to any) error

func (DynamicConfig) Kind

func (config DynamicConfig) Kind() string

type ServicesConfig

type ServicesConfig struct {
	Scheduler  DynamicConfig `yaml:"scheduler"`
	Processor  DynamicConfig `yaml:"processor"`
	Discovery  DynamicConfig `yaml:"discovery"`
	HttpServer DynamicConfig `yaml:"http_api"`
	Status     DynamicConfig `yaml:"status"`
}

type SystemConfig

type SystemConfig struct {
	Tasks     DynamicConfig `json:"tasks" yaml:"tasks"`
	Resources DynamicConfig `json:"resources" yaml:"resources"`
	Events    DynamicConfig `json:"events" yaml:"events"`
}

Jump to

Keyboard shortcuts

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