Documentation
¶
Index ¶
- Constants
- Variables
- func GenParams(params map[string]msgThing.Param) (string, string, []any, error)
- func GenParams2(params map[string]any) (string, string, []any, error)
- func GetArrayID(id string, num int) string
- func NewDeviceDataRepo(dataSource conf.TSDB, getProductSchemaModel schema.GetSchemaModel, ...) msgThing.SchemaDataRepo
- func ToEventData(db map[string]any) *msgThing.EventData
- type DeviceDataRepo
- func (d *DeviceDataRepo) CreateProperty(ctx context.Context, p *schema.Property, productID string) error
- func (d *DeviceDataRepo) DeleteDevice(ctx context.Context, t *schema.Model, productID string, deviceName string) error
- func (d *DeviceDataRepo) DeleteDeviceProperty(ctx context.Context, productID string, deviceName string, s []schema.Property) error
- func (d *DeviceDataRepo) DeleteProduct(ctx context.Context, t *schema.Model, productID string) error
- func (d *DeviceDataRepo) DeleteProperty(ctx context.Context, p *schema.Property, productID string, identifier string) error
- func (d *DeviceDataRepo) GenInsertPropertySql(ctx context.Context, p *schema.Property, productID string, deviceName string, ...) (sql string, args []any, err error)
- func (d *DeviceDataRepo) GetEventCountByFilter(ctx context.Context, filter msgThing.FilterOpt) (int64, error)
- func (d *DeviceDataRepo) GetEventDataByFilter(ctx context.Context, filter msgThing.FilterOpt) ([]*msgThing.EventData, error)
- func (d *DeviceDataRepo) GetLatestPropertyDataByID(ctx context.Context, p *schema.Property, filter msgThing.LatestFilter) (*msgThing.PropertyData, error)
- func (d *DeviceDataRepo) GetPropertyAgg(ctx context.Context, m *schema.Model, filter msgThing.FilterAggOpt) ([]*msgThing.PropertyData2, error)
- func (d *DeviceDataRepo) GetPropertyCountByID(ctx context.Context, p *schema.Property, filter msgThing.FilterOpt) (int64, error)
- func (d *DeviceDataRepo) GetPropertyDataByID(ctx context.Context, p *schema.Property, filter msgThing.FilterOpt) ([]*msgThing.PropertyData, error)
- func (d *DeviceDataRepo) Init(ctx context.Context) error
- func (d *DeviceDataRepo) InitDevice(ctx context.Context, t *schema.Model, productID string, deviceName string) error
- func (d *DeviceDataRepo) InitProduct(ctx context.Context, t *schema.Model, productID string) error
- func (d *DeviceDataRepo) InsertEventData(ctx context.Context, productID string, deviceName string, ...) error
- func (d *DeviceDataRepo) InsertPropertiesData(ctx context.Context, t *schema.Model, productID string, deviceName string, ...) error
- func (d *DeviceDataRepo) InsertPropertyData(ctx context.Context, t *schema.Property, productID string, deviceName string, ...) error
- func (d *DeviceDataRepo) ToPropertyData(ctx context.Context, id string, p *schema.Property, db map[string]any) (ret *msgThing.PropertyData)
- func (d *DeviceDataRepo) ToPropertyData2(ctx context.Context, agg msgThing.PropertyAgg, p *schema.Define, ...) map[string]msgThing.PropertyData2
- func (d *DeviceDataRepo) UpdateDevice(ctx context.Context, dev devices.Core, t *schema.Model, ...) error
- func (d *DeviceDataRepo) UpdateProduct(ctx context.Context, oldT *schema.Model, newt *schema.Model, productID string) error
- func (d *DeviceDataRepo) UpdateProperty(ctx context.Context, oldP *schema.Property, newP *schema.Property, ...) error
- func (d *DeviceDataRepo) VersionUpdate(ctx context.Context, version string, ...) error
- type PropertyAgg2
- type PropertyAggStu
- type SchemaStore
- func (S *SchemaStore) GetDeviceStableBoolName() string
- func (S *SchemaStore) GetDeviceStableEnumName() string
- func (S *SchemaStore) GetDeviceStableFloatName() string
- func (S *SchemaStore) GetDeviceStableIntName() string
- func (S *SchemaStore) GetDeviceStableStringName() string
- func (S *SchemaStore) GetDeviceStableTimestampName() string
- func (S *SchemaStore) GetEventStableName() string
- func (S *SchemaStore) GetEventTableName(productID, deviceName string) string
- func (S *SchemaStore) GetPropertyStableName(p *schema.Property, productID, identifier string) string
- func (S *SchemaStore) GetPropertyTableName(productID, deviceName, identifier string) string
- func (S *SchemaStore) GetPropertyTableNames(productID, deviceName string, p *schema.Property) (ret []string)
- func (S *SchemaStore) GetSpecsColumnWithArgFunc(s schema.Specs, argFunc string) string
- func (S *SchemaStore) GetSpecsColumnWithArgFunc2(s schema.Specs, agg msgThing.PropertyAgg) string
- func (S *SchemaStore) GetSpecsCreateColumn(s schema.Specs) string
- func (S *SchemaStore) GetStableNameList(t *schema.Model, productID string) (tables []string)
- func (S *SchemaStore) GetTableNameList(t *schema.Model, productID string, deviceName string) (tables []string)
Constants ¶
View Source
const (
PropertyType = "property_type"
)
Variables ¶
View Source
var DeviceStables []string
Functions ¶
func GenParams2 ¶ added in v1.5.12
func GetArrayID ¶
func NewDeviceDataRepo ¶
func NewDeviceDataRepo(dataSource conf.TSDB, getProductSchemaModel schema.GetSchemaModel, getDeviceSchemaModel schema.GetSchemaModel, kv kv.Store, g []*deviceGroup.GroupDetail) msgThing.SchemaDataRepo
Types ¶
type DeviceDataRepo ¶
type DeviceDataRepo struct { SchemaStore // contains filtered or unexported fields }
func (*DeviceDataRepo) CreateProperty ¶
func (*DeviceDataRepo) DeleteDevice ¶
func (*DeviceDataRepo) DeleteDeviceProperty ¶
func (*DeviceDataRepo) DeleteProduct ¶
func (*DeviceDataRepo) DeleteProperty ¶
func (*DeviceDataRepo) GenInsertPropertySql ¶
func (*DeviceDataRepo) GetEventCountByFilter ¶
func (*DeviceDataRepo) GetEventDataByFilter ¶
func (*DeviceDataRepo) GetLatestPropertyDataByID ¶
func (d *DeviceDataRepo) GetLatestPropertyDataByID(ctx context.Context, p *schema.Property, filter msgThing.LatestFilter) (*msgThing.PropertyData, error)
func (*DeviceDataRepo) GetPropertyAgg ¶ added in v1.4.54
func (d *DeviceDataRepo) GetPropertyAgg(ctx context.Context, m *schema.Model, filter msgThing.FilterAggOpt) ([]*msgThing.PropertyData2, error)
func (*DeviceDataRepo) GetPropertyCountByID ¶
func (*DeviceDataRepo) GetPropertyDataByID ¶
func (d *DeviceDataRepo) GetPropertyDataByID( ctx context.Context, p *schema.Property, filter msgThing.FilterOpt) ([]*msgThing.PropertyData, error)
func (*DeviceDataRepo) InitDevice ¶
func (*DeviceDataRepo) InitProduct ¶
func (*DeviceDataRepo) InsertEventData ¶
func (*DeviceDataRepo) InsertPropertiesData ¶
func (*DeviceDataRepo) InsertPropertyData ¶
func (*DeviceDataRepo) ToPropertyData ¶ added in v1.4.21
func (d *DeviceDataRepo) ToPropertyData(ctx context.Context, id string, p *schema.Property, db map[string]any) (ret *msgThing.PropertyData)
func (*DeviceDataRepo) ToPropertyData2 ¶ added in v1.4.56
func (d *DeviceDataRepo) ToPropertyData2(ctx context.Context, agg msgThing.PropertyAgg, p *schema.Define, dbs []map[string]any, retMap map[string]msgThing.PropertyData2) map[string]msgThing.PropertyData2
func (*DeviceDataRepo) UpdateDevice ¶ added in v1.4.13
func (d *DeviceDataRepo) UpdateDevice(ctx context.Context, dev devices.Core, t *schema.Model, affiliation devices.Affiliation) error
func (*DeviceDataRepo) UpdateProduct ¶
func (*DeviceDataRepo) UpdateProperty ¶
func (*DeviceDataRepo) VersionUpdate ¶ added in v1.4.13
type PropertyAgg2 ¶ added in v1.4.54
type PropertyAgg2 struct { P *schema.Property msgThing.PropertyAgg }
type PropertyAggStu ¶ added in v1.4.54
type PropertyAggStu struct { NoFirstTs bool `json:"noFirstTs,optional"` //时间戳填充不填充最早的值,聚合模式使用 Aggs []PropertyAgg2 }
type SchemaStore ¶
type SchemaStore struct { }
func (*SchemaStore) GetDeviceStableBoolName ¶
func (S *SchemaStore) GetDeviceStableBoolName() string
func (*SchemaStore) GetDeviceStableEnumName ¶
func (S *SchemaStore) GetDeviceStableEnumName() string
func (*SchemaStore) GetDeviceStableFloatName ¶
func (S *SchemaStore) GetDeviceStableFloatName() string
func (*SchemaStore) GetDeviceStableIntName ¶
func (S *SchemaStore) GetDeviceStableIntName() string
func (*SchemaStore) GetDeviceStableStringName ¶
func (S *SchemaStore) GetDeviceStableStringName() string
func (*SchemaStore) GetDeviceStableTimestampName ¶
func (S *SchemaStore) GetDeviceStableTimestampName() string
func (*SchemaStore) GetEventStableName ¶
func (S *SchemaStore) GetEventStableName() string
func (*SchemaStore) GetEventTableName ¶
func (S *SchemaStore) GetEventTableName(productID, deviceName string) string
func (*SchemaStore) GetPropertyStableName ¶
func (S *SchemaStore) GetPropertyStableName(p *schema.Property, productID, identifier string) string
func (*SchemaStore) GetPropertyTableName ¶
func (S *SchemaStore) GetPropertyTableName(productID, deviceName, identifier string) string
func (*SchemaStore) GetPropertyTableNames ¶
func (S *SchemaStore) GetPropertyTableNames(productID, deviceName string, p *schema.Property) (ret []string)
func (*SchemaStore) GetSpecsColumnWithArgFunc ¶
func (S *SchemaStore) GetSpecsColumnWithArgFunc(s schema.Specs, argFunc string) string
func (*SchemaStore) GetSpecsColumnWithArgFunc2 ¶ added in v1.5.15
func (S *SchemaStore) GetSpecsColumnWithArgFunc2(s schema.Specs, agg msgThing.PropertyAgg) string
func (*SchemaStore) GetSpecsCreateColumn ¶
func (S *SchemaStore) GetSpecsCreateColumn(s schema.Specs) string
func (*SchemaStore) GetStableNameList ¶
func (S *SchemaStore) GetStableNameList( t *schema.Model, productID string) (tables []string)
func (*SchemaStore) GetTableNameList ¶
Click to show internal directories.
Click to hide internal directories.