Versions in this module Expand all Collapse all v1 v1.0.3 May 27, 2026 Changes in this version + type ASNRule struct + Match int + Weight *int + type CIDRRule struct + Match string + Weight *int + type Config struct + Defaults Defaults + Providers []Provider + Version int + type Defaults struct + MinScore int + RuleWeight int type Detector + func NewFromConfig(cfg Config, opts ...Option) (*Detector, error) + type Provider struct + Category Category + Enabled *bool + ID string + Name string + Rules Rules + type Rules struct + ASN []ASNRule + ASNMail []StringRule + ASNName []StringRule + Netmail []StringRule + Netname []StringRule + NetworkURLs []URLSource + Networks []CIDRRule + PTR []StringRule + type StringRule struct + Match string + Weight *int + type URLSource struct + Format string + Timeout int + URL string + UpdateInterval int + Weight *int v1.0.2 May 27, 2026 v1.0.1 May 27, 2026 Changes in this version + type Category string + const CategoryBot + const CategoryCDN + const CategoryCloud + const CategoryHosting + const CategoryISP + const CategoryOther + type Detector struct + func New(opts ...Option) (*Detector, error) + func NewFromFile(path string, opts ...Option) (*Detector, error) + func NewFromJSON(r io.Reader, opts ...Option) (*Detector, error) + func (d *Detector) Close() error + func (d *Detector) Identify(input Input) Result + func (d *Detector) IdentifyAll(input Input) []Result + func (d *Detector) Ready(ctx context.Context) error + func (d *Detector) Start(ctx context.Context) error + type FileCache struct + func NewFileCache(dir string) *FileCache + func (c *FileCache) Load(key string) ([]byte, time.Time, error) + func (c *FileCache) Store(key string, data []byte) error + type Input struct + ASN *int + ASNMail string + ASNName string + IP net.IP + Netmail string + Netname string + PTR string + type Match struct + Field string + Pattern string + Weight int + type NetworkCache interface + Load func(key string) (data []byte, updated time.Time, err error) + Store func(key string, data []byte) error + type Option func(*options) + func WithCache(c NetworkCache) Option + func WithCacheDir(dir string) Option + func WithHTTPClient(c *http.Client) Option + func WithLogger(l *slog.Logger) Option + type Result struct + Category Category + Matches []Match + Name string + OK bool + ProviderID string + Score int