redis

package
v0.0.0-...-e67e6ae Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityType                 = "redis"
	THING_PROPERTY_TYPE_Hash   = "hash"
	THING_PROPERTY_TYPE_String = "string"
)
View Source
const (
	Redis_SSQL_TLP = `HMSET`
)

Variables

View Source
var (
	NewJSONContext = ruleql.NewJSONContext
	NewMapContext  = ruleql.NewMapContext
)
View Source
var (
	NewMessage        = utils.NewMessage
	Execute           = utils.Execute
	NewMessageContext = utils.NewMessageContext
)

Functions

func BuildValue

func BuildValue(key string, value interface{}) (interface{}, error)

func ToHash

func ToHash(val interface{}) (map[string]interface{}, error)

ToInteger coerce a value to an integer

func ToString

func ToString(val interface{}) (string, error)

Types

type Data

type Data struct {
	Value interface{} `json:"value"`
	Time  int64       `json:"ts"`
}

type EvalContext

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

func NewContext

func NewContext(key string, rawJsonStr string, baseCtx ...ruleql.Context) *EvalContext

NewContext new context from json

func (*EvalContext) Call

func (this *EvalContext) Call(expr *ruleql.CallExpr, args []ruleql.Node) ruleql.Node

func (*EvalContext) Range

func (this *EvalContext) Range(expr string) []*EvalContext

func (*EvalContext) Range2

func (this *EvalContext) Range2(expr string) []*EvalContext

func (*EvalContext) Value

func (this *EvalContext) Value(key string) ruleql.Node

type Field

type Field struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type Fields

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

type Message

type Message struct {
	Data     map[string]*Data `json:"data"`
	DeviceId string           `json:"device_id"`
}

type Option

type Option struct {
	//Addrs     string `json:"addrs,omitempty"`
	Urls   []string         `json:"urls"`
	Key    string           `json:"Key,omitempty"`
	Fields map[string]Field `json:"fields,omitempty"`
}

Jump to

Keyboard shortcuts

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