googleutf

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShortName   = "googleutf"
	FullName    = "Google User-Triggered Fetchers"
	HostType    = "crawlers"
	SourceURL   = "https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot"
	DownloadURL = "https://developers.google.com/static/search/apis/ipranges/user-triggered-fetchers.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	CreationTime time.Time
	IPv4Prefixes []IPv4Entry
	IPv6Prefixes []IPv6Entry
}

func ProcessData

func ProcessData(data []byte) (doc Doc, err error)

type Googleutf

type Googleutf struct {
	Client      *retryablehttp.Client
	DownloadURL string
}

func New

func New() Googleutf

func (*Googleutf) Fetch

func (gu *Googleutf) Fetch() (doc Doc, err error)

func (*Googleutf) FetchData

func (gu *Googleutf) FetchData() (data []byte, headers http.Header, status int, err error)

type IPv4Entry

type IPv4Entry struct {
	IPv4Prefix netip.Prefix `json:"ipv4Prefix"`
}

type IPv6Entry

type IPv6Entry struct {
	IPv6Prefix netip.Prefix `json:"ipv6Prefix"`
}

type RawDoc

type RawDoc struct {
	CreationTime  string `json:"creationTime"`
	LastRequested time.Time
	Entries       []json.RawMessage `json:"prefixes"`
}

type RawIPv4Entry

type RawIPv4Entry struct {
	IPv4Prefix string `json:"ipv4Prefix"`
}

type RawIPv6Entry

type RawIPv6Entry struct {
	IPv6Prefix string `json:"ipv6Prefix"`
}

Jump to

Keyboard shortcuts

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