config

package
v0.0.0-...-8af18d5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Production bool   `yaml:"production"`
	ListenAddr string `yaml:"listen_addr"`
}

func GetConfigApplication

func GetConfigApplication() Application

GetConfigApplication @autowire(set=config)

type Auth

type Auth struct {
	Enabled         bool   `yaml:"enabled"`
	Username        string `yaml:"username"`
	Password        string `yaml:"password"`
	KbnVersion      string `yaml:"kbn_version"`
	AccessKeyID     string `yaml:"access_key_id"`
	AccessKeySecret string `yaml:"access_key_secret"`
	Cookie          string `yaml:"cookie"`
}

type Backend

type Backend struct {
	Name           string                  `yaml:"name"`
	Enabled        bool                    `yaml:"enabled"`
	Type           string                  `yaml:"type"`
	Addr           string                  `yaml:"addr"`
	Auth           Auth                    `yaml:"auth"`
	Timeout        int64                   `yaml:"timeout"`          // 请求超时时间(毫秒)
	MultiSearch    map[string]MultiSearch  `yaml:"multi_search"`     // 多索引/日志存储查询
	BuildInQueries map[string]BuildInQuery `yaml:"build_in_queries"` // 内置的快捷查询
	TimeField      map[string]string       `yaml:"time_field"`       // 时间排序字段,ES默认为@timestamp。
	Timezone       map[string]string       `yaml:"timezone"`         // 时区
	DefaultFields  map[string][]string     `yaml:"default_fields"`   // 默认查询字段
	SortFields     map[string][]SortField  `yaml:"sort_fields"`      // 字段排序
	ParserLogType  string                  `yaml:"parser_log_type"`  // 日志类型解析器
	ParserFields   ParserFields            `yaml:"parser_fields"`    // 字段解析器
}

func (*Backend) Default

func (s *Backend) Default()

type BackendList

type BackendList []Backend

func GetConfigBackendList

func GetConfigBackendList() BackendList

GetConfigBackendList @autowire(set=config)

func (*BackendList) Default

func (s *BackendList) Default()

func (*BackendList) Match

func (s *BackendList) Match(name string) Backend

type BuildInQuery

type BuildInQuery struct {
	Must    BuildInQueryEntrySlice `yaml:"must"`
	MustNot BuildInQueryEntrySlice `yaml:"must_not"`
	Or      BuildInQueryEntrySlice `yaml:"or"`
}

type BuildInQueryEntry

type BuildInQueryEntry struct {
	Name     string        `yaml:"name"`
	Field    string        `yaml:"field"`
	Values   []interface{} `yaml:"values"`
	Operator string        `yaml:"operator"`
	Always   bool          `yaml:"always"`
}

type BuildInQueryEntrySlice

type BuildInQueryEntrySlice []BuildInQueryEntry

func (*BuildInQueryEntrySlice) FieldConditions

func (s *BuildInQueryEntrySlice) FieldConditions(fn func(field string, conditions []string) bool)

type Config

type Config struct {
	Application Application `yaml:"application"`
	QQWry       QQWry       `yaml:"qq_wry"`
	BackendList BackendList `yaml:"backend_list"`
}

func GetConfig

func GetConfig() Config

type Loader

type Loader interface {
	Load(config LoaderConfig, dst *Config) (err error)
}
var (
	DefaultLoader Loader = &localFileLoader{}
)

type LoaderConfig

type LoaderConfig struct {
	LocalPath string `yaml:"local_path"`
	LocalFile string `yaml:"local_file"`
}

type MultiSearch

type MultiSearch struct {
	Name      string   `yaml:"name"`
	Order     int      `yaml:"order"`
	IndexList []string `yaml:"index_list"`
}

type MultiSearchSlice

type MultiSearchSlice []MultiSearch

func (MultiSearchSlice) Len

func (s MultiSearchSlice) Len() int

func (MultiSearchSlice) Less

func (s MultiSearchSlice) Less(i, j int) bool

func (MultiSearchSlice) Swap

func (s MultiSearchSlice) Swap(i, j int)

type ParserField

type ParserField struct {
	Name       string   `yaml:"name"`
	Type       string   `yaml:"type"`
	FromFields []string `yaml:"from_field"`
	ToField    string   `yaml:"to_field"`
	TrimSet    string   `yaml:"trim_set"`
	LuaField   string   `yaml:"lua_field"`
	LuaReturn  string   `yaml:"lua_return"`
}

func (*ParserField) Default

func (s *ParserField) Default()

type ParserFields

type ParserFields struct {
	AccessLog []ParserField `yaml:"access_log"`
	JsonLog   []ParserField `yaml:"json_log"`
	StringLog []ParserField `yaml:"string_log"`
}

func (*ParserFields) Default

func (s *ParserFields) Default()

type QQWry

type QQWry struct {
	IPv4FilePath string `yaml:"ipv4_file_path"`
	IPv4Data     []byte `yaml:"-"`
	IPv6FilePath string `yaml:"ipv6_file_path"`
	IPv6Data     []byte `yaml:"-"`
}

func GetConfigQQWry

func GetConfigQQWry() QQWry

GetConfigQQWry @autowire(set=config)

type SortField

type SortField struct {
	Field     string `yaml:"field"`
	Ascending bool   `yaml:"ascending"`
}

Jump to

Keyboard shortcuts

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