Vendor main dependencies.
This commit is contained in:
parent
49a09ab7dd
commit
dd5e3fba01
2738 changed files with 1045689 additions and 0 deletions
2
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/doc.go
generated
vendored
Normal file
2
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/doc.go
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package data contains definitions for NS1 metadata/sources/feeds/etc.
|
||||
package data
|
38
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/feed.go
generated
vendored
Normal file
38
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/feed.go
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
package data
|
||||
|
||||
// Destination is the target resource the receives data from a feed/source.
|
||||
type Destination struct {
|
||||
ID string `json:"destid"`
|
||||
|
||||
// All destinations must point to a record.
|
||||
RecordID string `json:"record"`
|
||||
|
||||
// Type is the 'level' at which to apply the filters(on the targeted record).
|
||||
// Options:
|
||||
// - answer (highest precedence)
|
||||
// - region
|
||||
// - record (lowest precendence)
|
||||
Type string `json:"desttype"`
|
||||
|
||||
SourceID string `json:"-"`
|
||||
}
|
||||
|
||||
// NewDestination returns an empty feed destination.
|
||||
func NewDestination() *Destination {
|
||||
return &Destination{}
|
||||
}
|
||||
|
||||
// Feed wraps an NS1 /data/feeds resource
|
||||
type Feed struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Config Config `json:"config,omitempty"`
|
||||
Data Meta `json:"data,omitempty"`
|
||||
|
||||
SourceID string
|
||||
}
|
||||
|
||||
// NewFeed returns a data feed with given name and config.
|
||||
func NewFeed(name string, cfg Config) *Feed {
|
||||
return &Feed{Name: name, Config: cfg}
|
||||
}
|
127
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/meta.go
generated
vendored
Normal file
127
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/meta.go
generated
vendored
Normal file
|
@ -0,0 +1,127 @@
|
|||
package data
|
||||
|
||||
// FeedPtr represents the dynamic metadata value in which a feed is providing the value.
|
||||
type FeedPtr struct {
|
||||
FeedID string `json:"feed,omitempty"`
|
||||
}
|
||||
|
||||
// Meta contains information on an entities metadata table. Metadata key/value
|
||||
// pairs are used by a records' filter pipeline during a dns query.
|
||||
// All values can be a feed id as well, indicating real-time updates of these values.
|
||||
// Structure/Precendence of metadata tables:
|
||||
// - Record
|
||||
// - Meta <- lowest precendence in filter
|
||||
// - Region(s)
|
||||
// - Meta <- middle precedence in filter chain
|
||||
// - ...
|
||||
// - Answer(s)
|
||||
// - Meta <- highest precedence in filter chain
|
||||
// - ...
|
||||
// - ...
|
||||
type Meta struct {
|
||||
// STATUS
|
||||
|
||||
// Indicates whether or not entity is considered 'up'
|
||||
// bool or FeedPtr.
|
||||
Up interface{} `json:"up,omitempty"`
|
||||
|
||||
// Indicates the number of active connections.
|
||||
// Values must be positive.
|
||||
// int or FeedPtr.
|
||||
Connections interface{} `json:"connections,omitempty"`
|
||||
|
||||
// Indicates the number of active requests (HTTP or otherwise).
|
||||
// Values must be positive.
|
||||
// int or FeedPtr.
|
||||
Requests interface{} `json:"requests,omitempty"`
|
||||
|
||||
// Indicates the "load average".
|
||||
// Values must be positive, and will be rounded to the nearest tenth.
|
||||
// float64 or FeedPtr.
|
||||
LoadAvg interface{} `json:"loadavg,omitempty"`
|
||||
|
||||
// The Job ID of a Pulsar telemetry gathering job and routing granularities
|
||||
// to associate with.
|
||||
// string or FeedPtr.
|
||||
Pulsar interface{} `json:"pulsar,omitempty"`
|
||||
|
||||
// GEOGRAPHICAL
|
||||
|
||||
// Must be between -180.0 and +180.0 where negative
|
||||
// indicates South and positive indicates North.
|
||||
// e.g., the longitude of the datacenter where a server resides.
|
||||
// float64 or FeedPtr.
|
||||
Latitude interface{} `json:"latitude,omitempty"`
|
||||
|
||||
// Must be between -180.0 and +180.0 where negative
|
||||
// indicates West and positive indicates East.
|
||||
// e.g., the longitude of the datacenter where a server resides.
|
||||
// float64 or FeedPtr.
|
||||
Longitude interface{} `json:"longitude,omitempty"`
|
||||
|
||||
// Valid geographic regions are: 'US-EAST', 'US-CENTRAL', 'US-WEST',
|
||||
// 'EUROPE', 'ASIAPAC', 'SOUTH-AMERICA', 'AFRICA'.
|
||||
// e.g., the rough geographic location of the Datacenter where a server resides.
|
||||
// []string or FeedPtr.
|
||||
Georegion interface{} `json:"georegion,omitempty"`
|
||||
|
||||
// Countr(ies) must be specified as ISO3166 2-character country code(s).
|
||||
// []string or FeedPtr.
|
||||
Country interface{} `json:"country,omitempty"`
|
||||
|
||||
// State(s) must be specified as standard 2-character state code(s).
|
||||
// []string or FeedPtr.
|
||||
USState interface{} `json:"us_state,omitempty"`
|
||||
|
||||
// Canadian Province(s) must be specified as standard 2-character province
|
||||
// code(s).
|
||||
// []string or FeedPtr.
|
||||
CAProvince interface{} `json:"ca_province,omitempty"`
|
||||
|
||||
// INFORMATIONAL
|
||||
|
||||
// Notes to indicate any necessary details for operators.
|
||||
// Up to 256 characters in length.
|
||||
// string or FeedPtr.
|
||||
Note interface{} `json:"note,omitempty"`
|
||||
|
||||
// NETWORK
|
||||
|
||||
// IP (v4 and v6) prefixes in CIDR format ("a.b.c.d/mask").
|
||||
// May include up to 1000 prefixes.
|
||||
// e.g., "1.2.3.4/24"
|
||||
// []string or FeedPtr.
|
||||
IPPrefixes interface{} `json:"ip_prefixes,omitempty"`
|
||||
|
||||
// Autonomous System (AS) number(s).
|
||||
// May include up to 1000 AS numbers.
|
||||
// []string or FeedPtr.
|
||||
ASN interface{} `json:"asn,omitempty"`
|
||||
|
||||
// TRAFFIC
|
||||
|
||||
// Indicates the "priority tier".
|
||||
// Lower values indicate higher priority.
|
||||
// Values must be positive.
|
||||
// int or FeedPtr.
|
||||
Priority interface{} `json:"priority,omitempty"`
|
||||
|
||||
// Indicates a weight.
|
||||
// Filters that use weights normalize them.
|
||||
// Any positive values are allowed.
|
||||
// Values between 0 and 100 are recommended for simplicity's sake.
|
||||
// float64 or FeedPtr.
|
||||
Weight interface{} `json:"weight,omitempty"`
|
||||
|
||||
// Indicates a "low watermark" to use for load shedding.
|
||||
// The value should depend on the metric used to determine
|
||||
// load (e.g., loadavg, connections, etc).
|
||||
// int or FeedPtr.
|
||||
LowWatermark interface{} `json:"low_watermark,omitempty"`
|
||||
|
||||
// Indicates a "high watermark" to use for load shedding.
|
||||
// The value should depend on the metric used to determine
|
||||
// load (e.g., loadavg, connections, etc).
|
||||
// int or FeedPtr.
|
||||
HighWatermark interface{} `json:"high_watermark,omitempty"`
|
||||
}
|
10
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/region.go
generated
vendored
Normal file
10
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/region.go
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
package data
|
||||
|
||||
// Region is a metadata table with a name/key.
|
||||
// Can be thought of as metadata groupings.
|
||||
type Region struct {
|
||||
Meta Meta `json:"meta,omitempty"`
|
||||
}
|
||||
|
||||
// Regions is simply a mapping of Regions inside a record.
|
||||
type Regions map[string]Region
|
28
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/source.go
generated
vendored
Normal file
28
vendor/gopkg.in/ns1/ns1-go.v2/rest/model/data/source.go
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
package data
|
||||
|
||||
// Config is a flat mapping where values are simple (no slices/maps).
|
||||
type Config map[string]interface{}
|
||||
|
||||
// Source wraps an NS1 /data/sources resource
|
||||
type Source struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// Human readable name of the source.
|
||||
Name string `json:"name"`
|
||||
|
||||
Type string `json:"sourcetype"`
|
||||
Config Config `json:"config,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
Feeds []*Feed `json:"feeds,omitempty"`
|
||||
}
|
||||
|
||||
// NewSource takes a name and type t.
|
||||
func NewSource(name string, t string) *Source {
|
||||
return &Source{
|
||||
Name: name,
|
||||
Type: t,
|
||||
Config: Config{},
|
||||
Feeds: []*Feed{},
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue