adaptors

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.5.0

type Action struct {
	IAction
	// contains filtered or unexported fields
}

Action ...

func (*Action) Add added in v0.12.0

func (n *Action) Add(ctx context.Context, ver *m.Action) (id int64, err error)

Add ...

func (*Action) Delete added in v0.12.0

func (n *Action) Delete(ctx context.Context, deviceId int64) (err error)

Delete ...

func (*Action) GetById added in v0.12.0

func (n *Action) GetById(ctx context.Context, id int64) (metric *m.Action, err error)

GetById ...

func (*Action) GetByIdWithData added in v0.12.0

func (n *Action) GetByIdWithData(ctx context.Context, id int64, from, to *time.Time, metricRange *string) (metric *m.Action, err error)

GetByIdWithData ...

func (*Action) List added in v0.12.0

func (n *Action) List(ctx context.Context, limit, offset int64, orderBy, sort string, ids *[]uint64) (list []*m.Action, total int64, err error)

List ...

func (*Action) Search added in v0.12.0

func (n *Action) Search(ctx context.Context, query string, limit, offset int) (list []*m.Action, total int64, err error)

Search ...

func (*Action) Update added in v0.12.0

func (n *Action) Update(ctx context.Context, ver *m.Action) error

Update ...

type Adaptors

type Adaptors struct {
	Script            IScript
	Tag               ITag
	Role              IRole
	Permission        IPermission
	User              IUser
	UserMeta          IUserMeta
	UserDevice        IUserDevice
	Image             IImage
	Variable          IVariable
	Entity            IEntity
	EntityState       IEntityState
	EntityAction      IEntityAction
	EntityStorage     IEntityStorage
	Log               ILog
	Template          ITemplate
	Message           IMessage
	MessageDelivery   IMessageDelivery
	Zigbee2mqtt       IZigbee2mqtt
	Zigbee2mqttDevice IZigbee2mqttDevice
	AlexaSkill        IAlexaSkill
	AlexaIntent       IAlexaIntent
	Metric            IMetric
	MetricBucket      IMetricBucket
	Area              IArea
	Action            IAction
	Condition         ICondition
	Trigger           ITrigger
	Task              ITask
	RunHistory        IRunHistory
	Plugin            IPlugin
	TelegramChat      ITelegramChat
	Dashboard         IDashboard
	DashboardTab      IDashboardTab
	DashboardCard     IDashboardCard
	DashboardCardItem IDashboardCardItem
	ScriptVersion     IScriptVersion
	// contains filtered or unexported fields
}

Adaptors ...

func NewAdaptors

func NewAdaptors(lc fx.Lifecycle,
	db *gorm.DB,
	cfg *models.AppConfig,
	migrations *migrations.Migrations,
	orm *orm.Orm) (adaptors *Adaptors)

NewAdaptors ...

func (Adaptors) Begin added in v0.1.0

func (a Adaptors) Begin() (adaptors *Adaptors)

Begin ...

func (*Adaptors) Commit added in v0.1.0

func (a *Adaptors) Commit() error

Commit ...

func (*Adaptors) Rollback added in v0.1.0

func (a *Adaptors) Rollback() error

Rollback ...

type AlexaIntent added in v0.3.0

type AlexaIntent struct {
	IAlexaIntent
	// contains filtered or unexported fields
}

AlexaIntent ...

func (*AlexaIntent) Add added in v0.3.0

func (n *AlexaIntent) Add(ctx context.Context, ver *m.AlexaIntent) error

Add ...

func (*AlexaIntent) Delete added in v0.3.0

func (n *AlexaIntent) Delete(ctx context.Context, ver *m.AlexaIntent) (err error)

Delete ...

func (*AlexaIntent) GetByName added in v0.3.0

func (n *AlexaIntent) GetByName(ctx context.Context, name string) (ver *m.AlexaIntent, err error)

GetByName ...

func (*AlexaIntent) Update added in v0.3.0

func (n *AlexaIntent) Update(ctx context.Context, ver *m.AlexaIntent) (err error)

Update ...

type AlexaSkill added in v0.3.0

type AlexaSkill struct {
	IAlexaSkill
	// contains filtered or unexported fields
}

AlexaSkill ...

func (*AlexaSkill) Add added in v0.3.0

func (n *AlexaSkill) Add(ctx context.Context, app *m.AlexaSkill) (id int64, err error)

Add ...

func (*AlexaSkill) Delete added in v0.3.0

func (n *AlexaSkill) Delete(ctx context.Context, appId int64) (err error)

Delete ...

func (*AlexaSkill) GetById added in v0.3.0

func (n *AlexaSkill) GetById(ctx context.Context, appId int64) (app *m.AlexaSkill, err error)

GetById ...

func (*AlexaSkill) List added in v0.3.0

func (n *AlexaSkill) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.AlexaSkill, total int64, err error)

List ...

func (*AlexaSkill) ListEnabled added in v0.3.0

func (n *AlexaSkill) ListEnabled(ctx context.Context, limit, offset int64) (list []*m.AlexaSkill, err error)

ListEnabled ...

func (*AlexaSkill) Update added in v0.3.0

func (n *AlexaSkill) Update(ctx context.Context, params *m.AlexaSkill) (err error)

Update ...

type Area added in v0.5.0

type Area struct {
	IArea
	// contains filtered or unexported fields
}

Area ...

func (*Area) Add added in v0.5.0

func (a *Area) Add(ctx context.Context, ver *m.Area) (id int64, err error)

Add ...

func (*Area) DeleteByName added in v0.5.0

func (a *Area) DeleteByName(ctx context.Context, name string) (err error)

DeleteByName ...

func (*Area) GetById added in v0.5.0

func (a *Area) GetById(ctx context.Context, verId int64) (ver *m.Area, err error)

GetById ...

func (*Area) GetByName added in v0.5.0

func (a *Area) GetByName(ctx context.Context, name string) (ver *m.Area, err error)

GetByName ...

func (*Area) List added in v0.5.0

func (a *Area) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Area, total int64, err error)

List ...

func (*Area) Search added in v0.5.0

func (a *Area) Search(ctx context.Context, query string, limit, offset int64) (list []*m.Area, total int64, err error)

Search ...

func (*Area) Update added in v0.5.0

func (a *Area) Update(ctx context.Context, ver *m.Area) (err error)

Update ...

type Condition added in v0.5.0

type Condition struct {
	ICondition
	// contains filtered or unexported fields
}

Condition ...

func (*Condition) Add added in v0.12.0

func (n *Condition) Add(ctx context.Context, ver *m.Condition) (id int64, err error)

Add ...

func (*Condition) Delete added in v0.12.0

func (n *Condition) Delete(ctx context.Context, deviceId int64) (err error)

Delete ...

func (*Condition) GetById added in v0.12.0

func (n *Condition) GetById(ctx context.Context, id int64) (metric *m.Condition, err error)

GetById ...

func (*Condition) GetByIdWithData added in v0.12.0

func (n *Condition) GetByIdWithData(ctx context.Context, id int64, from, to *time.Time, metricRange *string) (metric *m.Condition, err error)

GetByIdWithData ...

func (*Condition) List added in v0.12.0

func (n *Condition) List(ctx context.Context, limit, offset int64, orderBy, sort string, ids *[]uint64) (list []*m.Condition, total int64, err error)

List ...

func (*Condition) Search added in v0.12.0

func (n *Condition) Search(ctx context.Context, query string, limit, offset int) (list []*m.Condition, total int64, err error)

Search ...

func (*Condition) Update added in v0.12.0

func (n *Condition) Update(ctx context.Context, ver *m.Condition) error

Update ...

type Dashboard added in v0.6.0

type Dashboard struct {
	IDashboard
	// contains filtered or unexported fields
}

Dashboard ...

func (*Dashboard) Add added in v0.6.0

func (n *Dashboard) Add(ctx context.Context, ver *m.Dashboard) (id int64, err error)

Add ...

func (*Dashboard) Delete added in v0.6.0

func (n *Dashboard) Delete(ctx context.Context, id int64) (err error)

Delete ...

func (*Dashboard) GetById added in v0.6.0

func (n *Dashboard) GetById(ctx context.Context, mapId int64) (ver *m.Dashboard, err error)

GetById ...

func (*Dashboard) Import added in v0.6.0

func (n *Dashboard) Import(ctx context.Context, ver *m.Dashboard) (boardId int64, err error)

Import ...

func (*Dashboard) List added in v0.6.0

func (n *Dashboard) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Dashboard, total int64, err error)

List ...

func (*Dashboard) Search added in v0.7.0

func (n *Dashboard) Search(ctx context.Context, query string, limit, offset int64) (list []*m.Dashboard, total int64, err error)

Search ...

func (*Dashboard) Update added in v0.6.0

func (n *Dashboard) Update(ctx context.Context, ver *m.Dashboard) (err error)

Update ...

type DashboardCard added in v0.6.0

type DashboardCard struct {
	IDashboardCard
	// contains filtered or unexported fields
}

DashboardCard ...

func (*DashboardCard) Add added in v0.6.0

func (n *DashboardCard) Add(ctx context.Context, ver *m.DashboardCard) (id int64, err error)

Add ...

func (*DashboardCard) Delete added in v0.6.0

func (n *DashboardCard) Delete(ctx context.Context, id int64) (err error)

Delete ...

func (*DashboardCard) GetById added in v0.6.0

func (n *DashboardCard) GetById(ctx context.Context, mapId int64) (ver *m.DashboardCard, err error)

GetById ...

func (*DashboardCard) Import added in v0.6.0

func (n *DashboardCard) Import(ctx context.Context, card *m.DashboardCard) (cardId int64, err error)

Import ...

func (*DashboardCard) List added in v0.6.0

func (n *DashboardCard) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.DashboardCard, total int64, err error)

List ...

func (*DashboardCard) Update added in v0.6.0

func (n *DashboardCard) Update(ctx context.Context, ver *m.DashboardCard) (err error)

Update ...

type DashboardCardItem added in v0.6.0

type DashboardCardItem struct {
	IDashboardCardItem
	// contains filtered or unexported fields
}

DashboardCardItem ...

func (*DashboardCardItem) Add added in v0.6.0

func (n *DashboardCardItem) Add(ctx context.Context, ver *m.DashboardCardItem) (id int64, err error)

Add ...

func (*DashboardCardItem) Delete added in v0.6.0

func (n *DashboardCardItem) Delete(ctx context.Context, id int64) (err error)

Delete ...

func (*DashboardCardItem) GetById added in v0.6.0

func (n *DashboardCardItem) GetById(ctx context.Context, mapId int64) (ver *m.DashboardCardItem, err error)

GetById ...

func (*DashboardCardItem) List added in v0.6.0

func (n *DashboardCardItem) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.DashboardCardItem, total int64, err error)

List ...

func (*DashboardCardItem) Update added in v0.6.0

func (n *DashboardCardItem) Update(ctx context.Context, ver *m.DashboardCardItem) (err error)

Update ...

type DashboardTab added in v0.6.0

type DashboardTab struct {
	IDashboardTab
	// contains filtered or unexported fields
}

DashboardTab ...

func (*DashboardTab) Add added in v0.6.0

func (n *DashboardTab) Add(ctx context.Context, ver *m.DashboardTab) (id int64, err error)

Add ...

func (*DashboardTab) Delete added in v0.6.0

func (n *DashboardTab) Delete(ctx context.Context, id int64) (err error)

Delete ...

func (*DashboardTab) GetById added in v0.6.0

func (n *DashboardTab) GetById(ctx context.Context, mapId int64) (ver *m.DashboardTab, err error)

GetById ...

func (*DashboardTab) Import added in v0.17.0

func (n *DashboardTab) Import(ctx context.Context, tab *m.DashboardTab) (tabId int64, err error)

Import ...

func (*DashboardTab) List added in v0.6.0

func (n *DashboardTab) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.DashboardTab, total int64, err error)

List ...

func (*DashboardTab) Update added in v0.6.0

func (n *DashboardTab) Update(ctx context.Context, ver *m.DashboardTab) (err error)

Update ...

type Entity added in v0.5.0

type Entity struct {
	IEntity
	// contains filtered or unexported fields
}

Entity ...

func (*Entity) Add added in v0.5.0

func (n *Entity) Add(ctx context.Context, ver *m.Entity) (err error)

Add ...

func (*Entity) Delete added in v0.5.0

func (n *Entity) Delete(ctx context.Context, id common.EntityId) (err error)

Delete ...

func (*Entity) GetById added in v0.5.0

func (n *Entity) GetById(ctx context.Context, id common.EntityId, preloadMetric ...bool) (ver *m.Entity, err error)

GetById ...

func (*Entity) GetByIds added in v0.6.0

func (n *Entity) GetByIds(ctx context.Context, ids []common.EntityId, preloadMetric ...bool) (list []*m.Entity, err error)

GetByIds ...

func (*Entity) GetByIdsSimple added in v0.12.0

func (n *Entity) GetByIdsSimple(ctx context.Context, ids []common.EntityId) (list []*m.Entity, err error)

GetByIdsSimple ...

func (*Entity) GetByType added in v0.5.0

func (n *Entity) GetByType(ctx context.Context, t string, limit, offset int64) (list []*m.Entity, err error)

GetByType ...

func (*Entity) Import added in v0.7.2

func (n *Entity) Import(ctx context.Context, ver *m.Entity) (err error)

Import ...

func (*Entity) List added in v0.5.0

func (n *Entity) List(ctx context.Context, limit, offset int64, orderBy, sort string, autoLoad bool, query, plugin *string, areaId *int64) (list []*m.Entity, total int64, err error)

List ...

func (*Entity) ListPlain added in v0.14.0

func (n *Entity) ListPlain(ctx context.Context, limit, offset int64, orderBy, sort string, autoLoad bool, query,
	plugin *string, areaId *int64, tags *[]string) (list []*m.Entity, total int64, err error)

ListPlain ...

func (*Entity) Search added in v0.5.0

func (n *Entity) Search(ctx context.Context, query string, limit, offset int64) (list []*m.Entity, total int64, err error)

Search ...

func (*Entity) Statistic added in v0.17.0

func (n *Entity) Statistic(ctx context.Context) (statistic *m.EntitiesStatistic, err error)

func (*Entity) Update added in v0.5.0

func (n *Entity) Update(ctx context.Context, ver *m.Entity) (err error)

Update ...

func (*Entity) UpdateAutoload added in v0.12.0

func (n *Entity) UpdateAutoload(ctx context.Context, entityId common.EntityId, autoLoad bool) (err error)

UpdateAutoload ...

type EntityAction added in v0.5.0

type EntityAction struct {
	IEntityAction
	// contains filtered or unexported fields
}

EntityAction ...

func (*EntityAction) Add added in v0.5.0

func (n *EntityAction) Add(ctx context.Context, ver *m.EntityAction) (id int64, err error)

Add ...

func (*EntityAction) AddMultiple added in v0.5.0

func (n *EntityAction) AddMultiple(ctx context.Context, items []*m.EntityAction) (err error)

AddMultiple ...

func (*EntityAction) DeleteByEntityId added in v0.5.0

func (n *EntityAction) DeleteByEntityId(ctx context.Context, id common.EntityId) (err error)

DeleteByEntityId ...

type EntityState added in v0.5.0

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

EntityState ...

func (*EntityState) Add added in v0.5.0

func (n *EntityState) Add(ctx context.Context, ver *m.EntityState) (id int64, err error)

Add ...

func (*EntityState) AddMultiple added in v0.5.0

func (n *EntityState) AddMultiple(ctx context.Context, items []*m.EntityState) (err error)

AddMultiple ...

func (*EntityState) DeleteByEntityId added in v0.5.0

func (n *EntityState) DeleteByEntityId(ctx context.Context, entityId common.EntityId) (err error)

DeleteByEntityId ...

type EntityStorage added in v0.5.0

type EntityStorage struct {
	IEntityStorage
	// contains filtered or unexported fields
}

EntityStorage ...

func (*EntityStorage) Add added in v0.5.0

func (n *EntityStorage) Add(ctx context.Context, ver *m.EntityStorage) (id int64, err error)

Add ...

func (*EntityStorage) DeleteOldest added in v0.9.4

func (n *EntityStorage) DeleteOldest(ctx context.Context, days int) (err error)

DeleteOldest ...

func (*EntityStorage) GetLastByEntityId added in v0.5.0

func (n *EntityStorage) GetLastByEntityId(ctx context.Context, entityId common.EntityId) (ver *m.EntityStorage, err error)

GetLastByEntityId ...

func (*EntityStorage) GetLastThreeById added in v0.18.2

func (n *EntityStorage) GetLastThreeById(ctx context.Context, entityId common.EntityId, id int64) (list []*m.EntityStorage, err error)

GetLastThreeById ...

func (*EntityStorage) List added in v0.5.0

func (n *EntityStorage) List(ctx context.Context, limit, offset int64, orderBy, sort string, entityIds []common.EntityId, startDate, endDate *time.Time) (list []*m.EntityStorage, total int64, err error)

List ...

type IAction added in v0.5.0

type IAction interface {
	Add(ctx context.Context, ver *m.Action) (id int64, err error)
	GetById(ctx context.Context, id int64) (metric *m.Action, err error)
	Update(ctx context.Context, ver *m.Action) error
	Delete(ctx context.Context, deviceId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, ids *[]uint64) (list []*m.Action, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int) (list []*m.Action, total int64, err error)
	// contains filtered or unexported methods
}

IAction ...

func GetActionAdaptor added in v0.5.0

func GetActionAdaptor(d *gorm.DB, orm *orm.Orm) IAction

GetActionAdaptor ...

type IAlexaIntent added in v0.5.0

type IAlexaIntent interface {
	Add(ctx context.Context, ver *m.AlexaIntent) (err error)
	GetByName(ctx context.Context, name string) (ver *m.AlexaIntent, err error)
	Update(ctx context.Context, ver *m.AlexaIntent) (err error)
	Delete(ctx context.Context, ver *m.AlexaIntent) (err error)
	// contains filtered or unexported methods
}

IAlexaIntent ...

func GetAlexaIntentAdaptor added in v0.3.0

func GetAlexaIntentAdaptor(d *gorm.DB) IAlexaIntent

GetAlexaIntentAdaptor ...

type IAlexaSkill added in v0.5.0

type IAlexaSkill interface {
	Add(ctx context.Context, app *m.AlexaSkill) (id int64, err error)
	GetById(ctx context.Context, appId int64) (app *m.AlexaSkill, err error)
	Update(ctx context.Context, params *m.AlexaSkill) (err error)
	Delete(ctx context.Context, appId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.AlexaSkill, total int64, err error)
	ListEnabled(ctx context.Context, limit, offset int64) (list []*m.AlexaSkill, err error)
	// contains filtered or unexported methods
}

IAlexaSkill ...

func GetAlexaSkillAdaptor added in v0.3.0

func GetAlexaSkillAdaptor(d *gorm.DB) IAlexaSkill

GetAlexaSkillAdaptor ...

type IArea added in v0.5.0

type IArea interface {
	Add(ctx context.Context, ver *m.Area) (id int64, err error)
	GetById(ctx context.Context, verId int64) (ver *m.Area, err error)
	GetByName(ctx context.Context, name string) (ver *m.Area, err error)
	Update(ctx context.Context, ver *m.Area) (err error)
	DeleteByName(ctx context.Context, name string) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Area, total int64, err error)
	//ListByPoint(ctx context.Context, point m.Point, limit, offset int64) (list []*m.Area, err error)
	Search(ctx context.Context, query string, limit, offset int64) (list []*m.Area, total int64, err error)
	// contains filtered or unexported methods
}

IArea ...

func GetAreaAdaptor added in v0.5.0

func GetAreaAdaptor(d *gorm.DB) IArea

GetAreaAdaptor ...

type ICondition added in v0.5.0

type ICondition interface {
	Add(ctx context.Context, ver *m.Condition) (id int64, err error)
	GetById(ctx context.Context, id int64) (metric *m.Condition, err error)
	Update(ctx context.Context, ver *m.Condition) error
	Delete(ctx context.Context, deviceId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, ids *[]uint64) (list []*m.Condition, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int) (list []*m.Condition, total int64, err error)
	// contains filtered or unexported methods
}

ICondition ...

func GetConditionAdaptor added in v0.5.0

func GetConditionAdaptor(d *gorm.DB) ICondition

GetConditionAdaptor ...

type IDashboard added in v0.6.0

type IDashboard interface {
	Add(ctx context.Context, ver *m.Dashboard) (id int64, err error)
	GetById(ctx context.Context, mapId int64) (ver *m.Dashboard, err error)
	Update(ctx context.Context, ver *m.Dashboard) (err error)
	Import(ctx context.Context, dashboard *m.Dashboard) (int64, error)
	Delete(ctx context.Context, id int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Dashboard, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int64) (list []*m.Dashboard, total int64, err error)
}

func GetDashboardAdaptor added in v0.6.0

func GetDashboardAdaptor(d *gorm.DB) IDashboard

GetDashboardAdaptor ...

type IDashboardCard added in v0.6.0

type IDashboardCard interface {
	Add(ctx context.Context, ver *m.DashboardCard) (id int64, err error)
	GetById(ctx context.Context, mapId int64) (ver *m.DashboardCard, err error)
	Update(ctx context.Context, ver *m.DashboardCard) (err error)
	Delete(ctx context.Context, id int64) (err error)
	Import(ctx context.Context, card *m.DashboardCard) (cardId int64, err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.DashboardCard, total int64, err error)
	// contains filtered or unexported methods
}

func GetDashboardCardAdaptor added in v0.6.0

func GetDashboardCardAdaptor(d *gorm.DB) IDashboardCard

GetDashboardCardAdaptor ...

type IDashboardCardItem added in v0.6.0

type IDashboardCardItem interface {
	Add(ctx context.Context, ver *m.DashboardCardItem) (id int64, err error)
	GetById(ctx context.Context, mapId int64) (ver *m.DashboardCardItem, err error)
	Update(ctx context.Context, ver *m.DashboardCardItem) (err error)
	Delete(ctx context.Context, id int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.DashboardCardItem, total int64, err error)
	// contains filtered or unexported methods
}

func GetDashboardCardItemAdaptor added in v0.6.0

func GetDashboardCardItemAdaptor(d *gorm.DB) IDashboardCardItem

GetDashboardCardItemAdaptor ...

type IDashboardTab added in v0.6.0

type IDashboardTab interface {
	Add(ctx context.Context, ver *m.DashboardTab) (id int64, err error)
	GetById(ctx context.Context, mapId int64) (ver *m.DashboardTab, err error)
	Update(ctx context.Context, ver *m.DashboardTab) (err error)
	Delete(ctx context.Context, id int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.DashboardTab, total int64, err error)
	Import(ctx context.Context, ver *m.DashboardTab) (tabId int64, err error)
	// contains filtered or unexported methods
}

func GetDashboardTabAdaptor added in v0.6.0

func GetDashboardTabAdaptor(d *gorm.DB) IDashboardTab

GetDashboardTabAdaptor ...

type IEntity added in v0.5.0

type IEntity interface {
	Add(ctx context.Context, ver *m.Entity) (err error)
	GetById(ctx context.Context, id common.EntityId, preloadMetric ...bool) (ver *m.Entity, err error)
	GetByIds(ctx context.Context, ids []common.EntityId, preloadMetric ...bool) (ver []*m.Entity, err error)
	GetByIdsSimple(ctx context.Context, ids []common.EntityId) (list []*m.Entity, err error)
	Delete(ctx context.Context, id common.EntityId) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, autoLoad bool, query, plugin *string,
		areaId *int64) (list []*m.Entity, total int64, err error)
	ListPlain(ctx context.Context, limit, offset int64, orderBy, sort string, autoLoad bool, query, plugin *string,
		areaId *int64, tags *[]string) (list []*m.Entity, total int64, err error)
	GetByType(ctx context.Context, t string, limit, offset int64) (list []*m.Entity, err error)
	Update(ctx context.Context, ver *m.Entity) (err error)
	Search(ctx context.Context, query string, limit, offset int64) (list []*m.Entity, total int64, err error)
	UpdateAutoload(ctx context.Context, entityId common.EntityId, autoLoad bool) (err error)
	Statistic(ctx context.Context) (statistic *m.EntitiesStatistic, err error)
	Import(ctx context.Context, entity *m.Entity) (err error)
	// contains filtered or unexported methods
}

IEntity ...

func GetEntityAdaptor added in v0.5.0

func GetEntityAdaptor(d *gorm.DB, orm *orm.Orm) IEntity

GetEntityAdaptor ...

type IEntityAction added in v0.5.0

type IEntityAction interface {
	Add(ctx context.Context, ver *m.EntityAction) (id int64, err error)
	DeleteByEntityId(ctx context.Context, id common.EntityId) (err error)
	AddMultiple(ctx context.Context, items []*m.EntityAction) (err error)
	// contains filtered or unexported methods
}

IEntityAction ...

func GetEntityActionAdaptor added in v0.5.0

func GetEntityActionAdaptor(d *gorm.DB) IEntityAction

GetEntityActionAdaptor ...

type IEntityState added in v0.5.0

type IEntityState interface {
	Add(ctx context.Context, ver *m.EntityState) (id int64, err error)
	DeleteByEntityId(ctx context.Context, entityId common.EntityId) (err error)
	AddMultiple(ctx context.Context, items []*m.EntityState) (err error)
	// contains filtered or unexported methods
}

IEntityState ...

func GetEntityStateAdaptor added in v0.5.0

func GetEntityStateAdaptor(d *gorm.DB) IEntityState

GetEntityStateAdaptor ...

type IEntityStorage added in v0.5.0

type IEntityStorage interface {
	Add(ctx context.Context, ver *m.EntityStorage) (id int64, err error)
	GetLastByEntityId(ctx context.Context, entityId common.EntityId) (ver *m.EntityStorage, err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string,
		entityIds []common.EntityId,
		startDate, endDate *time.Time) (list []*m.EntityStorage, total int64, err error)
	GetLastThreeById(ctx context.Context, entityId common.EntityId, id int64) (list []*m.EntityStorage, err error)
	DeleteOldest(ctx context.Context, days int) (err error)
	// contains filtered or unexported methods
}

IEntityStorage ...

func GetEntityStorageAdaptor added in v0.5.0

func GetEntityStorageAdaptor(d *gorm.DB) IEntityStorage

GetEntityStorageAdaptor ...

type IImage added in v0.5.0

type IImage interface {
	Add(ctx context.Context, ver *m.Image) (id int64, err error)
	GetByImageName(ctx context.Context, imageName string) (ver *m.Image, err error)
	GetById(ctx context.Context, mapId int64) (ver *m.Image, err error)
	Update(ctx context.Context, ver *m.Image) (err error)
	Delete(ctx context.Context, mapId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Image, total int64, err error)
	AddMultiple(ctx context.Context, items []*m.Image) (err error)
	GetAllByDate(ctx context.Context, filter string) (images []*m.Image, err error)
	GetFilterList(ctx context.Context) (filterList []*m.ImageFilterList, err error)
	// contains filtered or unexported methods
}

IImage ...

func GetImageAdaptor

func GetImageAdaptor(d *gorm.DB) IImage

GetImageAdaptor ...

type ILog added in v0.5.0

type ILog interface {
	Add(ctx context.Context, ver *m.Log) (id int64, err error)
	AddMultiple(ctx context.Context, items []*m.Log) (err error)
	GetById(ctx context.Context, verId int64) (ver *m.Log, err error)
	Delete(ctx context.Context, verId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, queryObj *m.LogQuery) (list []*m.Log, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int) (list []*m.Log, total int64, err error)
	DeleteOldest(ctx context.Context, days int) (err error)
	// contains filtered or unexported methods
}

ILog ...

func GetLogAdaptor

func GetLogAdaptor(d *gorm.DB) ILog

GetLogAdaptor ...

type IMessage added in v0.5.0

type IMessage interface {
	Add(ctx context.Context, msg *m.Message) (id int64, err error)
	// contains filtered or unexported methods
}

IMessage ...

func GetMessageAdaptor added in v0.0.17

func GetMessageAdaptor(d *gorm.DB) IMessage

GetMessageAdaptor ...

type IMessageDelivery added in v0.5.0

type IMessageDelivery interface {
	Add(ctx context.Context, msg *m.MessageDelivery) (id int64, err error)
	SetStatus(ctx context.Context, msg *m.MessageDelivery) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, query *m.MessageDeliveryQuery) (list []*m.MessageDelivery, total int64, err error)
	GetAllUncompleted(ctx context.Context, limit, offset int64) (list []*m.MessageDelivery, total int64, err error)
	Delete(ctx context.Context, id int64) (err error)
	GetById(ctx context.Context, id int64) (ver *m.MessageDelivery, err error)
	// contains filtered or unexported methods
}

IMessageDelivery ...

func GetMessageDeliveryAdaptor added in v0.0.17

func GetMessageDeliveryAdaptor(d *gorm.DB) IMessageDelivery

GetMessageDeliveryAdaptor ...

type IMetric added in v0.5.0

type IMetric interface {
	Add(ctx context.Context, ver *m.Metric) (id int64, err error)
	GetByIdWithData(ctx context.Context, id int64, from, to *time.Time, metricRange *common.MetricRange) (metric *m.Metric, err error)
	Update(ctx context.Context, ver *m.Metric) error
	Delete(ctx context.Context, deviceId int64) (err error)
	AddMultiple(ctx context.Context, items []*m.Metric) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Metric, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int) (list []*m.Metric, total int64, err error)
	// contains filtered or unexported methods
}

IMetric ...

func GetMetricAdaptor added in v0.5.0

func GetMetricAdaptor(d *gorm.DB, orm *orm.Orm) IMetric

GetMetricAdaptor ...

type IMetricBucket added in v0.5.0

type IMetricBucket interface {
	Add(ctx context.Context, ver *m.MetricDataItem) error
	AddMultiple(ctx context.Context, items []*m.MetricDataItem) (err error)
	List(ctx context.Context, from, to *time.Time, metricId int64, optionItems []string, metricRange *common.MetricRange) (list []*m.MetricDataItem, err error)
	DeleteOldest(ctx context.Context, days int) (err error)
	DeleteById(ctx context.Context, id int64) (err error)
	DeleteByMetricId(ctx context.Context, metricId int64) (err error)
	// contains filtered or unexported methods
}

IMetricBucket ...

func GetMetricBucketAdaptor added in v0.5.0

func GetMetricBucketAdaptor(d *gorm.DB, orm *orm.Orm) IMetricBucket

GetMetricBucketAdaptor ...

type IPermission added in v0.5.0

type IPermission interface {
	Add(ctx context.Context, permission *m.Permission) (id int64, err error)
	Delete(ctx context.Context, roleName, packageName string, levelName []string) (err error)
	GetAllPermissions(ctx context.Context, roleName string) (permissions []*m.Permission, err error)
	// contains filtered or unexported methods
}

IPermission ...

func GetPermissionAdaptor

func GetPermissionAdaptor(d *gorm.DB) IPermission

GetPermissionAdaptor ...

type IPlugin added in v0.5.0

type IPlugin interface {
	Add(ctx context.Context, plugin *m.Plugin) error
	CreateOrUpdate(ctx context.Context, ver *m.Plugin) error
	Update(ctx context.Context, plugin *m.Plugin) error
	Delete(ctx context.Context, pluginId string) error
	List(ctx context.Context, limit, offset int64, orderBy, sort string, onlyEnabled bool) (list []*m.Plugin, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int64) (list []*m.Plugin, total int64, err error)
	GetByName(ctx context.Context, name string) (ver *m.Plugin, err error)
	// contains filtered or unexported methods
}

IPlugin ...

func GetPluginAdaptor added in v0.5.0

func GetPluginAdaptor(d *gorm.DB) IPlugin

GetPluginAdaptor ...

type IRole added in v0.5.0

type IRole interface {
	Add(ctx context.Context, role *m.Role) (err error)
	GetByName(ctx context.Context, name string) (role *m.Role, err error)
	Update(ctx context.Context, role *m.Role) (err error)
	Delete(ctx context.Context, name string) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Role, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int64) (list []*m.Role, total int64, err error)
	GetAccessList(ctx context.Context, role *m.Role) (err error)
	// contains filtered or unexported methods
}

IRole ...

func GetRoleAdaptor

func GetRoleAdaptor(d *gorm.DB) IRole

GetRoleAdaptor ...

type IRunHistory added in v0.5.0

type IRunHistory interface {
	Add(sctx context.Context, tory *m.RunStory) (id int64, err error)
	Update(ctx context.Context, story *m.RunStory) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, from *time.Time) (list []*m.RunStory, total int64, err error)
	DeleteOldest(ctx context.Context, days int) (err error)
	// contains filtered or unexported methods
}

IRunHistory ...

func GetRunHistoryAdaptor added in v0.5.0

func GetRunHistoryAdaptor(d *gorm.DB) IRunHistory

GetRunHistoryAdaptor ...

type IScript added in v0.5.0

type IScript interface {
	Add(ctx context.Context, script *m.Script) (id int64, err error)
	GetById(ctx context.Context, scriptId int64) (script *m.Script, err error)
	GetByName(ctx context.Context, name string) (script *m.Script, err error)
	Update(ctx context.Context, script *m.Script) (err error)
	Delete(ctx context.Context, scriptId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, query *string, ids *[]uint64) (list []*m.Script, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int64) (list []*m.Script, total int64, err error)
	Statistic(ctx context.Context) (statistic *m.ScriptsStatistic, err error)
	// contains filtered or unexported methods
}

IScript ...

func GetScriptAdaptor

func GetScriptAdaptor(d *gorm.DB) IScript

GetScriptAdaptor ...

type IScriptVersion added in v0.12.0

type IScriptVersion interface {
	Delete(ctx context.Context, id int64) (err error)
	DeleteOldest(ctx context.Context, days int) (err error)
}

IScriptVersion ...

func GetScriptVersionAdaptor added in v0.12.0

func GetScriptVersionAdaptor(d *gorm.DB) IScriptVersion

GetScriptVersionAdaptor ...

type ITag added in v0.17.0

type ITag interface {
	Add(ctx context.Context, tag *m.Tag) (id int64, err error)
	GetById(ctx context.Context, id int64) (tag *m.Tag, err error)
	GetByName(ctx context.Context, name string) (tag *m.Tag, err error)
	Update(ctx context.Context, tag *m.Tag) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, query *string, names *[]string) (list []*m.Tag, total int64, err error)
	Delete(ctx context.Context, name string) (err error)
	Search(ctx context.Context, query string, limit, offset int64) (list []*m.Tag, total int64, err error)
	// contains filtered or unexported methods
}

ITag ...

func GetTagAdaptor added in v0.17.0

func GetTagAdaptor(d *gorm.DB) ITag

GetTagAdaptor ...

type ITask added in v0.5.0

type ITask interface {
	Add(ctx context.Context, ver *m.NewTask) (id int64, err error)
	Import(ctx context.Context, ver *m.Task) (err error)
	Update(ctx context.Context, ver *m.UpdateTask) (err error)
	Delete(ctx context.Context, id int64) (err error)
	GetById(ctx context.Context, id int64) (task *m.Task, err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, onlyEnabled bool) (list []*m.Task, total int64, err error)
	Enable(ctx context.Context, id int64) (err error)
	Disable(ctx context.Context, id int64) (err error)
	// contains filtered or unexported methods
}

ITask ...

func GetTaskAdaptor added in v0.5.0

func GetTaskAdaptor(d *gorm.DB, orm *orm.Orm) ITask

GetTaskAdaptor ...

type ITelegramChat added in v0.5.0

type ITelegramChat interface {
	Add(ctx context.Context, plugin m.TelegramChat) (err error)
	Delete(ctx context.Context, entityId common.EntityId, channelId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, entityId common.EntityId) (list []m.TelegramChat, total int64, err error)
	// contains filtered or unexported methods
}

ITelegramChat ...

func GetTelegramChannelAdaptor added in v0.5.0

func GetTelegramChannelAdaptor(d *gorm.DB) ITelegramChat

GetTelegramChannelAdaptor ...

type ITemplate added in v0.5.0

type ITemplate interface {
	UpdateOrCreate(ctx context.Context, ver *m.Template) (err error)
	Create(ctx context.Context, ver *m.Template) (err error)
	UpdateStatus(ctx context.Context, ver *m.Template) (err error)
	GetList(ctx context.Context, templateType m.TemplateType) (items []*m.Template, err error)
	GetByName(ctx context.Context, name string) (ver *m.Template, err error)
	GetItemByName(ctx context.Context, name string) (ver *m.Template, err error)
	GetItemsSortedList(ctx context.Context) (count int64, items []string, err error)
	Delete(ctx context.Context, name string) (err error)
	GetItemsTree(ctx context.Context) (tree []*m.TemplateTree, err error)
	UpdateItemsTree(ctx context.Context, tree []*m.TemplateTree) (err error)
	Search(ctx context.Context, query string, limit, offset int) (list []*m.Template, total int64, err error)
	GetMarkers(ctx context.Context, template *m.Template) (err error)
	Render(ctx context.Context, name string, params map[string]interface{}) (render *m.TemplateRender, err error)
	// contains filtered or unexported methods
}

ITemplate ...

func GetTemplateAdaptor added in v0.0.17

func GetTemplateAdaptor(d *gorm.DB) ITemplate

GetTemplateAdaptor ...

type ITrigger added in v0.5.0

type ITrigger interface {
	Add(ctx context.Context, ver *m.NewTrigger) (id int64, err error)
	GetById(ctx context.Context, id int64) (metric *m.Trigger, err error)
	Update(ctx context.Context, ver *m.UpdateTrigger) error
	Delete(ctx context.Context, deviceId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, onlyEnabled bool) (list []*m.Trigger, total int64, err error)
	ListPlain(ctx context.Context, limit, offset int64, orderBy, sort string, onlyEnabled bool, ids *[]uint64) (list []*m.Trigger, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int) (list []*m.Trigger, total int64, err error)
	Enable(ctx context.Context, id int64) (err error)
	Disable(ctx context.Context, id int64) (err error)
	// contains filtered or unexported methods
}

ITrigger ...

func GetTriggerAdaptor added in v0.5.0

func GetTriggerAdaptor(d *gorm.DB, orm *orm.Orm) ITrigger

GetTriggerAdaptor ...

type IUser added in v0.5.0

type IUser interface {
	Add(ctx context.Context, user *m.User) (id int64, err error)
	GetById(ctx context.Context, userId int64) (user *m.User, err error)
	GetByNickname(ctx context.Context, nick string) (user *m.User, err error)
	GetByEmail(ctx context.Context, email string) (user *m.User, err error)
	GetByAuthenticationToken(ctx context.Context, token string) (user *m.User, err error)
	GetByResetPassToken(ctx context.Context, token string) (user *m.User, err error)
	Update(ctx context.Context, user *m.User) (err error)
	Delete(ctx context.Context, userId int64) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.User, total int64, err error)
	SignIn(ctx context.Context, u *m.User, ipv4 string) (err error)
	GenResetPassToken(ctx context.Context, u *m.User) (token string, err error)
	ClearResetPassToken(ctx context.Context, u *m.User) (err error)
	ClearToken(ctx context.Context, u *m.User) (err error)
	// contains filtered or unexported methods
}

IUser ...

func GetUserAdaptor

func GetUserAdaptor(d *gorm.DB) IUser

GetUserAdaptor ...

type IUserDevice added in v0.9.5

type IUserDevice interface {
	Add(ctx context.Context, ver *m.UserDevice) (id int64, err error)
	GetByUserId(ctx context.Context, userId int64) (list []*m.UserDevice, err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.UserDevice, total int64, err error)
	Delete(ctx context.Context, id int64) (err error)
	// contains filtered or unexported methods
}

IUserDevice ...

func GetUserDeviceAdaptor added in v0.9.5

func GetUserDeviceAdaptor(d *gorm.DB) IUserDevice

GetUserDeviceAdaptor ...

type IUserMeta added in v0.5.0

type IUserMeta interface {
	UpdateOrCreate(ctx context.Context, meta *m.UserMeta) (id int64, err error)
	// contains filtered or unexported methods
}

IUserMeta ...

type IVariable added in v0.5.0

type IVariable interface {
	Add(ctx context.Context, ver m.Variable) (err error)
	CreateOrUpdate(ctx context.Context, ver m.Variable) (err error)
	GetByName(ctx context.Context, name string) (ver m.Variable, err error)
	Update(ctx context.Context, variable m.Variable) (err error)
	Delete(ctx context.Context, name string) (err error)
	List(ctx context.Context, limit, offset int64, orderBy, sort string, system bool, name string) (list []m.Variable, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int) (list []m.Variable, total int64, err error)
	// contains filtered or unexported methods
}

IVariable ...

func GetVariableAdaptor

func GetVariableAdaptor(d *gorm.DB) IVariable

GetVariableAdaptor ...

type IZigbee2mqtt added in v0.5.0

type IZigbee2mqtt interface {
	Add(ctx context.Context, ver *m.Zigbee2mqtt) (id int64, err error)
	GetById(ctx context.Context, id int64) (ver *m.Zigbee2mqtt, err error)
	Update(ctx context.Context, ver *m.Zigbee2mqtt) (err error)
	Delete(ctx context.Context, id int64) (err error)
	List(ctx context.Context, limit, offset int64) (list []*m.Zigbee2mqtt, total int64, err error)
	GetByLogin(ctx context.Context, login string) (ver *m.Zigbee2mqtt, err error)
	// contains filtered or unexported methods
}

IZigbee2mqtt ...

func GetZigbee2mqttAdaptor added in v0.1.0

func GetZigbee2mqttAdaptor(d *gorm.DB) IZigbee2mqtt

GetZigbee2mqttAdaptor ...

type IZigbee2mqttDevice added in v0.5.0

type IZigbee2mqttDevice interface {
	Add(ctx context.Context, ver *m.Zigbee2mqttDevice) (err error)
	GetById(ctx context.Context, id string) (ver *m.Zigbee2mqttDevice, err error)
	Update(ctx context.Context, ver *m.Zigbee2mqttDevice) (err error)
	Delete(ctx context.Context, id string) (err error)
	List(ctx context.Context, limit, offset int64) (list []*m.Zigbee2mqttDevice, total int64, err error)
	ListByBridgeId(ctx context.Context, bridgeId, limit, offset int64, orderBy, sort string) (list []*m.Zigbee2mqttDevice, total int64, err error)
	Search(ctx context.Context, query string, limit, offset int64) (list []*m.Zigbee2mqttDevice, total int64, err error)
	// contains filtered or unexported methods
}

IZigbee2mqttDevice ...

func GetZigbee2mqttDeviceAdaptor added in v0.1.0

func GetZigbee2mqttDeviceAdaptor(d *gorm.DB) IZigbee2mqttDevice

GetZigbee2mqttDeviceAdaptor ...

type Image

type Image struct {
	IImage
	// contains filtered or unexported fields
}

Image ...

func (*Image) Add

func (n *Image) Add(ctx context.Context, ver *m.Image) (id int64, err error)

Add ...

func (*Image) AddMultiple

func (n *Image) AddMultiple(ctx context.Context, items []*m.Image) (err error)

AddMultiple ...

func (*Image) Delete

func (n *Image) Delete(ctx context.Context, mapId int64) (err error)

Delete ...

func (*Image) GetAllByDate

func (n *Image) GetAllByDate(ctx context.Context, filter string) (images []*m.Image, err error)

GetAllByDate ...

func (*Image) GetById

func (n *Image) GetById(ctx context.Context, mapId int64) (ver *m.Image, err error)

GetById ...

func (*Image) GetByImageName added in v0.2.0

func (n *Image) GetByImageName(ctx context.Context, imageName string) (ver *m.Image, err error)

GetByImageName ...

func (*Image) GetFilterList

func (n *Image) GetFilterList(ctx context.Context) (filterList []*m.ImageFilterList, err error)

GetFilterList ...

func (*Image) List

func (n *Image) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Image, total int64, err error)

List ...

func (*Image) Update

func (n *Image) Update(ctx context.Context, ver *m.Image) (err error)

Update ...

type Log

type Log struct {
	ILog
	// contains filtered or unexported fields
}

Log ...

func (*Log) Add

func (n *Log) Add(ctx context.Context, ver *m.Log) (id int64, err error)

Add ...

func (*Log) AddMultiple added in v0.0.19

func (n *Log) AddMultiple(ctx context.Context, items []*m.Log) (err error)

AddMultiple ...

func (*Log) Delete

func (n *Log) Delete(ctx context.Context, verId int64) (err error)

Delete ...

func (*Log) DeleteOldest added in v0.9.3

func (n *Log) DeleteOldest(ctx context.Context, days int) (err error)

DeleteOldest ...

func (*Log) GetById

func (n *Log) GetById(ctx context.Context, verId int64) (ver *m.Log, err error)

GetById ...

func (*Log) List

func (n *Log) List(ctx context.Context, limit, offset int64, orderBy, sort string, queryObj *m.LogQuery) (list []*m.Log, total int64, err error)

List ...

func (*Log) Search

func (n *Log) Search(ctx context.Context, query string, limit, offset int) (list []*m.Log, total int64, err error)

Search ...

type Message added in v0.0.17

type Message struct {
	IMessage
	// contains filtered or unexported fields
}

Message ...

func (*Message) Add added in v0.0.17

func (n *Message) Add(ctx context.Context, msg *m.Message) (id int64, err error)

Add ...

type MessageDelivery added in v0.0.17

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

MessageDelivery ...

func (*MessageDelivery) Add added in v0.0.17

func (n *MessageDelivery) Add(ctx context.Context, msg *m.MessageDelivery) (id int64, err error)

Add ...

func (*MessageDelivery) Delete added in v0.0.17

func (n *MessageDelivery) Delete(ctx context.Context, id int64) (err error)

Delete ...

func (*MessageDelivery) GetAllUncompleted added in v0.0.17

func (n *MessageDelivery) GetAllUncompleted(ctx context.Context, limit, offset int64) (list []*m.MessageDelivery, total int64, err error)

GetAllUncompleted ...

func (*MessageDelivery) GetById added in v0.0.17

func (n *MessageDelivery) GetById(ctx context.Context, id int64) (ver *m.MessageDelivery, err error)

GetById ...

func (*MessageDelivery) List added in v0.0.17

func (n *MessageDelivery) List(ctx context.Context, limit, offset int64, orderBy, sort string, query *m.MessageDeliveryQuery) (list []*m.MessageDelivery, total int64, err error)

List ...

func (*MessageDelivery) SetStatus added in v0.0.17

func (n *MessageDelivery) SetStatus(ctx context.Context, msg *m.MessageDelivery) (err error)

SetStatus ...

type Metric added in v0.5.0

type Metric struct {
	IMetric
	// contains filtered or unexported fields
}

Metric ...

func (*Metric) Add added in v0.5.0

func (n *Metric) Add(ctx context.Context, ver *m.Metric) (id int64, err error)

Add ...

func (*Metric) AddMultiple added in v0.5.0

func (n *Metric) AddMultiple(ctx context.Context, items []*m.Metric) (err error)

AddMultiple ...

func (*Metric) Delete added in v0.5.0

func (n *Metric) Delete(ctx context.Context, deviceId int64) (err error)

Delete ...

func (*Metric) GetByIdWithData added in v0.5.0

func (n *Metric) GetByIdWithData(ctx context.Context, id int64, from, to *time.Time, metricRange *common.MetricRange) (metric *m.Metric, err error)

GetByIdWithData ...

func (*Metric) List added in v0.5.0

func (n *Metric) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Metric, total int64, err error)

List ...

func (*Metric) Search added in v0.5.0

func (n *Metric) Search(ctx context.Context, query string, limit, offset int) (list []*m.Metric, total int64, err error)

Search ...

func (*Metric) Update added in v0.5.0

func (n *Metric) Update(ctx context.Context, ver *m.Metric) error

Update ...

type MetricBucket added in v0.5.0

type MetricBucket struct {
	IMetricBucket
	// contains filtered or unexported fields
}

MetricBucket ...

func (*MetricBucket) Add added in v0.5.0

func (n *MetricBucket) Add(ctx context.Context, ver *m.MetricDataItem) error

Add ...

func (*MetricBucket) AddMultiple added in v0.5.0

func (n *MetricBucket) AddMultiple(ctx context.Context, items []*m.MetricDataItem) (err error)

AddMultiple ...

func (*MetricBucket) DeleteById added in v0.5.0

func (n *MetricBucket) DeleteById(ctx context.Context, id int64) (err error)

DeleteById ...

func (*MetricBucket) DeleteByMetricId added in v0.5.0

func (n *MetricBucket) DeleteByMetricId(ctx context.Context, metricId int64) (err error)

DeleteByMetricId ...

func (*MetricBucket) DeleteOldest added in v0.5.0

func (n *MetricBucket) DeleteOldest(ctx context.Context, days int) (err error)

DeleteOldest ...

func (*MetricBucket) List added in v0.12.0

func (n *MetricBucket) List(ctx context.Context, from, to *time.Time, metricId int64, optionItems []string, metricRange *common.MetricRange) (list []*m.MetricDataItem, err error)

List ...

type Permission

type Permission struct {
	IPermission
	// contains filtered or unexported fields
}

Permission ...

func (*Permission) Add

func (n *Permission) Add(ctx context.Context, permission *m.Permission) (id int64, err error)

Add ...

func (*Permission) Delete

func (n *Permission) Delete(ctx context.Context, roleName, packageName string, levelName []string) (err error)

Delete ...

func (*Permission) GetAllPermissions

func (n *Permission) GetAllPermissions(ctx context.Context, roleName string) (permissions []*m.Permission, err error)

GetAllPermissions ...

type Plugin added in v0.5.0

type Plugin struct {
	IPlugin
	// contains filtered or unexported fields
}

Plugin ...

func (*Plugin) Add added in v0.5.0

func (p *Plugin) Add(ctx context.Context, plugin *m.Plugin) (err error)

Add ...

func (*Plugin) CreateOrUpdate added in v0.5.0

func (p *Plugin) CreateOrUpdate(ctx context.Context, plugin *m.Plugin) (err error)

CreateOrUpdate ...

func (*Plugin) Delete added in v0.5.0

func (p *Plugin) Delete(ctx context.Context, name string) (err error)

Delete ...

func (*Plugin) GetByName added in v0.5.0

func (p *Plugin) GetByName(ctx context.Context, name string) (ver *m.Plugin, err error)

GetByName ...

func (*Plugin) List added in v0.5.0

func (p *Plugin) List(ctx context.Context, limit, offset int64, orderBy, sort string, onlyEnabled bool) (list []*m.Plugin, total int64, err error)

List ...

func (*Plugin) Search added in v0.5.0

func (p *Plugin) Search(ctx context.Context, query string, limit, offset int64) (list []*m.Plugin, total int64, err error)

Search ...

func (*Plugin) Update added in v0.5.0

func (p *Plugin) Update(ctx context.Context, plugin *m.Plugin) (err error)

Update ...

type Role

type Role struct {
	IRole
	// contains filtered or unexported fields
}

RoleName ...

func (*Role) Add

func (n *Role) Add(ctx context.Context, role *m.Role) (err error)

Add ...

func (*Role) Delete

func (n *Role) Delete(ctx context.Context, name string) (err error)

Delete ...

func (*Role) GetAccessList

func (n *Role) GetAccessList(ctx context.Context, role *m.Role) (err error)

GetAccessList ...

func (*Role) GetByName

func (n *Role) GetByName(ctx context.Context, name string) (role *m.Role, err error)

GetByName ...

func (*Role) List

func (n *Role) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.Role, total int64, err error)

List ...

func (*Role) Search

func (n *Role) Search(ctx context.Context, query string, limit, offset int64) (list []*m.Role, total int64, err error)

Search ...

func (*Role) Update

func (n *Role) Update(ctx context.Context, role *m.Role) (err error)

Update ...

type RunHistory added in v0.5.0

type RunHistory struct {
	IRunHistory
	// contains filtered or unexported fields
}

RunHistory ...

func (*RunHistory) Add added in v0.5.0

func (n *RunHistory) Add(ctx context.Context, story *m.RunStory) (id int64, err error)

Add ...

func (*RunHistory) DeleteOldest added in v0.12.0

func (n *RunHistory) DeleteOldest(ctx context.Context, days int) (err error)

DeleteOldest ...

func (*RunHistory) List added in v0.5.0

func (n *RunHistory) List(ctx context.Context, limit, offset int64, orderBy, sort string, from *time.Time) (list []*m.RunStory, total int64, err error)

List ...

func (*RunHistory) Update added in v0.5.0

func (n *RunHistory) Update(ctx context.Context, story *m.RunStory) (err error)

Update ...

type Script

type Script struct {
	IScript
	// contains filtered or unexported fields
}

Script ...

func (*Script) Add

func (n *Script) Add(ctx context.Context, script *m.Script) (id int64, err error)

Add ...

func (*Script) Delete

func (n *Script) Delete(ctx context.Context, scriptId int64) (err error)

Delete ...

func (*Script) GetById

func (n *Script) GetById(ctx context.Context, scriptId int64) (script *m.Script, err error)

GetById ...

func (*Script) GetByName added in v0.5.0

func (n *Script) GetByName(ctx context.Context, name string) (script *m.Script, err error)

GetByName ...

func (*Script) List

func (n *Script) List(ctx context.Context, limit, offset int64, orderBy, sort string, query *string, ids *[]uint64) (list []*m.Script, total int64, err error)

List ...

func (*Script) Search

func (n *Script) Search(ctx context.Context, query string, limit, offset int64) (list []*m.Script, total int64, err error)

Search ...

func (*Script) Statistic added in v0.12.0

func (n *Script) Statistic(ctx context.Context) (statistic *m.ScriptsStatistic, err error)

func (*Script) Update

func (n *Script) Update(ctx context.Context, script *m.Script) (err error)

Update ...

type ScriptVersion added in v0.12.0

type ScriptVersion struct {
	IScriptVersion
	// contains filtered or unexported fields
}

ScriptVersion ...

func (*ScriptVersion) Delete added in v0.12.0

func (n *ScriptVersion) Delete(ctx context.Context, id int64) (err error)

Delete ...

type Tag added in v0.17.0

type Tag struct {
	ITag
	// contains filtered or unexported fields
}

Tag ...

func (*Tag) Add added in v0.17.0

func (n *Tag) Add(ctx context.Context, tag *m.Tag) (id int64, err error)

Add ...

func (*Tag) Delete added in v0.17.0

func (n *Tag) Delete(ctx context.Context, name string) (err error)

Delete ...

func (*Tag) GetById added in v0.17.0

func (n *Tag) GetById(ctx context.Context, id int64) (tag *m.Tag, err error)

GetById ...

func (*Tag) GetByName added in v0.17.0

func (n *Tag) GetByName(ctx context.Context, name string) (tag *m.Tag, err error)

GetByName ...

func (*Tag) List added in v0.17.0

func (n *Tag) List(ctx context.Context, limit, offset int64, orderBy, sort string, query *string, names *[]string) (list []*m.Tag, total int64, err error)

List ...

func (*Tag) Search added in v0.17.0

func (n *Tag) Search(ctx context.Context, query string, limit, offset int64) (list []*m.Tag, total int64, err error)

Search ...

func (*Tag) Update added in v0.17.0

func (n *Tag) Update(ctx context.Context, tag *m.Tag) (err error)

Update ...

type Task added in v0.5.0

type Task struct {
	ITask
	// contains filtered or unexported fields
}

Task ...

func (*Task) Add added in v0.5.0

func (n *Task) Add(ctx context.Context, ver *m.NewTask) (taskId int64, err error)

Add ...

func (*Task) Delete added in v0.5.0

func (n *Task) Delete(ctx context.Context, id int64) (err error)

Delete ...

func (*Task) Disable added in v0.5.3

func (n *Task) Disable(ctx context.Context, id int64) (err error)

Disable ...

func (*Task) Enable added in v0.5.3

func (n *Task) Enable(ctx context.Context, id int64) (err error)

Enable ...

func (*Task) GetById added in v0.5.2

func (n *Task) GetById(ctx context.Context, id int64) (task *m.Task, err error)

GetById ...

func (*Task) Import added in v0.11.0

func (n *Task) Import(ctx context.Context, ver *m.Task) (err error)

Import ...

func (*Task) List added in v0.5.0

func (n *Task) List(ctx context.Context, limit, offset int64, orderBy, sort string, onlyEnabled bool) (list []*m.Task, total int64, err error)

List ...

func (*Task) Update added in v0.5.1

func (n *Task) Update(ctx context.Context, ver *m.UpdateTask) (err error)

Update ...

type TelegramChat added in v0.5.0

type TelegramChat struct {
	ITelegramChat
	// contains filtered or unexported fields
}

TelegramChat ...

func (*TelegramChat) Add added in v0.5.0

func (p *TelegramChat) Add(ctx context.Context, plugin m.TelegramChat) (err error)

Add ...

func (*TelegramChat) Delete added in v0.5.0

func (p *TelegramChat) Delete(ctx context.Context, entityId common.EntityId, channelId int64) (err error)

Delete ...

func (*TelegramChat) List added in v0.5.0

func (p *TelegramChat) List(ctx context.Context, limit, offset int64, orderBy, sort string, entityId common.EntityId) (list []m.TelegramChat, total int64, err error)

List ...

type Template added in v0.0.17

type Template struct {
	ITemplate
	// contains filtered or unexported fields
}

Template ...

func (*Template) Create added in v0.0.17

func (n *Template) Create(ctx context.Context, ver *m.Template) (err error)

Create ...

func (*Template) Delete added in v0.0.17

func (n *Template) Delete(ctx context.Context, name string) (err error)

Delete ...

func (*Template) GetByName added in v0.0.17

func (n *Template) GetByName(ctx context.Context, name string) (ver *m.Template, err error)

GetByName ...

func (*Template) GetItemByName added in v0.0.17

func (n *Template) GetItemByName(ctx context.Context, name string) (ver *m.Template, err error)

GetItemByName ...

func (*Template) GetItemsSortedList added in v0.0.17

func (n *Template) GetItemsSortedList(ctx context.Context) (count int64, items []string, err error)

GetItemsSortedList ...

func (*Template) GetItemsTree added in v0.0.17

func (n *Template) GetItemsTree(ctx context.Context) (tree []*m.TemplateTree, err error)

GetItemsTree ...

func (*Template) GetList added in v0.0.17

func (n *Template) GetList(ctx context.Context, templateType m.TemplateType) (items []*m.Template, err error)

GetList ...

func (*Template) GetMarkers added in v0.0.17

func (n *Template) GetMarkers(ctx context.Context, template *m.Template) (err error)

GetMarkers ...

func (*Template) Render added in v0.0.17

func (n *Template) Render(ctx context.Context, name string, params map[string]interface{}) (render *m.TemplateRender, err error)

Render ...

func (*Template) Search added in v0.0.17

func (n *Template) Search(ctx context.Context, query string, limit, offset int) (list []*m.Template, total int64, err error)

Search ...

func (*Template) UpdateItemsTree added in v0.0.17

func (n *Template) UpdateItemsTree(ctx context.Context, tree []*m.TemplateTree) (err error)

UpdateItemsTree ...

func (*Template) UpdateOrCreate added in v0.0.17

func (n *Template) UpdateOrCreate(ctx context.Context, ver *m.Template) (err error)

UpdateOrCreate ...

func (*Template) UpdateStatus added in v0.0.17

func (n *Template) UpdateStatus(ctx context.Context, ver *m.Template) (err error)

UpdateStatus ...

type Trigger added in v0.5.0

type Trigger struct {
	ITrigger
	// contains filtered or unexported fields
}

Trigger ...

func (*Trigger) Add added in v0.12.0

func (n *Trigger) Add(ctx context.Context, ver *m.NewTrigger) (id int64, err error)

Add ...

func (*Trigger) Delete added in v0.12.0

func (n *Trigger) Delete(ctx context.Context, deviceId int64) (err error)

Delete ...

func (*Trigger) Disable added in v0.12.0

func (n *Trigger) Disable(ctx context.Context, id int64) (err error)

Disable ...

func (*Trigger) Enable added in v0.12.0

func (n *Trigger) Enable(ctx context.Context, id int64) (err error)

Enable ...

func (*Trigger) GetById added in v0.12.0

func (n *Trigger) GetById(ctx context.Context, id int64) (metric *m.Trigger, err error)

GetById ...

func (*Trigger) GetByIdWithData added in v0.12.0

func (n *Trigger) GetByIdWithData(ctx context.Context, id int64, from, to *time.Time, metricRange *string) (metric *m.Trigger, err error)

GetByIdWithData ...

func (*Trigger) List added in v0.12.0

func (n *Trigger) List(ctx context.Context, limit, offset int64, orderBy, sort string, onlyEnabled bool) (list []*m.Trigger, total int64, err error)

List ...

func (*Trigger) ListPlain added in v0.14.0

func (n *Trigger) ListPlain(ctx context.Context, limit, offset int64, orderBy, sort string, onlyEnabled bool, ids *[]uint64) (list []*m.Trigger, total int64, err error)

ListPlain ...

func (*Trigger) Search added in v0.12.0

func (n *Trigger) Search(ctx context.Context, query string, limit, offset int) (list []*m.Trigger, total int64, err error)

Search ...

func (*Trigger) Update added in v0.12.0

func (n *Trigger) Update(ctx context.Context, ver *m.UpdateTrigger) (err error)

Update ...

type User

type User struct {
	IUser
	// contains filtered or unexported fields
}

User ...

func (*User) Add

func (n *User) Add(ctx context.Context, user *m.User) (id int64, err error)

Add ...

func (*User) ClearResetPassToken

func (n *User) ClearResetPassToken(ctx context.Context, u *m.User) (err error)

ClearResetPassToken ...

func (*User) ClearToken

func (n *User) ClearToken(ctx context.Context, u *m.User) (err error)

ClearToken ...

func (*User) Delete

func (n *User) Delete(ctx context.Context, userId int64) (err error)

Delete ...

func (*User) GenResetPassToken

func (n *User) GenResetPassToken(ctx context.Context, u *m.User) (token string, err error)

GenResetPassToken ...

func (*User) GetByAuthenticationToken

func (n *User) GetByAuthenticationToken(ctx context.Context, token string) (user *m.User, err error)

GetByAuthenticationToken ...

func (*User) GetByEmail

func (n *User) GetByEmail(ctx context.Context, email string) (user *m.User, err error)

GetByEmail ...

func (*User) GetById

func (n *User) GetById(ctx context.Context, userId int64) (user *m.User, err error)

GetById ...

func (*User) GetByNickname added in v0.2.0

func (n *User) GetByNickname(ctx context.Context, nick string) (user *m.User, err error)

GetByNickname ...

func (*User) GetByResetPassToken

func (n *User) GetByResetPassToken(ctx context.Context, token string) (user *m.User, err error)

GetByResetPassToken ...

func (*User) List

func (n *User) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.User, total int64, err error)

List ...

func (*User) SignIn

func (n *User) SignIn(ctx context.Context, u *m.User, ipv4 string) (err error)

SignIn ...

func (*User) Update

func (n *User) Update(ctx context.Context, user *m.User) (err error)

Update ...

type UserDevice added in v0.9.5

type UserDevice struct {
	IUserDevice
	// contains filtered or unexported fields
}

UserDevice ...

func (*UserDevice) Add added in v0.9.5

func (n *UserDevice) Add(ctx context.Context, ver *m.UserDevice) (id int64, err error)

Add ...

func (*UserDevice) Delete added in v0.9.5

func (n *UserDevice) Delete(ctx context.Context, id int64) (err error)

Delete ...

func (*UserDevice) GetByUserId added in v0.9.5

func (n *UserDevice) GetByUserId(ctx context.Context, userId int64) (list []*m.UserDevice, err error)

GetByUserId ...

func (*UserDevice) List added in v0.17.0

func (n *UserDevice) List(ctx context.Context, limit, offset int64, orderBy, sort string) (list []*m.UserDevice, total int64, err error)

List ...

type UserMeta

type UserMeta struct {
	IUserMeta
	// contains filtered or unexported fields
}

UserMeta ...

func GetUserMetaAdaptor

func GetUserMetaAdaptor(d *gorm.DB) *UserMeta

GetUserMetaAdaptor ...

func (*UserMeta) UpdateOrCreate

func (n *UserMeta) UpdateOrCreate(ctx context.Context, meta *m.UserMeta) (id int64, err error)

UpdateOrCreate ...

type Variable

type Variable struct {
	IVariable
	// contains filtered or unexported fields
}

Variable ...

func (*Variable) Add

func (n *Variable) Add(ctx context.Context, ver m.Variable) (err error)

Add ...

func (*Variable) CreateOrUpdate added in v0.5.0

func (n *Variable) CreateOrUpdate(ctx context.Context, ver m.Variable) (err error)

CreateOrUpdate ...

func (*Variable) Delete

func (n *Variable) Delete(ctx context.Context, name string) (err error)

Delete ...

func (*Variable) GetByName

func (n *Variable) GetByName(ctx context.Context, name string) (ver m.Variable, err error)

GetByName ...

func (*Variable) List

func (n *Variable) List(ctx context.Context, limit, offset int64, orderBy, sort string, system bool, name string) (list []m.Variable, total int64, err error)

List ...

func (*Variable) Search added in v0.9.4

func (n *Variable) Search(ctx context.Context, query string, limit, offset int) (list []m.Variable, total int64, err error)

Search ...

func (*Variable) Update

func (n *Variable) Update(ctx context.Context, ver m.Variable) (err error)

Update ...

type Zigbee2mqtt added in v0.1.0

type Zigbee2mqtt struct {
	IZigbee2mqtt
	// contains filtered or unexported fields
}

Zigbee2mqtt ...

func (*Zigbee2mqtt) Add added in v0.1.0

func (n *Zigbee2mqtt) Add(ctx context.Context, ver *m.Zigbee2mqtt) (id int64, err error)

Add ...

func (*Zigbee2mqtt) Delete added in v0.1.0

func (n *Zigbee2mqtt) Delete(ctx context.Context, id int64) (err error)

Delete ...

func (*Zigbee2mqtt) GetById added in v0.1.0

func (n *Zigbee2mqtt) GetById(ctx context.Context, id int64) (ver *m.Zigbee2mqtt, err error)

GetById ...

func (*Zigbee2mqtt) GetByLogin added in v0.1.0

func (a *Zigbee2mqtt) GetByLogin(ctx context.Context, login string) (ver *m.Zigbee2mqtt, err error)

GetByLogin ...

func (*Zigbee2mqtt) List added in v0.1.0

func (n *Zigbee2mqtt) List(ctx context.Context, limit, offset int64) (list []*m.Zigbee2mqtt, total int64, err error)

List ...

func (*Zigbee2mqtt) Update added in v0.1.0

func (n *Zigbee2mqtt) Update(ctx context.Context, ver *m.Zigbee2mqtt) (err error)

Update ...

type Zigbee2mqttDevice added in v0.1.0

type Zigbee2mqttDevice struct {
	IZigbee2mqttDevice
	// contains filtered or unexported fields
}

Zigbee2mqttDevice ...

func (*Zigbee2mqttDevice) Add added in v0.1.0

func (n *Zigbee2mqttDevice) Add(ctx context.Context, ver *m.Zigbee2mqttDevice) (err error)

Add ...

func (*Zigbee2mqttDevice) Delete added in v0.1.0

func (n *Zigbee2mqttDevice) Delete(ctx context.Context, id string) (err error)

Delete ...

func (*Zigbee2mqttDevice) GetById added in v0.1.0

func (n *Zigbee2mqttDevice) GetById(ctx context.Context, id string) (ver *m.Zigbee2mqttDevice, err error)

GetById ...

func (*Zigbee2mqttDevice) List added in v0.1.0

func (n *Zigbee2mqttDevice) List(ctx context.Context, limit, offset int64) (list []*m.Zigbee2mqttDevice, total int64, err error)

List ...

func (*Zigbee2mqttDevice) ListByBridgeId added in v0.5.2

func (n *Zigbee2mqttDevice) ListByBridgeId(ctx context.Context, bridgeId, limit, offset int64, orderBy, sort string) (list []*m.Zigbee2mqttDevice, total int64, err error)

ListByBridgeId ...

func (*Zigbee2mqttDevice) Search added in v0.1.0

func (n *Zigbee2mqttDevice) Search(ctx context.Context, query string, limit, offset int64) (list []*m.Zigbee2mqttDevice, total int64, err error)

Search ...

func (*Zigbee2mqttDevice) Update added in v0.1.0

func (n *Zigbee2mqttDevice) Update(ctx context.Context, ver *m.Zigbee2mqttDevice) (err error)

Update ...

Jump to

Keyboard shortcuts

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