adaptors

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectTransaction

func InjectTransaction(ctx context.Context, tr *gorm.DB) context.Context

func NewAdaptors

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

NewAdaptors ...

Types

type Action

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

Action ...

func GetActionAdaptor

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

GetActionAdaptor ...

func (*Action) Add

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

Add ...

func (*Action) Delete

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

Delete ...

func (*Action) GetById

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

GetById ...

func (*Action) GetByIdWithData

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

GetByIdWithData ...

func (*Action) List

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

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

Search ...

func (*Action) Update

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

Update ...

type Adaptors

type Adaptors struct {
	*adaptors.Adaptors
}

type AlexaIntent

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

AlexaIntent ...

func GetAlexaIntentAdaptor

func GetAlexaIntentAdaptor(d *gorm.DB) *AlexaIntent

GetAlexaIntentAdaptor ...

func (*AlexaIntent) Add

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

Add ...

func (*AlexaIntent) Delete

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

Delete ...

func (*AlexaIntent) GetByName

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

GetByName ...

func (*AlexaIntent) Update

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

Update ...

type AlexaSkill

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

AlexaSkill ...

func GetAlexaSkillAdaptor

func GetAlexaSkillAdaptor(d *gorm.DB) *AlexaSkill

GetAlexaSkillAdaptor ...

func (*AlexaSkill) Add

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

Add ...

func (*AlexaSkill) Delete

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

Delete ...

func (*AlexaSkill) GetById

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

GetById ...

func (*AlexaSkill) List

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

List ...

func (*AlexaSkill) ListEnabled

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

ListEnabled ...

func (*AlexaSkill) Update

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

Update ...

type Area

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

Area ...

func GetAreaAdaptor

func GetAreaAdaptor(d *gorm.DB) *Area

GetAreaAdaptor ...

func (*Area) Add

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

Add ...

func (*Area) DeleteByName

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

DeleteByName ...

func (*Area) GetById

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

GetById ...

func (*Area) GetByName

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

GetByName ...

func (*Area) List

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

List ...

func (*Area) Search

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

Search ...

func (*Area) Update

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

Update ...

type Automation

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

Automation ...

func GetAutomationAdaptor

func GetAutomationAdaptor(d *gorm.DB) *Automation

GetAutomationAdaptor ...

func (*Automation) Statistic

func (n *Automation) Statistic(ctx context.Context) (statistic *m.AutomationStatistic, err error)

type Condition

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

Condition ...

func GetConditionAdaptor

func GetConditionAdaptor(d *gorm.DB) *Condition

GetConditionAdaptor ...

func (*Condition) Add

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

Add ...

func (*Condition) Delete

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

Delete ...

func (*Condition) GetById

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

GetById ...

func (*Condition) GetByIdWithData

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

GetByIdWithData ...

func (*Condition) List

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

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

Search ...

func (*Condition) Update

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

Update ...

type Dashboard

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

Dashboard ...

func GetDashboardAdaptor

func GetDashboardAdaptor(d *gorm.DB) *Dashboard

GetDashboardAdaptor ...

func (*Dashboard) Add

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

Add ...

func (*Dashboard) Delete

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

Delete ...

func (*Dashboard) GetById

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

GetById ...

func (*Dashboard) List

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

List ...

func (*Dashboard) Search

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

Search ...

func (*Dashboard) Update

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

Update ...

type DashboardCard

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

DashboardCard ...

func GetDashboardCardAdaptor

func GetDashboardCardAdaptor(d *gorm.DB) *DashboardCard

GetDashboardCardAdaptor ...

func (*DashboardCard) Add

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

Add ...

func (*DashboardCard) Delete

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

Delete ...

func (*DashboardCard) GetById

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

GetById ...

func (*DashboardCard) List

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

List ...

func (*DashboardCard) Update

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

Update ...

type DashboardCardItem

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

DashboardCardItem ...

func GetDashboardCardItemAdaptor

func GetDashboardCardItemAdaptor(d *gorm.DB) *DashboardCardItem

GetDashboardCardItemAdaptor ...

func (*DashboardCardItem) Add

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

Add ...

func (*DashboardCardItem) Delete

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

Delete ...

func (*DashboardCardItem) GetById

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

GetById ...

func (*DashboardCardItem) List

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

List ...

func (*DashboardCardItem) Update

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

Update ...

type DashboardTab

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

DashboardTab ...

func GetDashboardTabAdaptor

func GetDashboardTabAdaptor(d *gorm.DB) *DashboardTab

GetDashboardTabAdaptor ...

func (*DashboardTab) Add

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

Add ...

func (*DashboardTab) Delete

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

Delete ...

func (*DashboardTab) GetById

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

GetById ...

func (*DashboardTab) List

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

List ...

func (*DashboardTab) Update

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

Update ...

type Entity

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

Entity ...

func GetEntityAdaptor

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

GetEntityAdaptor ...

func (*Entity) Add

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

Add ...

func (*Entity) Delete

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

Delete ...

func (*Entity) DeleteScripts

func (n *Entity) DeleteScripts(ctx context.Context, entityID pkgCommon.EntityId) (err error)

func (*Entity) DeleteTags

func (n *Entity) DeleteTags(ctx context.Context, entityID pkgCommon.EntityId) (err error)

func (*Entity) GetById

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

GetById ...

func (*Entity) GetByIds

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

GetByIds ...

func (*Entity) GetByIdsSimple

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

GetByIdsSimple ...

func (*Entity) GetByType

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

GetByType ...

func (*Entity) List

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

List ...

func (*Entity) ListPlain

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

ListPlain ...

func (*Entity) Search

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

Search ...

func (*Entity) Statistic

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

func (*Entity) Update

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

Update ...

func (*Entity) UpdateAutoload

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

UpdateAutoload ...

type EntityAction

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

EntityAction ...

func GetEntityActionAdaptor

func GetEntityActionAdaptor(d *gorm.DB) *EntityAction

GetEntityActionAdaptor ...

func (*EntityAction) Add

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

Add ...

func (*EntityAction) AddMultiple

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

AddMultiple ...

func (*EntityAction) DeleteByEntityId

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

DeleteByEntityId ...

type EntityState

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

EntityState ...

func GetEntityStateAdaptor

func GetEntityStateAdaptor(d *gorm.DB) *EntityState

GetEntityStateAdaptor ...

func (*EntityState) Add

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

Add ...

func (*EntityState) AddMultiple

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

AddMultiple ...

func (*EntityState) DeleteByEntityId

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

DeleteByEntityId ...

type EntityStorage

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

EntityStorage ...

func GetEntityStorageAdaptor

func GetEntityStorageAdaptor(d *gorm.DB) *EntityStorage

GetEntityStorageAdaptor ...

func (*EntityStorage) Add

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

Add ...

func (*EntityStorage) DeleteOldest

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

DeleteOldest ...

func (*EntityStorage) GetLastByEntityId

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

GetLastByEntityId ...

func (*EntityStorage) GetLastThreeById

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

GetLastThreeById ...

func (*EntityStorage) List

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

List ...

type Image

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

Image ...

func GetImageAdaptor

func GetImageAdaptor(d *gorm.DB) *Image

GetImageAdaptor ...

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

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 {
	// contains filtered or unexported fields
}

Log ...

func GetLogAdaptor

func GetLogAdaptor(d *gorm.DB) *Log

GetLogAdaptor ...

func (*Log) Add

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

Add ...

func (*Log) AddMultiple

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

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

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

Message ...

func GetMessageAdaptor

func GetMessageAdaptor(d *gorm.DB) *Message

GetMessageAdaptor ...

func (*Message) Add

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

Add ...

type MessageDelivery

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

MessageDelivery ...

func GetMessageDeliveryAdaptor

func GetMessageDeliveryAdaptor(d *gorm.DB) *MessageDelivery

GetMessageDeliveryAdaptor ...

func (*MessageDelivery) Add

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

Add ...

func (*MessageDelivery) Delete

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

Delete ...

func (*MessageDelivery) GetAllUncompleted

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

GetAllUncompleted ...

func (*MessageDelivery) GetById

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

GetById ...

func (*MessageDelivery) List

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

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

SetStatus ...

type Metric

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

Metric ...

func GetMetricAdaptor

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

GetMetricAdaptor ...

func (*Metric) Add

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

Add ...

func (*Metric) AddMultiple

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

AddMultiple ...

func (*Metric) Delete

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

Delete ...

func (*Metric) GetByIdWithData

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

GetByIdWithData ...

func (*Metric) List

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

List ...

func (*Metric) Search

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

Search ...

func (*Metric) Update

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

Update ...

type MetricBucket

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

MetricBucket ...

func GetMetricBucketAdaptor

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

GetMetricBucketAdaptor ...

func (*MetricBucket) Add

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

Add ...

func (*MetricBucket) AddMultiple

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

AddMultiple ...

func (*MetricBucket) DeleteById

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

DeleteById ...

func (*MetricBucket) DeleteByMetricId

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

DeleteByMetricId ...

func (*MetricBucket) DeleteOldest

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

DeleteOldest ...

func (*MetricBucket) List

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 {
	// contains filtered or unexported fields
}

Permission ...

func GetPermissionAdaptor

func GetPermissionAdaptor(d *gorm.DB) *Permission

GetPermissionAdaptor ...

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

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

Plugin ...

func GetPluginAdaptor

func GetPluginAdaptor(d *gorm.DB) *Plugin

GetPluginAdaptor ...

func (*Plugin) Add

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

Add ...

func (*Plugin) CreateOrUpdate

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

CreateOrUpdate ...

func (*Plugin) Delete

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

Delete ...

func (*Plugin) GetByName

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

GetByName ...

func (*Plugin) List

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

List ...

func (*Plugin) Search

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

Search ...

func (*Plugin) Update

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

Update ...

type Role

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

RoleName ...

func GetRoleAdaptor

func GetRoleAdaptor(d *gorm.DB) *Role

GetRoleAdaptor ...

func (*Role) Add

func (n *Role) Add(ctx context.Context, role *models.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 *models.Role) (err error)

GetAccessList ...

func (*Role) GetByName

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

GetByName ...

func (*Role) List

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

List ...

func (*Role) Search

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

Search ...

func (*Role) Update

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

Update ...

type RunHistory

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

RunHistory ...

func GetRunHistoryAdaptor

func GetRunHistoryAdaptor(d *gorm.DB) *RunHistory

GetRunHistoryAdaptor ...

func (*RunHistory) Add

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

Add ...

func (*RunHistory) DeleteOldest

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

DeleteOldest ...

func (*RunHistory) List

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

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

Update ...

type Script

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

Script ...

func GetScriptAdaptor

func GetScriptAdaptor(d *gorm.DB) *Script

GetScriptAdaptor ...

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

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

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

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

ScriptVersion ...

func GetScriptVersionAdaptor

func GetScriptVersionAdaptor(d *gorm.DB) *ScriptVersion

GetScriptVersionAdaptor ...

func (*ScriptVersion) Delete

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

Delete ...

type Tag

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

Tag ...

func GetTagAdaptor

func GetTagAdaptor(d *gorm.DB) *Tag

GetTagAdaptor ...

func (*Tag) Add

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

Add ...

func (*Tag) Delete

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

Delete ...

func (*Tag) GetById

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

GetById ...

func (*Tag) GetByName

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

GetByName ...

func (*Tag) List

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

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

Search ...

func (*Tag) Update

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

Update ...

type Task

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

Task ...

func GetTaskAdaptor

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

GetTaskAdaptor ...

func (*Task) Add

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

Add ...

func (*Task) Delete

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

Delete ...

func (*Task) DeleteAction

func (n *Task) DeleteAction(ctx context.Context, taskID int64) error

func (*Task) DeleteCondition

func (n *Task) DeleteCondition(ctx context.Context, taskID int64) error

func (*Task) DeleteTrigger

func (n *Task) DeleteTrigger(ctx context.Context, taskID int64) error

func (*Task) Disable

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

Disable ...

func (*Task) Enable

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

Enable ...

func (*Task) GetById

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

GetById ...

func (*Task) Import

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

Import ...

func (*Task) List

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

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

Update ...

type TelegramChat

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

TelegramChat ...

func GetTelegramChannelAdaptor

func GetTelegramChannelAdaptor(d *gorm.DB) *TelegramChat

GetTelegramChannelAdaptor ...

func (*TelegramChat) Add

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

Add ...

func (*TelegramChat) Delete

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

Delete ...

func (*TelegramChat) List

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

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

Template ...

func GetTemplateAdaptor

func GetTemplateAdaptor(d *gorm.DB) *Template

GetTemplateAdaptor ...

func (*Template) Create

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

Create ...

func (*Template) Delete

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

Delete ...

func (*Template) GetByName

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

GetByName ...

func (*Template) GetItemByName

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

GetItemByName ...

func (*Template) GetItemsSortedList

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

GetItemsSortedList ...

func (*Template) GetItemsTree

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

GetItemsTree ...

func (*Template) GetList

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

GetList ...

func (*Template) GetMarkers

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

GetMarkers ...

func (*Template) Render

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

Render ...

func (*Template) Search

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

Search ...

func (*Template) UpdateItemsTree

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

UpdateItemsTree ...

func (*Template) UpdateOrCreate

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

UpdateOrCreate ...

func (*Template) UpdateStatus

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

UpdateStatus ...

type TransactionManger

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

func NewTransactionManger

func NewTransactionManger(db *gorm.DB) *TransactionManger

func (*TransactionManger) Do

func (m *TransactionManger) Do(ctx context.Context, fn func(context.Context) error) (doErr error)

type Trigger

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

Trigger ...

func GetTriggerAdaptor

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

GetTriggerAdaptor ...

func (*Trigger) Add

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

Add ...

func (*Trigger) Delete

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

Delete ...

func (*Trigger) DeleteEntity

func (n *Trigger) DeleteEntity(ctx context.Context, triggerID int64) (err error)

func (*Trigger) Disable

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

Disable ...

func (*Trigger) Enable

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

Enable ...

func (*Trigger) GetById

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

GetById ...

func (*Trigger) GetByIdWithData

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

GetByIdWithData ...

func (*Trigger) List

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

List ...

func (*Trigger) ListPlain

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

ListPlain ...

func (*Trigger) Search

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

Search ...

func (*Trigger) Update

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

type User

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

User ...

func GetUserAdaptor

func GetUserAdaptor(d *gorm.DB) *User

GetUserAdaptor ...

func (*User) Add

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

Add ...

func (*User) ClearResetPassToken

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

ClearResetPassToken ...

func (*User) ClearToken

func (n *User) ClearToken(ctx context.Context, u *models.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 *models.User) (token string, err error)

GenResetPassToken ...

func (*User) GetByAuthenticationToken

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

GetByAuthenticationToken ...

func (*User) GetByEmail

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

GetByEmail ...

func (*User) GetById

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

GetById ...

func (*User) GetByNickname

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

GetByNickname ...

func (*User) GetByResetPassToken

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

GetByResetPassToken ...

func (*User) List

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

List ...

func (*User) SignIn

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

SignIn ...

func (*User) Update

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

Update ...

type UserDevice

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

UserDevice ...

func GetUserDeviceAdaptor

func GetUserDeviceAdaptor(d *gorm.DB) *UserDevice

GetUserDeviceAdaptor ...

func (*UserDevice) Add

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

Add ...

func (*UserDevice) Delete

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

Delete ...

func (*UserDevice) GetByUserId

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

GetByUserId ...

func (*UserDevice) List

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 {
	// 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 {
	// contains filtered or unexported fields
}

Variable ...

func GetVariableAdaptor

func GetVariableAdaptor(d *gorm.DB) *Variable

GetVariableAdaptor ...

func (*Variable) CreateOrUpdate

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

CreateOrUpdate ...

func (*Variable) Delete

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

Delete ...

func (*Variable) DeleteTags

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

DeleteTags ...

func (*Variable) GetByName

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

GetByName ...

func (*Variable) List

func (n *Variable) List(ctx context.Context, options *adaptors.ListVariableOptions) (list []models.Variable, total int64, err error)

List ...

func (*Variable) Search

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

Search ...

type Zigbee2mqtt

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

Zigbee2mqtt ...

func GetZigbee2mqttAdaptor

func GetZigbee2mqttAdaptor(d *gorm.DB) *Zigbee2mqtt

GetZigbee2mqttAdaptor ...

func (*Zigbee2mqtt) Add

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

Add ...

func (*Zigbee2mqtt) Delete

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

Delete ...

func (*Zigbee2mqtt) GetById

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

GetById ...

func (*Zigbee2mqtt) GetByLogin

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

GetByLogin ...

func (*Zigbee2mqtt) List

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

List ...

func (*Zigbee2mqtt) Update

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

Update ...

type Zigbee2mqttDevice

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

Zigbee2mqttDevice ...

func GetZigbee2mqttDeviceAdaptor

func GetZigbee2mqttDeviceAdaptor(d *gorm.DB) *Zigbee2mqttDevice

GetZigbee2mqttDeviceAdaptor ...

func (*Zigbee2mqttDevice) Add

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

Add ...

func (*Zigbee2mqttDevice) Delete

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

Delete ...

func (*Zigbee2mqttDevice) GetById

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

GetById ...

func (*Zigbee2mqttDevice) List

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

List ...

func (*Zigbee2mqttDevice) ListByBridgeId

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

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

Search ...

func (*Zigbee2mqttDevice) Update

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
JackTT - Gopher 🇻🇳