eval

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Set(toplevel, device, value string) error
	Get(toplevel, device string) (smarthome.Value, error)
	When(toplevel, device, value string, callback func()) (func(), error)
	Close()
}

type Config

type Config struct {
	TopLevel   string
	Latitude   float64
	Longitude  float64
	MQTT       *mqtt.ClientOptions
	ClientOnly bool
}

func DefaultConfig

func DefaultConfig() Config

type Evaluator

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

func New

func New(cfg Config) (e *Evaluator, err error)

func (*Evaluator) Close

func (e *Evaluator) Close()

func (*Evaluator) Command

func (e *Evaluator) Command(toplevel string, cmd []byte)

func (*Evaluator) Eval

func (e *Evaluator) Eval(ast dsl.AST) (Result, error)

func (*Evaluator) Get

func (e *Evaluator) Get(toplevel string, item string) (smarthome.Value, bool)

func (*Evaluator) Set

func (e *Evaluator) Set(toplevel string, item string, value interface{})

func (*Evaluator) Upcoming

func (e *Evaluator) Upcoming() []Event

type Event

type Event struct {
	Time        time.Time
	Description string
}

type Result

type Result interface {
	String() string
}

Jump to

Keyboard shortcuts

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