config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowConfig added in v1.1.0

func ShowConfig(format string) error

Types

type Config

type Config struct {
	Env     string `yaml:"Env"`     // 环境:prod、dev
	BaseUrl string `yaml:"BaseUrl"` // base url
	Port    int    `yaml:"Port"`    // 端口
	LogPath string `yaml:"LogPath"` // 日志文件名

	LogConfig struct {
		LogFile    string `yaml:"LogFile"`    // 日志文件名
		MaxSize    int    `yaml:"MaxSize"`    // 日志文件大小限制,单位为 MB
		MaxBackups int    `yaml:"MaxBackups"` // 最大保留的旧日志文件数量
		MaxAge     int    `yaml:"MaxAge"`     // 旧日志文件保留天数
		Compress   bool   `yaml:"Compress"`   // 是否压缩旧日志文件
		LogLevel   string `yaml:"LogLevel"`   // 日志等级
		LogFormat  string `yaml:"LogFormat"`  // 日志等级
	} `yaml:"LogConfig"`

	ConsumerConfig struct {
		LogPath      string         `yaml:"LogPath"` // 日志输出路径
		NSQConsumers []NSQConsumers `yaml:"NSQConsumers"`
	} `yaml:"ConsumerConfig"`

	NSQConfig struct {
		AuthSecret  string `yaml:"AuthSecret"`  // 权限
		NSQDAddress string `yaml:"NSQDAddress"` // 地址
	} `yaml:"NSQConfig"`
}
var Instance *Config

func DefaultConfig

func DefaultConfig() *Config

func Init

func Init(filename string) *Config

type NSQConsumers added in v1.1.0

type NSQConsumers struct {
	Name     string `yaml:"Name"`
	Topic    string `yaml:"Topic"`
	FileName string `yaml:"FileName"`
}

Jump to

Keyboard shortcuts

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