schemaDataRepo

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROPERTY_TYPE = "property_type"
)

Variables

This section is empty.

Functions

func ToEventData

func ToEventData(db map[string]any) *msgThing.EventData

func ToPropertyData

func ToPropertyData(id string, db map[string]any) *msgThing.PropertyData

Types

type SchemaDataRepo

type SchemaDataRepo struct {
	stores.SchemaStore
	// contains filtered or unexported fields
}

func NewSchemaDataRepo

func NewSchemaDataRepo(dataSource string, getSchemaModel schema.GetSchemaModel, kv kv.Store) *SchemaDataRepo

func (*SchemaDataRepo) GenInsertPropertySql added in v0.6.0

func (d *SchemaDataRepo) GenInsertPropertySql(ctx context.Context, t *schema.Model, productID string, deviceName string, property *msgThing.PropertyData) (sql string, args []any, err error)

func (*SchemaDataRepo) GenSql added in v0.6.0

func (d *SchemaDataRepo) GenSql(sql ...string) string

func (*SchemaDataRepo) GetEventCountByFilter

func (d *SchemaDataRepo) GetEventCountByFilter(
	ctx context.Context,
	filter msgThing.FilterOpt) (int64, error)

func (*SchemaDataRepo) GetEventDataByFilter

func (d *SchemaDataRepo) GetEventDataByFilter(
	ctx context.Context,
	filter msgThing.FilterOpt) ([]*msgThing.EventData, error)

func (*SchemaDataRepo) GetLatestPropertyDataByID added in v0.4.1

func (d *SchemaDataRepo) GetLatestPropertyDataByID(ctx context.Context, filter msgThing.LatestFilter) (*msgThing.PropertyData, error)

func (*SchemaDataRepo) GetPropertyCountByID

func (d *SchemaDataRepo) GetPropertyCountByID(
	ctx context.Context,
	filter msgThing.FilterOpt) (int64, error)

func (*SchemaDataRepo) GetPropertyDataByID

func (d *SchemaDataRepo) GetPropertyDataByID(
	ctx context.Context,
	filter msgThing.FilterOpt) ([]*msgThing.PropertyData, error)

func (*SchemaDataRepo) InsertEventData

func (d *SchemaDataRepo) InsertEventData(ctx context.Context, productID string,
	deviceName string, event *msgThing.EventData) error

func (*SchemaDataRepo) InsertPropertiesData

func (d *SchemaDataRepo) InsertPropertiesData(ctx context.Context, t *schema.Model, productID string, deviceName string, params map[string]any, timestamp time.Time) error

func (*SchemaDataRepo) InsertPropertyData

func (d *SchemaDataRepo) InsertPropertyData(ctx context.Context, t *schema.Model, productID string, deviceName string, property *msgThing.PropertyData) error

Jump to

Keyboard shortcuts

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