bingbot

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 (
	DownloadURL = "https://www.bing.com/toolbox/bingbot.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bingbot

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

func New

func New() Bingbot

func (*Bingbot) Fetch

func (bb *Bingbot) Fetch() (doc Doc, err error)

func (*Bingbot) FetchData

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

type Doc

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

func ProcessData

func ProcessData(data []byte) (doc Doc, 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"`
	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