dataset

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExportTypeCSV  = ExportType("csv")
	ExportTypeJSON = ExportType("json")
	ExportTypeXLSX = ExportType("xlsx")
)
View Source
const (
	DatatypeTypeNumQueries   = DatatypeType("num_queries")
	DatatypeTypeEBOTResponse = DatatypeType("num_ebot_response")
	DatatypeTypeNXDResponse  = DatatypeType("num_nxd_response")
	DatatypeTypeZeroQueries  = DatatypeType("zero_queries")
)
View Source
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")
)
View Source
const (
	RepeatsEveryWeek  = RepeatsEvery("week")
	RepeatsEveryMonth = RepeatsEvery("month")
	RepeatsEveryYear  = RepeatsEvery("year")
)
View Source
const (
	TimeframeAggregationDaily         = TimeframeAggregation("daily")
	TimeframeAggregationMontly        = TimeframeAggregation("monthly")
	TimeframeAggregationBillingPeriod = TimeframeAggregation("billing_period")
)
View Source
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 ExportType

type ExportType string

ExportType is a string enum

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 RepeatsEvery

type RepeatsEvery string

RepeatsEvery is a string enum

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 ReportStatus

type ReportStatus string

ReportStatus is a string enum

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 TimeframeAggregation

type TimeframeAggregation string

TimeframeAggregation is a string enum

type UnixTimestamp

type UnixTimestamp time.Time

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

Jump to

Keyboard shortcuts

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