Documentation
¶
Index ¶
- Variables
- type Condition
- type ConditionFunc
- func WithID(id string) ConditionFunc
- func WithLimit(limit int) ConditionFunc
- func WithMeasurements(withMeasurments string) ConditionFunc
- func WithOffset(offset int) ConditionFunc
- func WithState(withState string) ConditionFunc
- func WithTenants(tenants []string) ConditionFunc
- func WithThingID(thingID string) ConditionFunc
- func WithType(types []string) ConditionFunc
- type Config
- type Db
- func (db Db) AddRelatedThing(ctx context.Context, v []byte, conditions ...ConditionFunc) error
- func (db Db) CreateThing(ctx context.Context, v []byte) error
- func (db Db) QueryThings(ctx context.Context, conditions ...ConditionFunc) (QueryResult, error)
- func (db Db) RetrieveRelatedThings(ctx context.Context, conditions ...ConditionFunc) ([]byte, error)
- func (db Db) RetrieveThing(ctx context.Context, conditions ...ConditionFunc) ([]byte, string, error)
- func (db Db) UpdateThing(ctx context.Context, v []byte) error
- type QueryResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists error = fmt.Errorf("thing already exists")
View Source
var ErrNotExist error = fmt.Errorf("thing does not exists")
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct { ID string Types []string ThingID string Offset int Limit int Tenants []string Measurements bool State bool }
func NewCondition ¶
func NewCondition(conditions ...ConditionFunc) *Condition
type ConditionFunc ¶
func WithID ¶
func WithID(id string) ConditionFunc
func WithLimit ¶
func WithLimit(limit int) ConditionFunc
func WithMeasurements ¶
func WithMeasurements(withMeasurments string) ConditionFunc
func WithOffset ¶
func WithOffset(offset int) ConditionFunc
func WithState ¶
func WithState(withState string) ConditionFunc
func WithTenants ¶
func WithTenants(tenants []string) ConditionFunc
func WithThingID ¶
func WithThingID(thingID string) ConditionFunc
func WithType ¶
func WithType(types []string) ConditionFunc
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func LoadConfiguration ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
func (Db) AddRelatedThing ¶
func (Db) QueryThings ¶
func (db Db) QueryThings(ctx context.Context, conditions ...ConditionFunc) (QueryResult, error)
func (Db) RetrieveRelatedThings ¶
func (Db) RetrieveThing ¶
Click to show internal directories.
Click to hide internal directories.