url

package
v0.195.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorValidator added in v0.140.0

type ErrorValidator struct{}

func (ErrorValidator) Validate added in v0.140.0

func (ErrorValidator) Validate(*url.URL) error

func (ErrorValidator) ValidateIP added in v0.140.0

func (ErrorValidator) ValidateIP(net.IP) error

type PassValidator

type PassValidator struct{}

PassValidator passes all URLs

func (PassValidator) Validate

func (PassValidator) Validate(*url.URL) error

func (PassValidator) ValidateIP added in v0.101.0

func (PassValidator) ValidateIP(net.IP) error

type PrivateIPValidator

type PrivateIPValidator struct{}

PrivateIPValidator validates that a url does not communicate with a private IP range

func (PrivateIPValidator) Validate

func (v PrivateIPValidator) Validate(u *url.URL) error

func (PrivateIPValidator) ValidateIP added in v0.101.0

func (PrivateIPValidator) ValidateIP(ip net.IP) error

type Validator

type Validator interface {
	Validate(*url.URL) error
	ValidateIP(net.IP) error
}

Validator reports whether a given URL is valid.

XXX: `sql.validateDataSource` bypasses this for BigQuery DSNs since they have no host information in them and therefore can't have their IP validated. If validation is refactored to later consider more than just IPs, give the `sql.validateDataSource` another look.

Jump to

Keyboard shortcuts

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