protocol

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE = iota
	DELETE
	ADDPOINT
	MADDPOINT
	QUERY
	QUERYRESPONSE
	ACK
)
View Source
const (
	OK = iota
	ACCEPTED
	TSNOTFOUND
	TSEXISTS
	UNKNOWNCMD
)
View Source
const (
	MIN   = 1
	MAX   = 2
	FIRST = 3
	LAST  = 4
)

Variables

This section is empty.

Functions

func MarshalBinary

func MarshalBinary(m encoding.BinaryMarshaler) ([]byte, error)

func MarshalBinaryFull

func MarshalBinaryFull(opcode uint8, m encoding.BinaryMarshaler) ([]byte, error)

func UnmarshalBinary

func UnmarshalBinary(buf []byte, u encoding.BinaryUnmarshaler) error

Types

type AckResponse

type AckResponse = Header

type AddPointPacket

type AddPointPacket struct {
	Name          string
	HaveTimestamp bool
	Value         float64
	Timestamp     int64
}

func (*AddPointPacket) Apply

func (*AddPointPacket) MarshalBinary

func (a *AddPointPacket) MarshalBinary() ([]byte, error)

func (*AddPointPacket) UnmarshalBinary

func (a *AddPointPacket) UnmarshalBinary(buf []byte) error

type CreatePacket

type CreatePacket struct {
	Name      string
	Retention int64
}

func (*CreatePacket) MarshalBinary

func (c *CreatePacket) MarshalBinary() ([]byte, error)

func (*CreatePacket) UnmarshalBinary

func (c *CreatePacket) UnmarshalBinary(buf []byte) error

type DeletePacket

type DeletePacket struct {
	Name string
}

func (*DeletePacket) MarshalBinary

func (d *DeletePacket) MarshalBinary() ([]byte, error)

func (*DeletePacket) UnmarshalBinary

func (d *DeletePacket) UnmarshalBinary(buf []byte) error
type Header struct {
	Value byte
	Size  uint64
}

func (*Header) Len

func (h *Header) Len() uint64

func (Header) MarshalBinary

func (h Header) MarshalBinary() ([]byte, error)

func (*Header) Opcode

func (h *Header) Opcode() byte

func (*Header) SetOpcode

func (h *Header) SetOpcode(opcode byte)

func (*Header) SetStatus

func (h *Header) SetStatus(status byte)

func (*Header) Status

func (h *Header) Status() byte

func (Header) String

func (header Header) String() string

func (*Header) UnmarshalBinary

func (h *Header) UnmarshalBinary(buf []byte) error

type QueryPacket

type QueryPacket struct {
	Name  string
	Flags byte
	Range [2]int64
	Avg   int64
}

func (*QueryPacket) Apply

func (*QueryPacket) First

func (q *QueryPacket) First() bool

func (*QueryPacket) Last

func (q *QueryPacket) Last() bool

func (*QueryPacket) MarshalBinary

func (q *QueryPacket) MarshalBinary() ([]byte, error)

func (*QueryPacket) Max

func (q *QueryPacket) Max() bool

func (*QueryPacket) Min

func (q *QueryPacket) Min() bool

func (*QueryPacket) UnmarshalBinary

func (q *QueryPacket) UnmarshalBinary(buf []byte) error

type QueryResponsePacket

type QueryResponsePacket struct {
	Records []timeseries.Record
}

func (*QueryResponsePacket) MarshalBinary

func (qr *QueryResponsePacket) MarshalBinary() ([]byte, error)

func (*QueryResponsePacket) String

func (qr *QueryResponsePacket) String() string

func (*QueryResponsePacket) UnmarshalBinary

func (qr *QueryResponsePacket) UnmarshalBinary(buf []byte) error

type Response

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

func (*Response) MarshalBinary

func (r *Response) MarshalBinary() ([]byte, error)

Jump to

Keyboard shortcuts

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