cfaddrs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cfaddrs provides a list of Cloudflare's IP addresses, a function to check if an IP address is in a list of netip.Prefix, and a function to parse a list of CIDR strings into a list of netip.Prefix.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSourceAddr

func CheckSourceAddr(ip netip.Addr, prefixes ...netip.Prefix) bool

CheckSourceAddr checks if the given IP address is in the given list of prefixes.

func CloudflareAddresses added in v0.0.2

func CloudflareAddresses() []netip.Prefix

CloudflareAddresses returns a list of both IPv4 and IPv6 prefixes that are used by Cloudflare.

func CloudflareIPv4 added in v0.0.2

func CloudflareIPv4() []netip.Prefix

CloudflareIPv4 returns a list of IPv4 prefixes that are used by Cloudflare.

func CloudflareIPv6 added in v0.0.2

func CloudflareIPv6() []netip.Prefix

CloudflareIPv6 returns a list of IPv6 prefixes that are used by Cloudflare.

func ParsePrefixes

func ParsePrefixes(cidrs []string) []netip.Prefix

ParsePrefixes parses a list of CIDR strings into a list of netip.Prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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