storage

package
v0.0.0-...-ad861b7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT, Unlicense Imports: 2 Imported by: 0

Documentation

Overview

Package storage specifies a storage interface for Kanban Projects. Sub packages implement the interface providing different storage strategies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storer

type Storer interface {
	// Create a new Project.
	Create(kanban.Project) error
	// Save one or more existing Projects, updating the storage device.
	Save(...kanban.Project) error
	// Load updates the Projects using data from the storage device.
	// Allows caller to allocate and control memory.
	// Avoids copying.
	Load([]kanban.Project) error
	// Find a Project by ID.
	Find(id uuid.UUID) (kanban.Project, bool, error)
	// List all existing Projects.
	List() ([]kanban.Project, error)
	// Count returns the number of projects that exist in the store.
	Count() (int, error)
	// Archive a project.
	// An archived project will have it's data saved, but won't show up under
	// normal queries.
	Archive(uuid.UUID) error
	// ListArchived lists all archived projects.
	ListArchived() ([]kanban.Project, error)
	// Restore takes an archived project and makes it live again.
	Restore(uuid.UUID) error
}

Storer persists Project entities.

Directories

Path Synopsis
Package lazy implements a lazy storage that only touches the disk when necessary.
Package lazy implements a lazy storage that only touches the disk when necessary.

Jump to

Keyboard shortcuts

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