cdnValidator

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = fmt.Errorf("this IP is not in our known CDN list")
	ErrCanStealIP     = fmt.Errorf("this domain's setting can steal your IP information")
	ErrFailedValidate = fmt.Errorf("failed to validate")
)

Functions

func Register

func Register(name string, creator Creator, cidrs []*net.IPNet)

func Validate

func Validate(ctx context.Context, domain string, token string) (cdnName string, err error)

Types

type CDNValidator

type CDNValidator interface {
	Validate(ctx context.Context, domain string) (bool, error)
}

type Creator

type Creator func(token string) (CDNValidator, error)

func CreatorByIP

func CreatorByIP(ip net.IP) (string, Creator)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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