Documentation ¶
Index ¶
Constants ¶
View Source
const ( AppName = "ipscout" DefaultIndentSpaces = 2 DefaultMaxReports = 5 DefaultConfigFileName = "config.yaml" )
Variables ¶
View Source
var DefaultConfig string
Functions ¶
func CreateConfigPathStructure ¶
CreateConfigPathStructure creates all the necessary paths under session root if they don't exist and returns an error if it fails to create the directory, or the session root does not exist
func CreateDefaultConfigIfMissing ¶
CreateDefaultConfigIfMissing creates a default session configuration file if it does not exist and returns true if it was created, or false if it already exists
func GetConfigRoot ¶
GetConfigRoot returns the root path for the app's session directory if root is specified, it will use that, otherwise it will use the user's home directory
Types ¶
type Config ¶
type Config struct {
Global GlobalConfig `mapstructure:"global"`
}
type GlobalConfig ¶
type GlobalConfig struct { LogLevel string `mapstructure:"log-level"` Output string `mapstructure:"output"` IndentSpaces int `mapstructure:"indent-spaces"` Ports []string `mapstructure:"ports"` MaxValueChars int32 `mapstructure:"max-value-chars"` MaxAge string `mapstructure:"max-age"` MaxReports int `mapstructure:"max-reports"` DisableCache bool `mapstructure:"disable-cache"` Style string `mapstructure:"style"` InitialiseCacheOnly bool }
type Providers ¶
type Providers struct { AbuseIPDB struct { APIKey string Enabled *bool `mapstructure:"enabled"` ResultCacheTTL int64 `mapstructure:"result_cache_ttl"` MaxAge int `mapstructure:"max-age"` } `mapstructure:"abuseipdb"` Annotated struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` Paths []string `mapstructure:"paths"` } `mapstructure:"annotated"` AWS struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string `mapstructure:"url"` } `mapstructure:"aws"` Azure struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string `mapstructure:"url"` } `mapstructure:"azure"` Bingbot struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string `mapstructure:"url"` } `mapstructure:"bingbot"` CriminalIP struct { APIKey string ResultCacheTTL int64 `mapstructure:"result_cache_ttl"` Enabled *bool `mapstructure:"enabled"` } `mapstructure:"criminalip"` DigitalOcean struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string } `mapstructure:"digitalocean"` GCP struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string } `mapstructure:"gcp"` Google struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string } `mapstructure:"google"` Googlebot struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string } `mapstructure:"googlebot"` ICloudPR struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string `mapstructure:"url"` } `mapstructure:"icloudpr"` IPAPI struct { APIKey string Enabled *bool `mapstructure:"enabled"` ResultCacheTTL int64 `mapstructure:"result_cache_ttl"` } `mapstructure:"ipapi"` IPURL struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URLs []string `mapstructure:"urls"` } `mapstructure:"ipurl"` Linode struct { Enabled *bool `mapstructure:"enabled"` DocumentCacheTTL int64 `mapstructure:"document_cache_ttl"` URL string } `mapstructure:"linode"` Shodan struct { APIKey string ResultCacheTTL int64 `mapstructure:"result_cache_ttl"` Enabled *bool `mapstructure:"enabled"` } `mapstructure:"shodan"` PTR struct { Enabled *bool `mapstructure:"enabled"` ResultCacheTTL int64 `mapstructure:"result_cache_ttl"` Nameservers []string `mapstructure:"nameservers"` } `mapstructure:"ptr"` VirusTotal struct { APIKey string ResultCacheTTL int64 `mapstructure:"result_cache_ttl"` ShowProviders *bool `mapstructure:"show_providers"` ShowUnrated *bool `mapstructure:"show_unrated"` ShowHarmless *bool `mapstructure:"show_harmless"` ShowClean *bool `mapstructure:"show_clean"` Enabled *bool `mapstructure:"enabled"` } `mapstructure:"virustotal"` }
type Session ¶
type Session struct { App struct { Version string SemVer string } Logger *slog.Logger Stats *Stats Target *os.File Output string Messages *Messages Cache *badger.DB Config Config HTTPClient *retryablehttp.Client Host netip.Addr Providers Providers `mapstructure:"providers"` HideProgress bool `mapstructure:"hide-progress"` UseTestData bool }
Click to show internal directories.
Click to hide internal directories.