telemetryapi

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeseriesDataTypeUnknown = iota
	TimeseriesDataTypeFloat64
	TimeseriesDataTypeInt64
	TimeseriesDataTypeString
	TimeseriesDataTypeStringArray
	TimeseriesDataTypeBool
)
View Source
const DefaultTimeout = 15 * time.Second

Variables

View Source
var (
	ErrNoValues = errors.New("no values")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Timeseries(ctx context.Context, p TimeseriesParams) (*Timeseries, error)
	Ready(ctx context.Context) error
	Close()
}

func NewClient

func NewClient(p ClientParams) (Client, error)

type ClientParams

type ClientParams struct {
	HTTPClient *http.Client
	BaseURL    string
	Token      string
}

type Error

type Error struct {
	Code    string                 `json:"code"`
	Message string                 `json:"message,omitempty"`
	Details map[string]interface{} `json:"details,omitempty"`
}

func (*Error) Error

func (e *Error) Error() string

type MultiError

type MultiError struct {
	Errors []Error `json:"errors"`
}

func (*MultiError) Error

func (m *MultiError) Error() string

type Timeseries

type Timeseries struct {
	TimeField  []time.Time
	DataFields []*TimeseriesDataField
}

func NewTimeseries

func NewTimeseries(dataTypes []TimeseriesDataType) *Timeseries

func (*Timeseries) Len

func (ts *Timeseries) Len() int

type TimeseriesDataField

type TimeseriesDataField struct {
	Tags   TimeseriesTags
	Type   TimeseriesDataType
	Values []interface{}
}

type TimeseriesDataType

type TimeseriesDataType uint8

func (TimeseriesDataType) Parse

func (t TimeseriesDataType) Parse(s string) (interface{}, error)

func (TimeseriesDataType) String

func (t TimeseriesDataType) String() string

func (TimeseriesDataType) ZeroValue

func (t TimeseriesDataType) ZeroValue() interface{}

type TimeseriesParams

type TimeseriesParams struct {
	User  string
	Query string
	From  time.Time
	To    time.Time
}

type TimeseriesTags

type TimeseriesTags map[string]string

Jump to

Keyboard shortcuts

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