Help us shape the future of Go! Take the 2026 Go Developer Survey

generate

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Categories

type Categories struct {
	// CDN contains a list of inputs for CDN cidrs
	CDN *Category `yaml:"cdn"`
	// WAF contains a list of inputs for WAF cidrs
	WAF *Category `yaml:"waf"`
	// Cloud contains a list of inputs for Cloud cidrs
	Cloud  *Category `yaml:"cloud"`
	Common *Category `yaml:"common"`
}

Categories contains various cdn, waf, cloud and fqdn operators

func (*Categories) Compile

func (c *Categories) Compile(options *Options) (*cdncheck.InputCompiled, error)

Compile returns the compiled form of an input structure.

Per-provider/per-source failures are accumulated and returned as a joined error. The compiled result is still returned alongside the error so callers can decide whether to use a partially populated dataset.

type Category

type Category struct {
	// URLs contains a list of static URLs for CIDR list
	URLs map[string][]string `yaml:"urls"`
	// ASN contains ASN numbers for an Input item
	ASN map[string][]string `yaml:"asn"`
	// CIDR contains a list of CIDRs for Input item
	//
	// CIDR is generated using generate-index tool which is then
	// used for checking the provided IP for each input type.
	CIDR map[string][]string `yaml:"cidr"`
	// FQDN contains public suffixes for major cloud operators
	FQDN map[string][]string `yaml:"fqdn"`
}

Category contains configuration for a specific category

type Options

type Options struct {
	IPInfoToken string
	HTTPClient  *http.Client
}

func (*Options) HasAuthInfo

func (options *Options) HasAuthInfo() bool

HasAuthInfo returns true if auth info has been provided

func (*Options) ParseFromEnv

func (options *Options) ParseFromEnv()

ParseFromEnv parses auth tokens from env or file

Jump to

Keyboard shortcuts

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