config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Validate() bool
	Complete()
}

type DatabaseConfig

type DatabaseConfig struct {
	Address  string `mapstructure:"address"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

func (*DatabaseConfig) Complete

func (conf *DatabaseConfig) Complete()

func (*DatabaseConfig) DSN

func (dbConf *DatabaseConfig) DSN(dbName string) string

func (*DatabaseConfig) Validate

func (dbConf *DatabaseConfig) Validate() bool

type ExporterConfig

type ExporterConfig struct {
	ExporterTag string `mapstructure:"exporter_tag"` // 作为 exporter 当前的唯一 Tag(如果唯一性验证失败会 panic),同时通过路径组装生成日志文件路径扫描日志文件

	ReceiverServerAddr string `mapstructure:"receiver_server_addr"` // receiver 服务地址

	PollInterval int `mapstructure:"poll_interval"` // 自定义 export 时间间隔,单位为 1ms,默认为 100ms,不宜设置过小

	FileKeepingDays int `mapstructure:"file_keeping_days"` // 已上报的日志,保留多久后会被删除

	InitProgress protocol.ExporterProgress `mapstructure:"init_progress"`
}

func NewExporterConfig

func NewExporterConfig(confPath string) (*ExporterConfig, error)

func (*ExporterConfig) Complete

func (conf *ExporterConfig) Complete()

func (*ExporterConfig) Validate

func (conf *ExporterConfig) Validate() bool

type ReceiverConfig

type ReceiverConfig struct {
	MetaServerAddr        string         `mapstructure:"meta_server_addr"`         // meta 服务地址,各种元信息以 kv 的方式由 meta 服务管理
	MqServerAddr          string         `mapstructure:"mq_server_addr"`           // receiver 服务在接收到消息后将消息放到 mq 中
	ResolverMgrServerAddr string         `mapstructure:"resolver_mgr_server_addr"` // resolver mgr 提供 resolver 的调度接口
	DatabaseConfig        DatabaseConfig `mapstructure:"database_config"`          // master
}

func NewReceiverConfig

func NewReceiverConfig(confPath string) (*ReceiverConfig, error)

func (*ReceiverConfig) Complete

func (conf *ReceiverConfig) Complete()

func (*ReceiverConfig) Validate

func (conf *ReceiverConfig) Validate() bool

type ResolverConfig

type ResolverConfig struct {
	MetaServerAddr string         `mapstructure:"meta_server_addr"` // meta 服务地址
	MqServerAddr   string         `mapstructure:"mq_server_addr"`   // mq 服务地址
	DatabaseConfig DatabaseConfig `mapstructure:"database_config"`  // master
}

func (*ResolverConfig) Complete

func (conf *ResolverConfig) Complete()

func (*ResolverConfig) Validate

func (conf *ResolverConfig) Validate() bool

type ResolverMgrConfig

type ResolverMgrConfig struct {
	MetaServerAddr string         `mapstructure:"meta_server_addr"` // meta 服务地址
	ResolverConfig ResolverConfig `mapstructure:"resolver_config"`  // resolver 的配置
}

func NewResolverMgrConfig

func NewResolverMgrConfig(confPath string) (*ResolverMgrConfig, error)

func (*ResolverMgrConfig) Complete

func (conf *ResolverMgrConfig) Complete()

func (*ResolverMgrConfig) Validate

func (conf *ResolverMgrConfig) Validate() bool

Jump to

Keyboard shortcuts

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