Documentation ¶
Overview ¶
Package testdb implements an in-memory database for use in tests.
Index ¶
- type DB
- func (db *DB) Begin(_ context.Context) (db.Tx, error)
- func (db *DB) CheckAllTransactionsCommitted(t *testing.T)
- func (tdb *DB) CreateTask(_ db.Tx, userID todo.UserID) (todo.TaskID, error)
- func (tdb *DB) CreateUser(tx db.Tx, provider authn.Provider, authID authn.UserID, name string, ...) (todo.UserID, error)
- func (tdb *DB) DeleteTask(_ db.Tx, id todo.TaskID) error
- func (db *DB) NoTxn(_ context.Context) db.Tx
- func (tdb *DB) RunOrContinueTransaction(tx db.Tx, fn func(tx db.Tx) error) error
- func (tdb *DB) Task(_ db.Tx, id todo.TaskID) (*todo.Task, error)
- func (tdb *DB) TasksByCreator(_ db.Tx, userID todo.UserID) ([]*todo.Task, error)
- func (db *DB) Transactional(_ context.Context, fn func(_ db.Tx) error) error
- func (tdb *DB) UpdateTask(_ db.Tx, id todo.TaskID, ms ...db.UpdateTaskFn) error
- func (tdb *DB) UpdateUser(_ db.Tx, id todo.UserID, ms ...db.UpdateUserFn) error
- func (tdb *DB) User(_ db.Tx, id todo.UserID) (*todo.User, error)
- func (tdb *DB) UserByAuthnProvider(tx db.Tx, authProvider authn.Provider, authID authn.UserID) (*todo.User, error)
- func (tdb *DB) Users(_ db.Tx) ([]*todo.User, error)
- type Op
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CheckAllTransactionsCommitted ¶
func (*DB) CreateUser ¶
func (*DB) RunOrContinueTransaction ¶
func (*DB) TasksByCreator ¶
func (*DB) Transactional ¶
func (*DB) UpdateTask ¶
func (*DB) UpdateUser ¶
func (*DB) UserByAuthnProvider ¶
Click to show internal directories.
Click to hide internal directories.