database

package
v0.0.0-...-e6ba226 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2014 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package database defines the content database.

Package database defines the content database.

Index

Constants

This section is empty.

Variables

View Source
var ExtractNotFound = errors.New("Extract not found")

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func Open

func Open(file string) (*DB, error)

func (*DB) Begin

func (db *DB) Begin() (*Tx, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) ExtractExists

func (db *DB) ExtractExists(id content.ExtractId) (bool, error)

func (*DB) ExtractHasExisted

func (db *DB) ExtractHasExisted(id content.ExtractId) (bool, error)

func (*DB) ExtractLanguages

func (db *DB) ExtractLanguages() ([]language.Code, error)

func (*DB) ExtractList

func (db *DB) ExtractList() ([]*content.Extract, error)

func (*DB) ExtractListWithLanguage

func (db *DB) ExtractListWithLanguage(lang language.Code) ([]*content.Extract, error)

func (*DB) ExtractListWithLanguages

func (db *DB) ExtractListWithLanguages(langA, langB language.Code) ([]*content.Extract, error)

func (*DB) FlavorExists

func (db *DB) FlavorExists(extractId content.ExtractId, lang language.Code, flavorType content.FlavorType, flavorId content.FlavorId) (bool, error)

func (*DB) GetExtract

func (db *DB) GetExtract(id content.ExtractId) (*content.Extract, error)

func (*DB) InsertOrUpdateUnits

func (db *DB) InsertOrUpdateUnits(author user.Name, units []*content.Unit) error

func (*DB) NewExtract

func (db *DB) NewExtract(author user.Name, e *content.Extract) error

func (*DB) NewFlavor

func (db *DB) NewFlavor(author user.Name, f *content.Flavor) error

func (*DB) SlugToIdMap

func (db *DB) SlugToIdMap() (map[string]content.ExtractId, error)

func (*DB) UpdateExtract

func (db *DB) UpdateExtract(author user.Name, e *content.Extract) error

func (*DB) UpdateFlavor

func (db *DB) UpdateFlavor(author user.Name, f *content.Flavor) error

type Tx

type Tx struct {
	*database.Tx
}

func (*Tx) InsertOrUpdateVersioned

func (tx *Tx) InsertOrUpdateVersioned(table string, author user.Name, id *primaryKey, kvPairs interface{}) error

func (*Tx) InsertVersioned

func (tx *Tx) InsertVersioned(table string, author user.Name, values ...interface{}) error

func (*Tx) InsertVersionedFlavor

func (tx *Tx) InsertVersionedFlavor(author user.Name, f *content.Flavor) error

func (*Tx) LatestVersion

func (tx *Tx) LatestVersion(table string, id *primaryKey) (*content.Version, error)

Jump to

Keyboard shortcuts

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