gcp

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: 1

Documentation

Index

Constants

View Source
const (
	ShortName   = "gcp"
	FullName    = "Google Cloud Platform"
	HostType    = "cloud"
	SourceURL   = "https://cloud.google.com/compute/docs/faq#find_ip_range"
	DownloadURL = "https://www.gstatic.com/ipranges/cloud.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

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

func ProcessData

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

type GCP

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

func New

func New() GCP

func (*GCP) Fetch

func (gc *GCP) Fetch() (doc Doc, err error)

func (*GCP) FetchData

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

type IPv4Entry

type IPv4Entry struct {
	IPv4Prefix netip.Prefix `json:"ipv4Prefix"`
	Service    string       `json:"service"`
	Scope      string       `json:"scope"`
}

type IPv6Entry

type IPv6Entry struct {
	IPv6Prefix netip.Prefix `json:"ipv6Prefix"`
	Service    string       `json:"service"`
	Scope      string       `json:"scope"`
}

type RawDoc

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

type RawIPv4Entry

type RawIPv4Entry struct {
	IPv4Prefix string `json:"ipv4Prefix"`
	Service    string `json:"service"`
	Scope      string `json:"scope"`
}

type RawIPv6Entry

type RawIPv6Entry struct {
	IPv6Prefix string `json:"ipv6Prefix"`
	Service    string `json:"service"`
	Scope      string `json:"scope"`
}

Jump to

Keyboard shortcuts

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