relationDB

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate added in v0.6.0

func Migrate() error

func NewShadowRepo

func NewShadowRepo(in any) shadow.Repo

func ToShadowDo

func ToShadowDo(in *DiDeviceShadow) *shadow.Info

func ToShadowsDo

func ToShadowsDo(in []*DiDeviceShadow) []*shadow.Info

Types

type DiDeviceShadow

type DiDeviceShadow struct {
	ID                int64      `gorm:"column:id;type:BIGINT;primary_key;AUTO_INCREMENT"`
	ProductID         string     `gorm:"column:product_id;uniqueIndex:pi_dn_di;type:CHAR(11);NOT NULL"`
	DeviceName        string     `gorm:"column:device_name;uniqueIndex:pi_dn_di;type:VARCHAR(100);NOT NULL"`
	DataID            string     `gorm:"column:data_id;uniqueIndex:pi_dn_di;type:VARCHAR(100);NOT NULL"`
	Value             string     `gorm:"column:value;type:VARCHAR(100);default:NULL"`
	UpdatedDeviceTime *time.Time `gorm:"column:updated_device_time;default:NULL"`
	stores.Time
}

设备影子表

func ToShadowPo

func ToShadowPo(info *shadow.Info) *DiDeviceShadow

func (*DiDeviceShadow) TableName

func (m *DiDeviceShadow) TableName() string

type ShadowRepo

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

func (*ShadowRepo) FindByFilter

func (p *ShadowRepo) FindByFilter(ctx context.Context, f shadow.Filter) ([]*shadow.Info, error)

func (*ShadowRepo) MultiDelete

func (p *ShadowRepo) MultiDelete(ctx context.Context, f shadow.Filter) error

func (*ShadowRepo) MultiUpdate

func (p *ShadowRepo) MultiUpdate(ctx context.Context, data []*shadow.Info) error

Jump to

Keyboard shortcuts

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