core

package
v0.0.0-...-84c8370 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToken

func GetToken(r *http.Request) (string, error)

GetToken grep token from request

Types

type GTS

type GTS struct {
	Ts     float64
	Name   string
	Labels map[string]string
	Value  interface{}
}

GTS struct

func (*GTS) Encode

func (gts *GTS) Encode() []byte

Encode a GTS to the Sensision format TS/LAT:LON/ELEV NAME{LABELS} VALUE

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler struct

func NewHandler

func NewHandler(protocol string, methods []string, handler func(*url.URL, *http.Header, io.Reader, func([]byte) error, prometheus.Counter) (int, int, error), errorHandler func(error) error) *Handler

NewHandler initialise a new api endpoint handler

func (*Handler) Handle

func (h *Handler) Handle(c echo.Context) error

Handle returns a handler.

type InfluxDBParseError

type InfluxDBParseError struct {
	Err string `json:"error"`
}

InfluxDBParseError influxDB parsing error

func (InfluxDBParseError) Error

func (e InfluxDBParseError) Error() string

type ParsingError

type ParsingError struct {
	Msg string
	Row string
}

ParsingError parsing error

func NewParsingError

func NewParsingError(msg, row string) ParsingError

NewParsingError parsing error

func (ParsingError) Error

func (h ParsingError) Error() string

type Warp

type Warp struct {
	// contains filtered or unexported fields
}

Warp connection

func NewWarp

func NewWarp(token, txn, now string) (*Warp, error)

NewWarp returns a Warp connection.

func (*Warp) Close

func (w *Warp) Close() error

Close the connection.

func (*Warp) HandleError

func (w *Warp) HandleError(e error) error

HandleError read http error body and return a corresponding error

func (*Warp) Send

func (w *Warp) Send(gts []byte) error

Send a GTS.

type WarpDDPExceeded

type WarpDDPExceeded struct {
	App   string
	Limit string
	Body  string
}

WarpDDPExceeded mads exceeded error

func (WarpDDPExceeded) Error

func (e WarpDDPExceeded) Error() string

type WarpExpiredToken

type WarpExpiredToken struct {
	Token string
}

WarpExpiredToken expired warp token error

func (WarpExpiredToken) Error

func (e WarpExpiredToken) Error() string

type WarpGoneError

type WarpGoneError struct {
	Str  string
	Body string
}

WarpGoneError invalid application error

func (WarpGoneError) Error

func (e WarpGoneError) Error() string

type WarpInputError

type WarpInputError struct {
	Str  string
	Body string
}

WarpInputError invalid input error

func (WarpInputError) Error

func (e WarpInputError) Error() string

type WarpInvalidToken

type WarpInvalidToken struct {
	Token string
}

WarpInvalidToken invalid warp token error

func (WarpInvalidToken) Error

func (e WarpInvalidToken) Error() string

type WarpMadsExceeded

type WarpMadsExceeded struct {
	App   string
	Limit string
	Body  string
}

WarpMadsExceeded mads exceeded error

func (WarpMadsExceeded) Error

func (e WarpMadsExceeded) Error() string

type WarpRevokedToken

type WarpRevokedToken struct {
	Token string
}

WarpRevokedToken represent a revoked warp token error

func (WarpRevokedToken) Error

func (e WarpRevokedToken) Error() string

Jump to

Keyboard shortcuts

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