parser

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Overview

Package parser is responsible for interpreting raw byte data into Containers. Each parser is disconnected from how the byte data is received and what happens with it afterwards.

The simplest parser is probably the JSON parser, which simply assumes the byte slice is a JSON representation of a Skogul Container.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfluxDB added in v0.6.0

type InfluxDB struct{}

InfluxDB provides a byte sequence parser for the InfluxDB Line Protocol https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_tutorial/

func (InfluxDB) Parse added in v0.6.0

func (influxdb InfluxDB) Parse(bytes []byte) (*skogul.Container, error)

Parse marshals a byte sequence of InfluxDB line protocol into a skogul container

type InfluxDBLineProtocol added in v0.6.0

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

InfluxDBLineProtocol is a struct with the same data types as defined in the InfluxDB Line Protocol; namely the measurement name, a set of tags, a set of fields and a timestamp.

func (*InfluxDBLineProtocol) Metric added in v0.6.0

func (line *InfluxDBLineProtocol) Metric() *skogul.Metric

Metric converts an internal InfluxDBLineProtocol struct to a skogul.Metric

func (*InfluxDBLineProtocol) ParseLine added in v0.6.0

func (line *InfluxDBLineProtocol) ParseLine(s string) error

ParseLine parses a single line into an internal InfluxDBLineProtocol

type JSON

type JSON struct{}

JSON parses a byte string-representation of a Container

func (JSON) Parse

func (x JSON) Parse(b []byte) (*skogul.Container, error)

Parse accepts a byte slice of JSON data and marshals it into a container

type ProtoBuf

type ProtoBuf struct{}

ProtoBuf parses a byte string-representation of a Container

func (ProtoBuf) Parse

func (x ProtoBuf) Parse(b []byte) (*skogul.Container, error)

Parse accepts a byte slice of protobuf data and marshals it into a container

type RawJSON added in v0.4.0

type RawJSON struct{}

RawJSON can be used when the JSON format does not conform to the final JSON format of skogul, e.g. when it is used as the first step of parsing from a third party source where modifying the source data structure might be hard/impossible

func (RawJSON) Parse added in v0.4.0

func (data RawJSON) Parse(b []byte) (*skogul.Container, error)

Parse accepts a byte slice of JSON data and marshals it into an empty skogul.Container

Jump to

Keyboard shortcuts

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