cloudflare

package
v0.0.0-...-6ac2e72 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShortName      = "cloudflare"
	FullName       = "Cloudflare"
	HostType       = "cdn"
	SourceURL      = "https://www.cloudflare.com/en-gb/ips/"
	DefaultIPv4URL = "https://www.cloudflare.com/ips-v4"
	DefaultIPv6URL = "https://www.cloudflare.com/ips-v6"
)

Variables

This section is empty.

Functions

func ProcessData

func ProcessData(data []byte) (prefixes []netip.Prefix, err error)

Types

type Cloudflare

type Cloudflare struct {
	Client          *retryablehttp.Client
	IPv4DownloadURL string
	IPv6DownloadURL string
}

func New

func New() Cloudflare

func (*Cloudflare) Fetch

func (cf *Cloudflare) Fetch() (prefixes []netip.Prefix, err error)

func (*Cloudflare) Fetch4

func (cf *Cloudflare) Fetch4() (prefixes []netip.Prefix, err error)

func (*Cloudflare) Fetch6

func (cf *Cloudflare) Fetch6() (prefixes []netip.Prefix, err error)

func (*Cloudflare) FetchIPv4Data

func (cf *Cloudflare) FetchIPv4Data() (data []byte, headers http.Header, status int, err error)

func (*Cloudflare) FetchIPv6Data

func (cf *Cloudflare) FetchIPv6Data() (data []byte, headers http.Header, status int, err error)

Jump to

Keyboard shortcuts

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