client

package
v0.0.0-...-31edc5d Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE = iota
	DELETE
	ADD
	MADD
	QUERY
)

Variables

View Source
var (
	EmptyCommandErr          = errors.New("empty command string")
	UnknownCommandErr        = errors.New("unknown command")
	CommandEndReachedErr     = errors.New("command reached end, no new tokens available")
	MissingTimeSeriesNameErr = errors.New("missing timeseries name")
	MissingValueErr          = errors.New("missing value")
	MissingTimeStampErr      = errors.New("missing timestamp or aggregation rule, which can be:\n - RANGE upper lower\n - > timestamp-value \n - < timestamp-value\n - * for selecting all records")
)

Functions

func NewParser

func NewParser(cmd string) parser

Types

type Client

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

func NewTimepipeClient

func NewTimepipeClient(network, host, port string) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) SendCommand

func (c *Client) SendCommand(cmdString string) (*TpResponse, error)

type Command

type Command struct {
	Type       int
	TimeSeries timeseries
	Timestamp  int64
	Value      float64
	Range      timerange
	Flag       byte
	Avg        int64
}

type TpResponse

type TpResponse struct {
	Header  protocol.Header
	Command Command
	Payload protocol.QueryResponsePacket
}

func (TpResponse) String

func (r TpResponse) String() string

Jump to

Keyboard shortcuts

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