types

package
v4.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator added in v4.0.11

type Calculator struct {
	Assign     string `json:"assign"`     //赋值
	Expression string `json:"expression"` //表达式
	// contains filtered or unexported fields
}

func (*Calculator) Eval added in v4.0.11

func (c *Calculator) Eval(ctx map[string]any) (err error)

type Filter added in v4.0.11

type Filter struct {
	Field      string `json:"field"`         //字段
	Expression string `json:"expression"`    //表达式
	All        bool   `json:"all,omitempty"` //
	// contains filtered or unexported fields
}

func (*Filter) Check added in v4.0.11

func (c *Filter) Check(ctx map[string]any) (ret bool, err error)

type FormItem added in v4.0.18

type FormItem struct {
	Key         string             `json:"key"`
	Label       string             `json:"label"`
	Type        string             `json:"type,omitempty"` //type object array
	Default     any                `json:"default,omitempty"`
	Placeholder string             `json:"placeholder,omitempty"`
	Tips        string             `json:"tips,omitempty"`
	Pattern     string             `json:"pattern,omitempty"`
	Options     []FormSelectOption `json:"options,omitempty"`
	Required    bool               `json:"required,omitempty"`
	Min         float64            `json:"min,omitempty"`
	Max         float64            `json:"max,omitempty"`
	Step        float64            `json:"step,omitempty"`

	Children []FormItem `json:"children,omitempty"` //子级?
}

type FormSelectOption added in v4.0.18

type FormSelectOption struct {
	Value    any    `json:"value"`
	Label    string `json:"label"`
	Disabled bool   `json:"disabled,omitempty"`
}

type History

type History struct {
	Id       int64     `json:"id"`
	DeviceId string    `json:"device_id" xorm:"index"`
	Point    string    `json:"point" xorm:"index"` //数据点
	Value    float64   `json:"value"`              //值
	Time     time.Time `json:"time"`
}

type Options added in v4.0.18

type Options map[string]any

func (Options) Bool added in v4.0.18

func (o Options) Bool(name string, def bool) bool

func (Options) Float64 added in v4.0.18

func (o Options) Float64(name string, def float64) float64

func (Options) Int added in v4.0.18

func (o Options) Int(name string, def int) int

func (Options) Int64 added in v4.0.18

func (o Options) Int64(name string, def int64) int64

type Parameters

type Parameters map[string]float64

type Time

type Time time.Time

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) MarshalText

func (t *Time) MarshalText() ([]byte, error)

func (*Time) Now

func (t *Time) Now() Time

func (*Time) ParseTime

func (t *Time) ParseTime(tm time.Time) Time

func (*Time) String

func (t *Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

type Type

type Type int

Type 数据类型

const (
	//TypeNONE 空类型
	TypeNONE Type = iota
	TypeBIT
	TypeBYTE
	TypeWORD
	TypeDWORD
	TypeQWORD
	TypeSHORT
	TypeINTEGER
	TypeLONG
	TypeFLOAT
	TypeDOUBLE
)

func (*Type) Decode

func (dt *Type) Decode(buf []byte, le bool, precision int) (val interface{}, err error)

Decode 解码

func (*Type) Default

func (dt *Type) Default() interface{}

func (*Type) Encode

func (dt *Type) Encode(value interface{}, le bool, precision int) []byte

Encode 编码

func (*Type) MarshalJSON

func (dt *Type) MarshalJSON() ([]byte, error)

MarshalJSON 序列化

func (*Type) Normalize

func (dt *Type) Normalize(val interface{}) interface{}

func (*Type) Parse

func (dt *Type) Parse(tp string) error

Parse 解析类型

func (*Type) Size

func (dt *Type) Size() int

Size 宽度

func (*Type) String

func (dt *Type) String() string

String 转化成字符串

func (*Type) UnmarshalJSON

func (dt *Type) UnmarshalJSON(buf []byte) error

UnmarshalJSON 解析

type Variables

type Variables map[string]any

Jump to

Keyboard shortcuts

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