ripestat

package
v0.0.0-...-db57c93 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataUrl = "https://stat.ripe.net/data/"
)

Variables

This section is empty.

Functions

func ConvertAbuseContactsData

func ConvertAbuseContactsData(data []byte) ([]string, error)

Types

type ASBlock

type ASBlock struct {
	Resource    string `json:"resource"`
	Description string `json:"desc"`
	Name        string `json:"name"`
}

type ASOverview

type ASOverview struct {
	Type           string  `json:"type"`
	Resource       string  `json:"resource"`
	Block          ASBlock `json:"block"`
	Holder         string  `json:"holder"`
	Announced      bool    `json:"announced"`
	QueryStartTime string  `json:"query_starttime"`
	QueryEndTime   string  `json:"query_endtime"`
}

func ConvertASOverviewData

func ConvertASOverviewData(data []byte) (ASOverview, error)

type ASOverviewBase

type ASOverviewBase struct {
	ResponseBase
	Data ASOverview `json:"data"`
}

type AbuseContactFinder

type AbuseContactFinder struct {
	AbuseContacts    []string      `json:"abuse_contacts"`
	AuthoritativeRIR string        `json:"authoritative_rir"`
	LatestTime       string        `json:"latest_time"`
	EarliestTime     string        `json:"earliest_time"`
	Parameters       ParameterBase `json:"parameters"`
}

type AbuseContactFinderBase

type AbuseContactFinderBase struct {
	ResponseBase
	Data AbuseContactFinder `json:"data"`
}

type Client

type Client struct {
	SourceApp  string
	MaxRetries int
}

func NewRipeStatClient

func NewRipeStatClient(sourceApp string, maxRetries int) *Client

func (*Client) GetASOverview

func (c *Client) GetASOverview(asn string) (ASOverview, error)

func (*Client) GetAbuseContacts

func (c *Client) GetAbuseContacts(ipAddr string) ([]string, error)

func (*Client) GetGeolocationData

func (c *Client) GetGeolocationData(prefix string) (MaxmindGeoLite, error)

func (*Client) GetNetworkInfo

func (c *Client) GetNetworkInfo(ipAddr string) (NetworkInfo, error)

type LocatedResource

type LocatedResource struct {
	Resource  string             `json:"resource"`
	Locations []ResourceLocation `json:"locations"`
}

type MaxmindGeoLite

type MaxmindGeoLite struct {
	LocatedResources   []LocatedResource `json:"located_resources"`
	UnknownPercentages UnknownPercentage `json:"unknown_percentage"`
	Parameters         MaxmindParameters `json:"parameters"`
	ResultTime         string            `json:"result_time"`
	LatestTime         string            `json:"latest_time"`
	EarliestTime       string            `json:"earliest_time"`
}

func ConvertGeolocationData

func ConvertGeolocationData(data []byte) (MaxmindGeoLite, error)

type MaxmindGeoLiteBase

type MaxmindGeoLiteBase struct {
	ResponseBase
	Data MaxmindGeoLite
}

type MaxmindParameters

type MaxmindParameters struct {
	ParameterBase
	Resolution string `json:"resolution"`
}

type NetworkInfo

type NetworkInfo struct {
	ASNs   []string `json:"asns"`
	Prefix string   `json:"prefix"`
}

func ConvertNetworkInfoData

func ConvertNetworkInfoData(data []byte) (NetworkInfo, error)

type NetworkInfoBase

type NetworkInfoBase struct {
	ResponseBase
	Data NetworkInfo `json:"data"`
}

type ParameterBase

type ParameterBase struct {
	Resource string `json:"resource"`
}

type ResourceLocation

type ResourceLocation struct {
	Country   string   `json:"country"`
	City      string   `json:"city"`
	Resources []string `json:"resources"`
	// Latitude          float64  `json:"latitude"`  // XXX: another data type?
	// Longitude         float64  `json:"longitude"` // XXX: another data type?
	CoveredPercentage float64 `json:"covered_percentage"`
	UnknownPercentage float64 `json:"unknown_percentage"`
}

type ResponseBase

type ResponseBase struct {
	Messages       [][]string `json:"messages"`
	SeeAlso        []string   `json:"see_also"`
	DataCallName   string     `json:"data_call_name"`
	DataCallStatus string     `json:"data_call_status"`
	Cached         bool       `json:"cached"`
	QueryID        string     `json:"query_id"`
	ProcessTime    int        `json:"process_time"`
	ServerID       string     `json:"server_id"`
	BuildVersion   string     `json:"build_version"`
	Status         string     `json:"status"`
	StatusCode     int        `json:"status_code"`
	Time           string     `json:"time"`
}

type UnknownPercentage

type UnknownPercentage struct {
	V4 float64 `json:"v4"`
	V6 float64 `json:"v6"`
}

Jump to

Keyboard shortcuts

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