File: usage.go

package info (click to toggle)
golang-github-influxdb-usage-client 0.0~git20151204.0.475977e-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 152 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 366 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package client

import (
	"encoding/json"
	"fmt"
)

type Usage struct {
	Data    []UsageData
	Product string `json:"-"`
}

func (u Usage) Path() string {
	return fmt.Sprintf("/usage/%s", u.Product)
}

func (u Usage) MarshalJSON() ([]byte, error) {
	return json.Marshal(u.Data)
}

type UsageData struct {
	Tags   Tags   `json:"tags"`
	Values Values `json:"values"`
}