Documentation ¶
Index ¶
- Constants
- Variables
- func GetArrayID(id string, num int) string
- func ToEventData(db map[string]any) *msgThing.EventData
- func ToPropertyData(id string, p *schema.Property, db map[string]any) *msgThing.PropertyData
- 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) 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) 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
- 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, deviceName, 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) 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 GetArrayID ¶
func ToPropertyData ¶
Types ¶
type DeviceDataRepo ¶
type DeviceDataRepo struct { SchemaStore // contains filtered or unexported fields }
func NewDeviceDataRepo ¶
func NewDeviceDataRepo(dataSource conf.TSDB, getProductSchemaModel schema.GetSchemaModel, getDeviceSchemaModel schema.GetSchemaModel, kv kv.Store) *DeviceDataRepo
func (*DeviceDataRepo) CreateProperty ¶
func (*DeviceDataRepo) DeleteDevice ¶
func (*DeviceDataRepo) DeleteDeviceProperty ¶ added in v1.0.4
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) GetPropertyCountByID ¶
func (*DeviceDataRepo) GetPropertyDataByID ¶
func (d *DeviceDataRepo) GetPropertyDataByID( ctx context.Context, p *schema.Property, filter msgThing.FilterOpt) ([]*msgThing.PropertyData, error)
func (*DeviceDataRepo) Init ¶ added in v1.0.4
func (d *DeviceDataRepo) Init(ctx context.Context) error
func (*DeviceDataRepo) InitDevice ¶
func (*DeviceDataRepo) InitProduct ¶
func (*DeviceDataRepo) InsertEventData ¶
func (*DeviceDataRepo) InsertPropertiesData ¶
func (*DeviceDataRepo) InsertPropertyData ¶
func (*DeviceDataRepo) UpdateProduct ¶
type SchemaStore ¶
type SchemaStore struct { }
func (*SchemaStore) GetDeviceStableBoolName ¶ added in v1.0.4
func (S *SchemaStore) GetDeviceStableBoolName() string
func (*SchemaStore) GetDeviceStableEnumName ¶ added in v1.0.4
func (S *SchemaStore) GetDeviceStableEnumName() string
func (*SchemaStore) GetDeviceStableFloatName ¶ added in v1.0.4
func (S *SchemaStore) GetDeviceStableFloatName() string
func (*SchemaStore) GetDeviceStableIntName ¶ added in v1.0.4
func (S *SchemaStore) GetDeviceStableIntName() string
func (*SchemaStore) GetDeviceStableStringName ¶ added in v1.0.4
func (S *SchemaStore) GetDeviceStableStringName() string
func (*SchemaStore) GetDeviceStableTimestampName ¶ added in v1.0.4
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, deviceName, 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) 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.