config

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 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 {
	TraceMapConfig TraceMapConfig `yaml:"trace-map"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Load

func (c *Config) Load(path string)

func (*Config) Validate

func (c *Config) Validate() error

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

type TraceMapConfig

type TraceMapConfig struct {
	MaxTracePerIteration   uint64  `default:"100000" yaml:"max_trace_per_iteration"`
	BatchTracesCountMax    uint64  `default:"1000" yaml:"batch_traces_count_max"`
	TraceIdQueryIterations uint64  `default:"8" yaml:"trace_id_query_iterations"`
	TraceQueryDelta        uint64  `default:"300" yaml:"trace_query_delta"`
	WriteInterval          int     `default:"60" yaml:"write_interval"`
	WriteBatchSize         int     `default:"1000" yaml:"write_batch_size"`
	Querier                Querier `yaml:"querier"`
	DebugSqlLenMax         int     `default:"1000" yaml:"debug_sql_len_max"`
}
var Cfg *TraceMapConfig

Jump to

Keyboard shortcuts

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