Documentation ¶
Index ¶
- Constants
- 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) 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) 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) GetEventStableName() string
- func (S *SchemaStore) GetEventTableName(productID, deviceName string) string
- func (S *SchemaStore) GetPropertyStableName(tag schema.Tag, 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) 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 ¶
This section is empty.
Functions ¶
func GetArrayID ¶
func ToPropertyData ¶
Types ¶
type DeviceDataRepo ¶
type DeviceDataRepo struct { SchemaStore // contains filtered or unexported fields }
func NewDeviceDataRepo ¶
func NewDeviceDataRepo(dataSource conf.TSDB, getSchemaModel schema.GetSchemaModel, kv kv.Store) *DeviceDataRepo
func (*DeviceDataRepo) CreateProperty ¶
func (*DeviceDataRepo) DeleteDevice ¶
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) InitDevice ¶
func (*DeviceDataRepo) InitProduct ¶
func (*DeviceDataRepo) InsertEventData ¶
func (*DeviceDataRepo) InsertPropertiesData ¶
func (*DeviceDataRepo) InsertPropertyData ¶
func (*DeviceDataRepo) UpdateProduct ¶
type SchemaStore ¶
type SchemaStore struct { }
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(tag schema.Tag, 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) 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.