parser

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilParse = errors.New("nil parse tree")
)

Functions

This section is empty.

Types

type ErrPartialParse

type ErrPartialParse struct {
	Position int
	Rest     []byte
}

func (*ErrPartialParse) Error

func (p *ErrPartialParse) Error() string

type ID

type ID struct {
	A *uint8
	B *uint8
	C *uint8
	D *uint8
	E *uint8
	F *uint8
}

func (ID) String

func (i ID) String() string

type NullValue added in v0.1.0

type NullValue struct {
}

func (NullValue) GetNumericValue added in v0.1.0

func (n NullValue) GetNumericValue() (*float64, error)

func (NullValue) GetStringValue added in v0.1.0

func (n NullValue) GetStringValue() (*string, error)

func (NullValue) String added in v0.1.0

func (n NullValue) String() string

type NumericValue added in v0.1.0

type NumericValue struct {
	Value float64
	Unit  *string
}

func (NumericValue) GetNumericValue added in v0.1.0

func (n NumericValue) GetNumericValue() (*float64, error)

func (NumericValue) GetStringValue added in v0.1.0

func (n NumericValue) GetStringValue() (*string, error)

func (NumericValue) String added in v0.1.0

func (n NumericValue) String() string

type Object

type Object struct {
	ID        ID
	Value     Value
	Timestamp *string
}

func (Object) String

func (o Object) String() string

type StringValue added in v0.1.0

type StringValue struct {
	Value string
	Unit  *string
}

func (StringValue) GetNumericValue added in v0.1.0

func (s StringValue) GetNumericValue() (*float64, error)

func (StringValue) GetStringValue added in v0.1.0

func (s StringValue) GetStringValue() (*string, error)

func (StringValue) String added in v0.1.0

func (s StringValue) String() string

type Telegram

type Telegram struct {
	Identification string
	Objects        []Object
}

func Parse

func Parse(raw []byte) (*Telegram, error)

func (Telegram) String

func (t Telegram) String() string

type Value

type Value interface {
	GetNumericValue() (*float64, error)
	GetStringValue() (*string, error)
}

func NewValue added in v0.1.0

func NewValue(raw string, unit *string) Value

Jump to

Keyboard shortcuts

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