config

package
v0.0.0-...-77a304a Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server *ServerConfig `validate:"required"`
	Tracer *TracerConfig `validate:"required"`
}

Config is root of toml config

func New

func New(file string) (*Config, error)

New is for creating config instance

type ServerConfig

type ServerConfig struct {
	Port int `toml:"port" validate:"required"`
}

ServerConfig is for server information

type TracerConfig

type TracerConfig struct {
	Type    string              `toml:"type" validate:"required"`
	Jaeger  *TracerDetailConfig `toml:"jaeger"`
	Datadog *TracerDetailConfig `toml:"datadog"`
}

TracerConfig is for tracer information

type TracerDetailConfig

type TracerDetailConfig struct {
	ServiceName       string  `toml:"service_name" validate:"required"`
	CollectorEndpoint string  `toml:"collector_endpoint" validate:"required"`
	Sampling          float64 `toml:"sampling_probability" validate:"required"`
}

TracerDetailConfig is detail of tracer

Jump to

Keyboard shortcuts

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