config

package
v0.0.0-...-eb0ee05 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 10 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"`
	GRPCServer    *grpcwrap.ServerConfig `json:"grpc_server"    yaml:"grpc_server"    env:"GRPC_SERVER"         validate:"required"`
	GRPCLog       *grpcwrap.LogConfig    `json:"grpc_log"       yaml:"grpc_log"       env:"GRPC_LOG"            validate:"required"`
	MetricsServer *metrics.Config        `json:"metrics_server" yaml:"metrics_server" env:"METRICS_SERVER"      validate:"required"`
	Tracer        *gtrace.Config         `json:"tracer"         yaml:"tracer"         env:"TRACER"              validate:"required"`
	HdfsServer    *HdfsConfig            `json:"hdfs_server"    yaml:"hdfs_server"    env:"HDFS_SERVER"         validate:"required"`
}

Config is the configuration settings for logmanager

func Load

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

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

type HdfsConfig

type HdfsConfig struct {
	// NameNode addresses
	Addresses  string `json:"addresses"    yaml:"addresses"    env:"ADDRESSES"     validate:"required"`
	UserName   string `json:"user_name"    yaml:"user_name"    env:"USER_NAME"     validate:"required"`
	BufferSize int32  `json:"buffer_size"  yaml:"buffer_size"  env:"BUFFER_SIZE"   validate:"required"`
}

Jump to

Keyboard shortcuts

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