config

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONDecode added in v0.6.0

func JSONDecode(j io.Reader, target any) error

func LoadYAML

func LoadYAML(fname string, config *Config) error

func MarshalYAML

func MarshalYAML(config *Config) ([]byte, error)

func NewMapstructureDecoder

func NewMapstructureDecoder(target any) (*mapstructure.Decoder, error)

Types

type Config

type Config struct {
	Seed            uint64          `mapstructure:"seed" yaml:"seed" json:"seed"`
	WallclockStart  time.Time       `mapstructure:"wallclockStart" yaml:"wallclockStart" json:"wallclockStart"`
	Duration        time.Duration   `mapstructure:"duration" yaml:"duration" json:"duration"`
	Dryrun          bool            `mapstructure:"dryrun" yaml:"dryrun" json:"dryrun"`
	OTLPDestination OTLPDestination `mapstructure:"otlpDestination" yaml:"otlpDestination" json:"otlpDestination"`
}

func DefaultConfig added in v0.5.0

func DefaultConfig() *Config

func LoadConfigs

func LoadConfigs(fnames []string) (*Config, error)

type Duration

type Duration struct {
	time.Duration
}

func DurationFromDuration added in v0.6.0

func DurationFromDuration(d time.Duration) Duration

func (*Duration) Get

func (d *Duration) Get() time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type OTLPDestination

type OTLPDestination struct {
	Endpoint string            `mapstructure:"endpoint" yaml:"endpoint" json:"endpoint"`
	Headers  map[string]string `mapstructure:"headers" yaml:"headers" json:"headers"`
	Timeout  time.Duration     `mapstructure:"timeout" yaml:"timeout" json:"timeout"`
}

Jump to

Keyboard shortcuts

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