aws

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: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ShortName   = "aws"
	FullName    = "Amazon Web Services"
	HostType    = "cloud"
	SourceURL   = "https://docs.aws.amazon.com/vpc/latest/userguide/aws-ip-ranges.html"
	DownloadURL = "https://ip-ranges.amazonaws.com/ip-ranges.json"
)

Variables

This section is empty.

Functions

func TrimQuotes

func TrimQuotes(in *string)

Types

type AWS

type AWS struct {
	Client      *retryablehttp.Client
	InitialURL  string
	DownloadURL string
}

func New

func New() AWS

func (*AWS) Fetch

func (a *AWS) Fetch() (doc Doc, etag string, err error)

func (*AWS) FetchData

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

func (*AWS) FetchETag

func (a *AWS) FetchETag() (etag string, err error)

func (*AWS) FullName

func (a *AWS) FullName() string

func (*AWS) HostType

func (a *AWS) HostType() string

func (*AWS) ShortName

func (a *AWS) ShortName() string

func (*AWS) SourceURL

func (a *AWS) SourceURL() string

type Doc

type Doc struct {
	SyncToken    string       `json:"syncToken"`
	CreateDate   string       `json:"createDate"`
	Prefixes     []Prefix     `json:"prefixes" yaml:"prefixes"`
	IPv6Prefixes []IPv6Prefix `json:"ipv6_prefixes" yaml:"ipv6_prefixes"`
}

func ProcessData

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

type IPv6Prefix

type IPv6Prefix struct {
	IPv6Prefix netip.Prefix `json:"ipv6_prefix" yaml:"ipv6_prefix"`
	Region     string       `json:"region" yaml:"region"`
	Service    string       `json:"service" yaml:"service"`
}

type Prefix

type Prefix struct {
	IPPrefix netip.Prefix `json:"ip_prefix" yaml:"ip_prefix"`
	Region   string       `json:"region" yaml:"region"`
	Service  string       `json:"service" yaml:"service"`
}

type RawDoc

type RawDoc struct {
	SyncToken    string          `json:"syncToken"`
	CreateDate   string          `json:"createDate"`
	Prefixes     []RawPrefix     `json:"prefixes" yaml:"prefixes"`
	IPv6Prefixes []RawIPv6Prefix `json:"ipv6_prefixes" yaml:"ipv6_prefixes"`
}

type RawIPv6Prefix

type RawIPv6Prefix struct {
	IPv6Prefix string `json:"ipv6_prefix" yaml:"ipv6_prefix"`
	Region     string `json:"region" yaml:"region"`
	Service    string `json:"service" yaml:"service"`
}

type RawPrefix

type RawPrefix struct {
	IPPrefix string `json:"ip_prefix" yaml:"ip_prefix"`
	Region   string `json:"region" yaml:"region"`
	Service  string `json:"service" yaml:"service"`
}

Jump to

Keyboard shortcuts

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