Documentation
¶
Index ¶
Constants ¶
const ( ExportTypeCSV = ExportType("csv") ExportTypeJSON = ExportType("json") ExportTypeXLSX = ExportType("xlsx") )
const ( DatatypeTypeNumQueries = DatatypeType("num_queries") DatatypeTypeEBOTResponse = DatatypeType("num_ebot_response") DatatypeTypeNXDResponse = DatatypeType("num_nxd_response") DatatypeTypeZeroQueries = DatatypeType("zero_queries") )
const ( DatatypeScopeAccount = DatatypeScope("account") DatatypeScopeNetworkSingle = DatatypeScope("network_single") DatatypeScopeRecordSingle = DatatypeScope("record_single") DatatypeScopeZoneSingle = DatatypeScope("zone_single") DatatypeScopeNetworkEach = DatatypeScope("network_each") DatatypeScopeRecordEach = DatatypeScope("record_each") DatatypeScopeZoneEach = DatatypeScope("zone_each") DatatypeScopeTopNZones = DatatypeScope("top_n_zones") DatatypeScopeTopNRecords = DatatypeScope("top_n_records") )
const ( RepeatsEveryWeek = RepeatsEvery("week") RepeatsEveryMonth = RepeatsEvery("month") RepeatsEveryYear = RepeatsEvery("year") )
const ( TimeframeAggregationDaily = TimeframeAggregation("daily") TimeframeAggregationMontly = TimeframeAggregation("monthly") TimeframeAggregationBillingPeriod = TimeframeAggregation("billing_period") )
const ( ReportStatusQueued = ReportStatus("queued") ReportStatusGenerating = ReportStatus("generating") ReportStatusAvailable = ReportStatus("available") ReportStatusFailed = ReportStatus("failed") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dataset ¶
type Dataset struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Datatype *Datatype `json:"datatype,omitempty"` Repeat *Repeat `json:"repeat,omitempty"` Timeframe *Timeframe `json:"timeframe,omitempty"` ExportType ExportType `json:"export_type,omitempty"` Reports []*Report `json:"reports,omitempty"` RecipientEmails []string `json:"recipient_emails,omitempty"` CreatedAt UnixTimestamp `json:"created_at,omitempty"` UpdatedAt UnixTimestamp `json:"updated_at,omitempty"` }
Dataset wraps an NS1 /datasets resource
func NewDataset ¶
func NewDataset( id string, name string, datatype *Datatype, repeat *Repeat, timeframe *Timeframe, exportType ExportType, reports []*Report, recipientEmails []string, createdAt UnixTimestamp, updatedAt UnixTimestamp, ) *Dataset
NewDataset takes the properties for a Dataset and creates a new instance
type Datatype ¶
type Datatype struct { Type DatatypeType `json:"type,omitempty"` Scope DatatypeScope `json:"scope,omitempty"` Data map[string]string `json:"data,omitempty"` }
Datatype wraps Dataset's "Datatype" attribute
func NewDatatype ¶
func NewDatatype( dtype DatatypeType, scope DatatypeScope, data map[string]string, ) *Datatype
NewDatatype takes the properties for a Datatype and creates a new instance
type DatatypeScope ¶
type DatatypeScope string
type DatatypeType ¶
type DatatypeType string
type Repeat ¶
type Repeat struct { Start UnixTimestamp `json:"start,omitempty"` RepeatsEvery RepeatsEvery `json:"repeats_every,omitempty"` EndAfterN int32 `json:"end_after_n,omitempty"` }
Repeat wraps Dataset's "Repeat" attribute
func NewRepeat ¶
func NewRepeat( start UnixTimestamp, repeatsEvery RepeatsEvery, endAfterN int32, ) *Repeat
NewRepeat takes the properties for a Repeat and creates a new instance
type Report ¶
type Report struct { ID string `json:"id,omitempty"` Status ReportStatus `json:"status,omitempty"` Start UnixTimestamp `json:"start,omitempty"` End UnixTimestamp `json:"end,omitempty"` CreatedAt UnixTimestamp `json:"created_at,omitempty"` }
Report wraps Dataset's "Report" attribute
func NewReport ¶
func NewReport( id string, status ReportStatus, start UnixTimestamp, end UnixTimestamp, createdAt UnixTimestamp, ) *Report
NewReport takes the properties for a Report and creates a new instance
type Timeframe ¶
type Timeframe struct { Aggregation TimeframeAggregation `json:"aggregation,omitempty"` Cycles *int32 `json:"cycles,omitempty"` From *UnixTimestamp `json:"from,omitempty"` To *UnixTimestamp `json:"to,omitempty"` }
Timeframe wraps Dataset's "Timeframe" attribute
func NewTimeframe ¶
func NewTimeframe( aggregation TimeframeAggregation, cycles *int32, from *UnixTimestamp, to *UnixTimestamp, ) *Timeframe
NewTimeframe takes the properties for a Timeframe and creates a new instance
type UnixTimestamp ¶
UnixTimestamp represents a timestamp field that comes as a string-based unix timestamp
func (*UnixTimestamp) MarshalJSON ¶
func (ut *UnixTimestamp) MarshalJSON() ([]byte, error)
func (*UnixTimestamp) UnmarshalJSON ¶
func (ut *UnixTimestamp) UnmarshalJSON(data []byte) error