Documentation
¶
Index ¶
- Variables
- func BuildWhereClause(filters ...string) string
- func CreateSpan(ctx context.Context, tracer opentracing.Tracer, opName string) opentracing.Span
- func GetDirQuery(dir string) string
- func GetGroupIDsQuery(ids []string) string
- func GetMetadataQuery(m map[string]interface{}) (mb []byte, mq string, err error)
- func GetNameQuery(name string) (string, string)
- func GetOffsetLimitQuery(limit uint64) string
- func GetOrderQuery(order string) string
- func GetPayloadQuery(m map[string]interface{}) (mb []byte, mq string, err error)
- func Total(ctx context.Context, db Database, query string, params interface{}) (uint64, error)
- type Database
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMalformedEntity indicates a malformed entity specification. ErrMalformedEntity = errors.New("malformed entity specification") // ErrNotFound indicates that an entity was not found in the database. ErrNotFound = errors.New("entity not found") // ErrConflict indicates that entity an entity with conflicting properties already exists. ErrConflict = errors.New("entity already exists") // ErrCreateEntity indicates an error in attempting to create an entity or entities. ErrCreateEntity = errors.New("failed to create entity") // ErrRetrieveEntity indicates an error in attempting to retrieve an entity or entities. ErrRetrieveEntity = errors.New("failed to retrieve entity") // ErrUpdateEntity indicates an error in attempting to update an entity or entities. ErrUpdateEntity = errors.New("failed to update entity") // ErrRemoveEntity indicates an error in attempting to remove an entity or entities. ErrRemoveEntity = errors.New("failed to remove entity") // ErrScanMetadata indicates an error in attempting to decode entity metadata from the database. ErrScanMetadata = errors.New("failed to scan metadata from db") )
Functions ¶
func BuildWhereClause ¶ added in v0.26.0
func CreateSpan ¶ added in v0.30.1
func CreateSpan(ctx context.Context, tracer opentracing.Tracer, opName string) opentracing.Span
func GetDirQuery ¶
func GetGroupIDsQuery ¶ added in v0.30.0
func GetMetadataQuery ¶
func GetNameQuery ¶
func GetOffsetLimitQuery ¶ added in v0.24.0
func GetOrderQuery ¶
func GetPayloadQuery ¶ added in v0.28.3
Types ¶
type Database ¶ added in v0.26.0
type Database interface {
NamedExecContext(context.Context, string, interface{}) (sql.Result, error)
QueryRowxContext(context.Context, string, ...interface{}) *sqlx.Row
NamedQueryContext(context.Context, string, interface{}) (*sqlx.Rows, error)
SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error
GetContext(context.Context, interface{}, string, ...interface{}) error
BeginTxx(context.Context, *sql.TxOptions) (*sqlx.Tx, error)
}
Database provides a database interface
func NewDatabase ¶ added in v0.26.0
NewDatabase creates a ThingDatabase instance
Click to show internal directories.
Click to hide internal directories.