common

package
v0.0.0-...-fb72fe2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSuffix

func AddSuffix(start []byte, suffix string) []byte

func AnycastSupported

func AnycastSupported() bool

func IsPrivateIp

func IsPrivateIp(a net.IP) bool

func RandInt

func RandInt(max uint) uint

func TLSConfigDNS

func TLSConfigDNS() *tls.Config

func TLSConfigLegacyHTTPS

func TLSConfigLegacyHTTPS() *tls.Config

func TLSConfigModernHTTPS

func TLSConfigModernHTTPS() *tls.Config

Types

type BlacklistData

type BlacklistData struct {
	OnBlacklist   bool            `json:"blacklisted"`
	NumberOfLists int             `json:"number_of_lists"`
	NumberFound   int             `json:"number_blacklisted"`
	Results       map[string]bool `json:"results"`
}

type ClientSubnet

type ClientSubnet struct {
	IP        string       `json:"ip"`
	Netmask   int          `json:"netmask"`
	IPFamily  string       `json:"ip_family"`
	DraftMode bool         `json:"draft_mode"`
	SubnetLoc *GeoLocation `json:"subnet_location"`
}

type DNSTelemetry

type DNSTelemetry struct {
	IP           string        `json:"ip"`
	IPFamily     string        `json:"ip_family"`
	NetType      string        `json:"net_type"`
	TLSEnabled   bool          `json:"tls_enabled"`
	DNSSECOk     bool          `json:"dnssec_enabled"`
	NSIDEnabled  bool          `json:"nsid_requested"`
	RequestTime  uint64        `json:"request_time,string"`
	KeepAlive    bool          `json:"tcp_keep_alive_enabled"`
	KeepAliveTTL uint          `json:"tcp_keep_alive_ms"`
	Cookie       bool          `json:"dns_cookie"`
	ExtraEDNS0   int           `json:"additional_edns0_records"`
	FlagRD       bool          `json:"recursion_desired"`
	FlagCD       bool          `json:"checking_disabled"`
	RequestLoc   *GeoLocation  `json:"request_location"`
	Subnet       *ClientSubnet `json:"client_subnet"`
	NodeLoc      *GeoLocation  `json:"node_location"`
	RFC4343Fail  bool          `json:"rfc4343_intolerance"`
}

type DefaultJSONObject

type DefaultJSONObject struct {
	Status  string      `json:"status"`
	Type    string      `json:"type"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
	Code    int         `json:"code"`
}

type GeoLocation

type GeoLocation struct {
	Position     *Position         `json:"position"`
	ISP          *ISP              `json:"network"`
	City         string            `json:"city"`
	Country      string            `json:"country"`
	CountryISO   string            `json:"iso_country"`
	Location     string            `json:"location"`
	LocationI18n map[string]string `json:"localized_location"`
	TorNode      *string           `json:"tor_node"`
}

type GeoLookupData

type GeoLookupData struct {
	NodeLoc    *GeoLocation `json:"node_location"`
	RequestLoc *GeoLocation `json:"request_location"`
	IP         string       `json:"ip_address"`
}

type ISP

type ISP struct {
	Organization   string `maxminddb:"organization" json:"organization"`
	ASNumber       uint   `maxminddb:"autonomous_system_number" json:"as_number"`
	ASOrganization string `maxminddb:"autonomous_system_organization" json:"as_owner"`
	ISP            string `maxminddb:"isp" json:"isp"`
}

type Interface

type Interface struct {
	ID   string
	IP   net.IP
	Type InterfaceType
	Name string
}

func (Interface) String

func (i Interface) String() string

type InterfaceState

type InterfaceState int
const (
	StateUnknown InterfaceState = iota
	StateUp
	StateDown
	StateMissing
	StateCriticalFailure
)

func (InterfaceState) String

func (s InterfaceState) String() string

type InterfaceType

type InterfaceType int
const (
	TypeUnknown InterfaceType = iota
	TypeIPv4
	TypeIPv6
)

func (InterfaceType) String

func (t InterfaceType) String() string

type Netblock

type Netblock struct {
	IP          string
	Netmask     uint8
	Force       bool
	Communities []string
}

type Position

type Position struct {
	Latitude  float32 `maxminddb:"latitude" json:"latitude"`
	Longitude float32 `maxminddb:"longitude" json:"longitude"`
	Radius    uint    `maxminddb:"accuracy_radius" json:"uncertainty_km"`
	TimeZone  string  `maxminddb:"time_zone" json:"time_zone"`
}

type StatsData

type StatsData struct {
	Keys       *[]string          `json:"keys"`
	Counters   *map[string]uint64 `json:"counters"`
	PFCounters *map[string]uint64 `json:"cardinalities"`
}

type Status

type Status struct {
	State InterfaceState
	ID    string
}

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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