model

package
v0.0.0-...-886a5b3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SYNC_DEVICE_SUFFIX    = ""
	SYNC_TAG_VALUE_SUFFIX = "_tgv"
)
View Source
const (
	SYNC_USER = "user"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	bun.BaseModel `bun:"attr"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	ClassID       string    `bun:"class_id,type:TEXT" json:"class_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	DataType      string    `bun:"data_type,type:TEXT" json:"data_type"`
	HValue        string    `bun:"h_value,type:TEXT" json:"h_value"`
	LValue        string    `bun:"l_value,type:TEXT" json:"l_value"`
	TagID         string    `bun:"tag_id,type:TEXT" json:"tag_id"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Access        int32     `bun:"access" json:"access"`
	Save          int32     `bun:"save" json:"save"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

func (*Attr) DefaultValue

func (t *Attr) DefaultValue() nson.Value

func (*Attr) ValueTag

func (t *Attr) ValueTag() uint8

type Class

type Class struct {
	bun.BaseModel `bun:"class"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Save          int32     `bun:"save" json:"save"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type Const

type Const struct {
	bun.BaseModel `bun:"const"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	DataType      string    `bun:"data_type,type:TEXT" json:"data_type"`
	Value         string    `bun:"value,type:TEXT" json:"value"`
	HValue        string    `bun:"h_value,type:TEXT" json:"h_value"`
	LValue        string    `bun:"l_value,type:TEXT" json:"l_value"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Access        int32     `bun:"access" json:"access"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

func (*Const) DefaultValue

func (t *Const) DefaultValue() nson.Value

func (*Const) ValueTag

func (t *Const) ValueTag() uint8

type Device

type Device struct {
	bun.BaseModel `bun:"device"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Arch          string    `bun:"arch,type:TEXT" json:"arch"`
	Secret        string    `bun:"secret,type:TEXT" json:"secret"`
	Location      string    `bun:"location,type:TEXT" json:"location"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type Fn

type Fn struct {
	bun.BaseModel `bun:"fn"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Exec          string    `bun:"exec,type:TEXT" json:"exec"`
	Main          string    `bun:"main,type:TEXT" json:"main"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Debug         int32     `bun:"debug" json:"debug"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type Logic

type Logic struct {
	bun.BaseModel `bun:"logic"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Exec          string    `bun:"exec,type:TEXT" json:"exec"`
	Main          string    `bun:"main,type:TEXT" json:"main"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type Option

type Option struct {
	bun.BaseModel `bun:"option"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Value         string    `bun:"value,type:TEXT" json:"value"`
	Status        int32     `bun:"status" json:"status"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type Slot

type Slot struct {
	bun.BaseModel `bun:"slot"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Secret        string    `bun:"secret,type:TEXT" json:"secret"`
	Location      string    `bun:"location,type:TEXT" json:"location"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type Source

type Source struct {
	bun.BaseModel `bun:"source"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Source        string    `bun:"source,type:TEXT" json:"source"`
	Params        string    `bun:"params,type:TEXT" json:"params"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Save          int32     `bun:"save" json:"save"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type Sync

type Sync struct {
	bun.BaseModel `bun:"sync"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type SyncGlobal

type SyncGlobal struct {
	bun.BaseModel `bun:"sync_global"`
	Key           string    `bun:"type:TEXT,pk" json:"key"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type Tag

type Tag struct {
	bun.BaseModel `bun:"tag"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	SourceID      string    `bun:"source_id,type:TEXT" json:"source_id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	DataType      string    `bun:"data_type,type:TEXT" json:"data_type"`
	Address       string    `bun:"address,type:TEXT" json:"address"`
	HValue        string    `bun:"h_value,type:TEXT" json:"h_value"`
	LValue        string    `bun:"l_value,type:TEXT" json:"l_value"`
	Config        string    `bun:"config,type:TEXT" json:"config"`
	Status        int32     `bun:"status" json:"status"`
	Access        int32     `bun:"access" json:"access"`
	Save          int32     `bun:"save" json:"save"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

func (*Tag) DefaultValue

func (t *Tag) DefaultValue() nson.Value

func (*Tag) ValueTag

func (t *Tag) ValueTag() uint8

type TagValue

type TagValue struct {
	bun.BaseModel `bun:"tag_value"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	DeviceID      string    `bun:"device_id,type:TEXT" json:"device_id"`
	SourceID      string    `bun:"source_id,type:TEXT" json:"source_id"`
	Value         string    `bun:"value,type:TEXT" json:"value"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

type User

type User struct {
	bun.BaseModel `bun:"user"`
	ID            string    `bun:"type:TEXT,pk" json:"id"`
	Name          string    `bun:"name,type:TEXT" json:"name"`
	Desc          string    `bun:"desc,type:TEXT" json:"desc"`
	Tags          string    `bun:"tags,type:TEXT" json:"tags"`
	Type          string    `bun:"type,type:TEXT" json:"type"`
	Pass          string    `bun:"pass,type:TEXT" json:"pass"`
	Role          string    `bun:"role,type:TEXT" json:"role"`
	Status        int32     `bun:"status" json:"status"`
	Deleted       time.Time `bun:"deleted,soft_delete" json:"-"`
	Created       time.Time `bun:"created" json:"created"`
	Updated       time.Time `bun:"updated" json:"updated"`
}

Jump to

Keyboard shortcuts

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