database

package
v0.0.0-...-8220668 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database - Represents a connection to a goamt SQLite database and exposes a thread safe interface.

func Create

func Create(path string) (*Database, error)

Create - Create a new database, returning an error if an existing database already exists.

func Open

func Open(path string) (*Database, error)

Open - Open an existing database returning an error if the provided database is missing or an unsupported version.

func (*Database) BeginTranscoding

func (d *Database) BeginTranscoding() (value.Entry, error)

BeginTranscoding - Retrieve an untranscoded entry from the database, note that a job will be created for the provided entry which should be completed/cancelled (in the event of a failure, this will happen the next time the database is opened).

func (*Database) CancelTranscoding

func (d *Database) CancelTranscoding(entry value.Entry) error

CancelTranscoding - Cancel the job for the provided entry.

func (*Database) Close

func (d *Database) Close() error

Close - Close the database, the database should not be used after it has been closed.

func (*Database) CompleteTranscoding

func (d *Database) CompleteTranscoding(entry value.Entry) error

CompleteTranscoding - Rehash and mark the provided entry as having been transcoded.

func (*Database) Remove

func (d *Database) Remove(entry value.Entry) error

Remove - Remove the provided entry from the database; this will also remove any incomplete jobs for the provided entry.

func (*Database) Upsert

func (d *Database) Upsert(entry value.Entry) error

Upsert - Update or insert the provided entry into the database; the entry will be updated in the event of a hash conflict.

type ErrAlreadyExists

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

ErrAlreadyExists - Returned when the user attempts to create a database which already exists.

func (*ErrAlreadyExists) Error

func (e *ErrAlreadyExists) Error() string

type ErrNotFound

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

ErrNotFound - Returned when the user attempts to open a database which doesn't exist.

func (*ErrNotFound) Error

func (e *ErrNotFound) Error() string

type ErrUnknownVersion

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

ErrUnknownVersion - Returned when the user attempts to open a database with an unknown version.

func (*ErrUnknownVersion) Error

func (e *ErrUnknownVersion) Error() string

Jump to

Keyboard shortcuts

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