config

package
v0.0.0-...-8790277 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefault

func SetDefault(ptr interface{}) error

Set initializes members in a struct referenced by a pointer. Maps and slices are initialized by `make` and other primitive types are set with default values. `ptr` should be a struct pointer

Types

type Config

type Config struct {
	ProfileConfig ProfileConfig `yaml:"profile"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Load

func (c *Config) Load(path string)

func (*Config) Validate

func (c *Config) Validate() error

type ProfileConfig

type ProfileConfig struct {
	LogFile         string  `default:"/var/log/profile.log" yaml:"log-file"`
	LogLevel        string  `default:"info" yaml:"log-level"`
	ListenPort      int     `default:"20419" yaml:"listen-port"`
	FlameQueryLimit int     `default:"1000000" yaml:"flame_query_limit"`
	Querier         Querier `yaml:"querier"`
}
var Cfg *ProfileConfig

type Querier

type Querier struct {
	Host string `default:"127.0.0.1" yaml:"host"`
	Port int    `default:"20416" yaml:"port"`
}

type Setter

type Setter interface {
	SetDefaults()
}

Setter is an interface for setting default values

Jump to

Keyboard shortcuts

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