config

package
v0.0.0-...-885f6a1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FilePath string

The config file path used by Load config

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel           int8                   `json:"log_level"      yaml:"log_level"      env:"LOG_LEVEL" validate:"gte=1,lte=5"`
	JobWorks           int32                  `json:"job_works"      yaml:"job_works"      env:"JOB_WORKS" validate:"gte=1,lte=1000"`
	JobDeveloperServer *grpcwrap.ClientConfig `json:"jobdeveloper_server"      yaml:"jobdeveloper_server"      env:"JOBDEVELOPER_SERVER" validate:"required"`
	PickupAloneJobs    int32                  `json:"pickup_alone_jobs"      yaml:"pickup_alone_jobs"      env:"PICKUP_ALONE_JOBS" validate:"gte=0,lte=1"`
	GRPCServer         *grpcwrap.ServerConfig `json:"grpc_server"    yaml:"grpc_server"    env:"GRPC_SERVER"         validate:"required"`
	MetricsServer      *metrics.Config        `json:"metrics_server" yaml:"metrics_server" env:"METRICS_SERVER"      validate:"required"`
	MySQL              *gormwrap.MySQLConfig  `json:"mysql"          yaml:"mysql"          env:"MYSQL"               validate:"required"`
	Tracer             *gtrace.Config         `json:"tracer"         yaml:"tracer"         env:"TRACER"              validate:"required"`
}

func Load

func Load() (cfg *Config, err error)

LoadConfig load all configuration from specified file Must be set `FilePath` before called

Jump to

Keyboard shortcuts

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