config

package
v0.0.0-...-81c6b1d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RunDir    string
	LogDir    string
	EtcDir    string
	BinDir    string
	UploadDir string
)
View Source
var (
	Version               string
	Home                  string
	Cfg                   *Yaml
	Language              string
	LogLevel              string
	Debug                 bool
	Geo2IP                string
	UaRegular             string
	CaptureNic            string
	CapturePcap           string
	BerkeleyPacketFilter  string
	IgnoreMissing         bool
	FollowOnlyOnlineUsers bool
	UseTTL                bool
	UseUA                 bool
	UseFeature            bool
	WebPort               uint
	Detach                bool
)
View Source
var YamlConfig []byte

Functions

func Reload

func Reload()

Types

type Capture

type Capture struct {
	OfflineFile string `mapstructure:"offline_file" bson:"offline_file" json:"offline_file"`
	NIC         string `mapstructure:"nic" bson:"nic" json:"nic"`
	SnapLen     int32  `mapstructure:"snap_len" bson:"snap_len" json:"snap_len"`
}

type License

type License struct {
	Sn         string
	CheckTime  time.Time
	ExpireTime time.Time
}

type Mongodb

type Mongodb struct {
	Host string `mapstructure:"host" bson:"host" json:"host"`
	Port string `mapstructure:"port" bson:"port" json:"port"`
}

type ProtocolFeature

type ProtocolFeature struct {
	Threshold int    `mapstructure:"threshold" bson:"threshold" json:"threshold"`
	Normal    string `mapstructure:"normal" bson:"normal" json:"normal"`
	Remark    string `mapstructure:"remark" bson:"remark" json:"remark"`
}

type Redis

type Redis struct {
	DPI    RedisConfig `mapstructure:"dpi" bson:"dpi" json:"dpi"`
	Online RedisConfig `mapstructure:"online" bson:"online" json:"online"`
	Cache  RedisConfig `mapstructure:"cache" bson:"cache" json:"cache"`
	Users  RedisConfig `mapstructure:"users" bson:"users" json:"users"`
}

type RedisConfig

type RedisConfig struct {
	Host     string `mapstructure:"host" bson:"host" json:"host"`
	Port     string `mapstructure:"port" bson:"port" json:"port"`
	Password string `mapstructure:"password" bson:"password" json:"password"`
	DB       int    `mapstructure:"db" bson:"db" json:"db"`
}

type Thresholds

type Thresholds struct {
	SNI         ProtocolFeature `mapstructure:"sni" bson:"sni" json:"sni"`
	HTTP        ProtocolFeature `mapstructure:"http" bson:"http" json:"http"`
	TLSVersion  ProtocolFeature `mapstructure:"tls_version" bson:"tls_version" json:"tls_version"`
	CipherSuite ProtocolFeature `mapstructure:"cipher_suite" bson:"cipher_suite" json:"cipher_suite"`
	Session     ProtocolFeature `mapstructure:"session" bson:"session" json:"session"`
	DNS         ProtocolFeature `mapstructure:"dns" bson:"dns" json:"dns"`
	QUIC        ProtocolFeature `mapstructure:"quic" bson:"quic" json:"quic"`
	SNMP        ProtocolFeature `mapstructure:"snmp" bson:"snmp" json:"snmp"`
}

type Web

type Web struct {
	Port uint `mapstructure:"port"`
}

type Yaml

type Yaml struct {
	MachineID             string     `mapstructure:"machine_id" binding:"machine_id" json:"machine_id"`
	Language              string     `mapstructure:"language" bson:"language" json:"language"`
	LogLevel              string     `mapstructure:"log_level" bson:"log_level" json:"log_level"`
	Debug                 bool       `mapstructure:"debug" bson:"debug" json:"debug"`
	Detach                bool       `mapstructure:"detach" bson:"detach" json:"detach"`
	Geo2IP                string     `mapstructure:"geo2ip" bson:"geo2ip" json:"geo2ip"`
	UaRegular             string     `mapstructure:"ua_regular" bson:"ua_regular" json:"ua_regular"`
	BerkeleyPacketFilter  string     `mapstructure:"berkeley_packet_filter" bson:"berkeley_packet_filter" json:"berkeley_packet_filter"`
	IgnoreMissing         bool       `mapstructure:"ignore_missing" bson:"ignore_missing" json:"ignore_missing"`
	FollowOnlyOnlineUsers bool       `mapstructure:"follow_only_online_users" bson:"follow_only_online_users" json:"follow_only_online_users"`
	UseTTL                bool       `mapstructure:"use_ttl" bson:"use_ttl" json:"use_ttl"`
	UseUA                 bool       `mapstructure:"use_ua" bson:"use_ua" json:"use_ua"`
	UseFeature            bool       `mapstructure:"use_feature" bson:"use_feature" json:"use_feature"`
	Capture               Capture    `mapstructure:"capture" bson:"capture" json:"capture"`
	Mongodb               Mongodb    `mapstructure:"mongodb" bson:"mongodb" json:"mongodb"`
	Redis                 Redis      `mapstructure:"redis" bson:"redis" json:"redis"`
	Web                   Web        `mapstructure:"web" bson:"web" json:"web"`
	IgnoreFeature         []string   `mapstructure:"ignore_feature" bson:"ignore_feature" json:"ignore_feature"`
	Thresholds            Thresholds `mapstructure:"thresholds" bson:"thresholds" json:"thresholds"`
	Username              string     `mapstructure:"username" bson:"username" json:"username"`
	Password              string     `mapstructure:"password" bson:"password" json:"password"`
	License               License    `mapstructure:"license" bson:"license" json:"license"`
}

Jump to

Keyboard shortcuts

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