db

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Root string
}

func (*DB) Begin

func (db *DB) Begin(m *Manifest) (*Txn, error)

func (*DB) Delete

func (db *DB) Delete(m *Manifest) (*Txn, error)

func (*DB) List

func (d *DB) List(fn func(m *Manifest) error) error

func (*DB) Query

func (d *DB) Query(url string) (*Manifest, error)

type File

type File struct {
	Name string `yaml:"name"`
	Dir  bool   `yaml:"dir,omitempty"`
}

type Manifest

type Manifest struct {
	Name        string        `yaml:"name,omitempty"`
	Description string        `yaml:"description,omitempty"`
	State       ManifestState `yaml:"state"`

	URL string `yaml:"url"` // TODO: checksum

	Files []*File `yaml:"files"`
}

type ManifestState

type ManifestState string
const (
	UnknownManifestState       ManifestState = "unknown"
	InstalledManifestState     ManifestState = "installed"
	PendingManifestState       ManifestState = "pending"
	BrokenInstallManifestState ManifestState = "broken_install"
	BrokenManifestState        ManifestState = "broken"
	PendingDeleteManifestState ManifestState = "pending_delete"
	BrokenDeleteManifestState  ManifestState = "broken_delete"
)

type Txn

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

func (*Txn) Commit

func (t *Txn) Commit() error

func (*Txn) Rollback

func (t *Txn) Rollback()

Jump to

Keyboard shortcuts

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