config

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: GPL-3.0 Imports: 7 Imported by: 3 modules, 36 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLog

func InitLog(level int, logtype string) (*log.Logger, error)

* Name: InitLog * Purpose: Initializes logging utilities * comments:

Types

type BlacklistedCfg

type BlacklistedCfg struct {
	ThreadCount    int    `yaml:"ThreadCount"`
	ChannelSize    int    `yaml:"ChannelSize"`
	BlacklistTable string `yaml:"BlackListTable"`
}

type BroCfg

type BroCfg struct {
	LogPath      string            `yaml:"LogPath"`
	DBPrefix     string            `yaml:"DBPrefix"`
	MetaDB       string            `yaml:"MetaDB"`
	BufferSize   int               `yaml:"BufferSize"`
	WriteThreads int               `yaml:"WriteThreads"`
	DirectoryMap map[string]string `yaml:"DirectoryMap"`
	FilesTable   string            `yaml:"FilesTable"`
	UseDates     bool              `yaml:"UseDates"`
}

type DnsCfg

type DnsCfg struct {
	DnsTable string `yaml:"DnsTable"`
}

type DurationCfg

type DurationCfg struct {
	DurationTimeScale string `yaml:"DurationTimeScale"`
}

type Resources

type Resources struct {
	System  SystemConfig
	Session *mgo.Session
	Log     *log.Logger
}

Resources provides a data structure for passing system Resources

func InitConfig

func InitConfig(cfgPath string) *Resources

InitCofnig grabs the configuration file and intitializes the configuration data returnign a *Resources object which has all of the necessary configuration information

func (*Resources) CopySession

func (r *Resources) CopySession() *mgo.Session

CopySession allows systems to copy the resources session. Necessary for threading.

type ScanningCfg

type ScanningCfg struct {
	ScanThreshold int    `yaml:"ScanThreshold"`
	ScanTable     string `yaml:"ScanTable"`
}

type StructureCfg

type StructureCfg struct {
	ConnTable       string `yaml:"ConnectionTable"`
	HttpTable       string `yaml:"HttpTable"`
	UniqueConnTable string `yaml:"UniqueConnectionTable"`
	HostTable       string `yaml:"HostTable"`
}

type SystemConfig

type SystemConfig struct {
	LogType                 string         `yaml:"LogType"`
	GNUNetcatPath           string         `yaml:"GNUNetcatPath"`
	BaseInstallDirectory    string         `yaml:"BaseInstallDirectory"`
	BatchSize               int            `yaml:"BatchSize"`
	DB                      string         `yaml:"Database"`
	HostIntelDB             string         `yaml:"HostIntelDB"`
	ExternalHostsCollection string         `yaml:"ExternalHostsCollection"`
	DatabaseHost            string         `yaml:"DatabaseHost"`
	LogLevel                int            `yaml:"LogLevel"`
	Prefetch                float64        `yaml:"Prefetch"`
	Whitelist               []string       `yaml:"WhiteList"`
	BlacklistedConfig       BlacklistedCfg `yaml:"BlackListed"`
	DnsConfig               DnsCfg         `yaml:"Dns"`
	DurationConfig          DurationCfg    `yaml:"Duration"`
	ScanningConfig          ScanningCfg    `yaml:"Scanning"`
	StructureConfig         StructureCfg   `yaml:"Structure"`
	TBDConfig               TBDCfg         `yaml:"TBD"`
	UrlsConfig              UrlsCfg        `yaml:"Urls"`
	UserAgentConfig         UserAgentCfg   `yaml:"UserAgent"`
	BroConfig               BroCfg         `yaml:"Bro"`
}

func GetConfig

func GetConfig(cfgPath string) (SystemConfig, bool)

GetConfig retrieves a configuration in order of precedence

func LoadSystemConfig

func LoadSystemConfig(cfgPath string) (SystemConfig, bool)

LoadSystemConfig attempts to parse a config file

type TBDCfg

type TBDCfg struct {
	DefaultBucketSize       float64 `yaml:"DefaultBucketSize"`
	DefaultConnectionThresh int     `yaml:"DefaultConnectionThresh"`
	TBDTable                string  `yaml:"TBDTable"`
}

type UrlsCfg

type UrlsCfg struct {
	UrlsTable      string `yaml:"UrlsTable"`
	HostnamesTable string `yaml:"HostnamesTable"`
}

type UserAgentCfg

type UserAgentCfg struct {
	UserAgentTable string `yaml:"UserAgentTable"`
}

Jump to

Keyboard shortcuts

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