Documentation ¶
Index ¶
- Variables
- type DB
- func (db *DB) Begin(writable bool) (*Tx, error)
- func (db *DB) Close() error
- func (db *DB) Delete(qs ...q.Query) (int, error)
- func (db *DB) DeleteKV(qs ...q.Query) error
- func (db *DB) Get(qs ...q.Query) (*post.Post, error)
- func (db *DB) List(qs ...q.Query) ([]post.Post, error)
- func (db *DB) NS(name string) *NS
- func (db *DB) Namespace(name string) *NS
- func (db *DB) Put(qs ...q.Query) (*post.Post, error)
- func (db *DB) Update(qs ...q.Query) (ok bool, err error)
- func (db *DB) WriteTo(w io.Writer) (int64, error)
- type NS
- func (ns *NS) Begin(writable bool) (*Tx, error)
- func (ns *NS) Delete(qs ...q.Query) (int, error)
- func (ns *NS) DeleteKV(qs ...q.Query) error
- func (ns *NS) Get(qs ...q.Query) (*post.Post, error)
- func (ns *NS) List(qs ...q.Query) ([]post.Post, error)
- func (ns *NS) Put(qs ...q.Query) (*post.Post, error)
- func (ns *NS) Update(qs ...q.Query) (ok bool, err error)
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Delete(qs ...q.Query) (n int, err error)
- func (tx *Tx) DeleteKV(qs ...q.Query) error
- func (tx *Tx) Get(qs ...q.Query) (*post.Post, error)
- func (tx *Tx) List(qs ...q.Query) (posts []post.Post)
- func (tx *Tx) Put(qs ...q.Query) (*post.Post, error)
- func (tx *Tx) PutPost(post *post.Post) (err error)
- func (tx *Tx) Rollback() error
- func (tx *Tx) Update(qs ...q.Query) (ok bool, err error)
- func (tx *Tx) WriteTo(w io.Writer) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrDuplicateAlias = errors.New("duplicate alias") )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
A DB to store posts
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx represents a transaction on the database.
func (*Tx) Commit ¶
Commit writes all changes to disk and updates the meta page. Returns an error if a disk write error occurs, or if Commit is called on a read-only transaction.
func (*Tx) Rollback ¶
Rollback closes the transaction and ignores all previous updates. Read-only transactions must be rolled back and not committed.
Click to show internal directories.
Click to hide internal directories.