Documentation
¶
Index ¶
- Variables
- type DB
- func (db *DB) GetNarInfoRecord(tx *sql.Tx, hash string) (NarInfoModel, error)
- func (db *DB) GetNarRecord(tx *sql.Tx, hash string) (NarModel, error)
- func (db *DB) InsertNarInfoRecord(tx *sql.Tx, hash string) (sql.Result, error)
- func (db *DB) InsertNarRecord(tx *sql.Tx, narInfoID int64, hash, compression string, fileSize uint64) (sql.Result, error)
- func (db *DB) TouchNarInfoRecord(tx *sql.Tx, hash string) (sql.Result, error)
- func (db *DB) TouchNarRecord(tx *sql.Tx, hash string) (sql.Result, error)
- type NarInfoModel
- type NarModel
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned if record is not found in the database. ErrNotFound = errors.New("not found") // ErrAlreadyExists is returned if record insertion failed due to uniqueness constraint. ErrAlreadyExists = errors.New("error already exists") )
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB is the main database wrapping *sql.DB and have functions that can operate on nar and narinfos.
func (*DB) GetNarInfoRecord ¶ added in v0.0.6
func (*DB) GetNarRecord ¶ added in v0.0.6
func (*DB) InsertNarInfoRecord ¶
InsertNarInfoRecord creates a new narinfo record in the database.
func (*DB) InsertNarRecord ¶
func (db *DB) InsertNarRecord(tx *sql.Tx, narInfoID int64, hash, compression string, fileSize uint64, ) (sql.Result, error)
InsertNarRecord creates a new nar record in the database.
func (*DB) TouchNarInfoRecord ¶
TouchNarInfoRecord updates the last_accessed_at of a narinfo record in the database.
Click to show internal directories.
Click to hide internal directories.