Documentation
¶
Index ¶
- Constants
- Variables
- type Attributes
- type Client
- func (c *Client) Delete(selector Selector, start time.Time, stop time.Time) ([]byte, error)
- func (c *Client) Exec(warpScript string) ([]byte, error)
- func (c *Client) Fetch(selector Selector, start time.Time, stop time.Time) ([]byte, error)
- func (c *Client) Find(selector Selector) ([]byte, error)
- func (c *Client) Meta(gtsList GTSList) ([]byte, error)
- func (c *Client) Update(gts GTSList) error
- type Datapoints
- type GTS
- type GTSList
- type Labels
- type Selector
Constants ¶
const ( HeaderErrorMessage = "X-Warp10-Error-Message" HeaderElapsed = "X-Warp10-Elapsed" HeaderErrorLine = "X-Warp10-Error-Line" HeaderFetched = "X-Warp10-Fetched" HeaderOperations = "X-Warp10-Ops" )
Variables ¶
var ( NoReadTokenError = errors.New("this Warp10 call need a READ token access on the data") NoWriteTokenError = errors.New("this Warp10 call need a WRITE token access on the data") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Host string Warp10Header string ExecPath string UpdatePath string MetaPath string FetchPath string FindPath string DeletePath string ReadToken string WriteToken string HTTPClient *http.Client }
Client is a Warp10 client
func (*Client) Delete ¶
Delete execute a WarpScript on the backend, returning resultat as byte array if start and end are nil, assume user want to delete all datapoints Enhance parse response
func (*Client) Fetch ¶
Fetch execute a WarpScript on the backend, returning resultat as byte array Enhance parse response
func (*Client) Find ¶
Find execute a WarpScript on the backend, returning resultat as byte array Enhance parse response
type Datapoints ¶
type Datapoints [][]interface{}
Datapoints is the sensision datapoints representation
func (*Datapoints) Add ¶
func (dps *Datapoints) Add(ts time.Time, value interface{}) *Datapoints
Add a new point to a GTS
func (*Datapoints) AddWithGeo ¶
func (dps *Datapoints) AddWithGeo(ts time.Time, lattitude, longitude, altitude float64, value interface{}) *Datapoints
AddWithGeo a new point to a GTS with geolocation
func (*Datapoints) Has ¶
func (dps *Datapoints) Has(ts time.Time) bool
Has look for datapoint at this time
func (*Datapoints) Remove ¶
func (dps *Datapoints) Remove(ts time.Time) *Datapoints
Remove datapoint at this time (only the first)
type GTS ¶
type GTS struct { // Name of the time serie ClassName string `json:"c"` // Key/value of the GTS labels (changing one key or his value create a new GTS) Labels Labels `json:"l"` // Key/value of the GTS attributes (can be setted/updated/removed without creating a new GTS) Attributes Attributes `json:"a"` // Timestamp of the last datapoint received on this GTS (% last activity window) LastActivity int64 `json:"la"` // Array of datapoints of this GTS Values Datapoints `json:"v"` }
GTS is the Warp10 representation of a GeoTimeSerie (GTS)
func NewGTSWithLabels ¶
NewGTSWithLabels return a nammed and labelized GTS
func ParseGTSFromBytes ¶
ParseGTSFromBytes parse sensision format into a new GTS
func ParseGTSFromString ¶
ParseGTSFromString parse an unique sensision format line into a new GTS
func (*GTS) SensisionSelector ¶
SensisionSelector return the GTS selector (class + labels (+ attributes) )
type GTSList ¶
type GTSList []*GTS
GTSList is an array of GTS
func ParseGTSArrayFromBytes ¶
ParseGTSArrayFromBytes parse sensision format into a new GTS array
func ParseGTSArrayFromString ¶
ParseGTSArrayFromString parse sensision format into a new GTS array
func (GTSList) SensisionSelectors ¶
SensisionSelectors return the GTSList selectors (class + labels (+ attributes) )