favourite

package
v0.0.0-...-a380f54 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2018 License: BSD-2-Clause Imports: 3 Imported by: 2

Documentation

Overview

Package favourite defines methods for setting/getting favourites for paths and persisting this data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// Set the rating for the path.
	Set(index.Path, bool) error

	// Get the rating for the path.
	Get(index.Path) bool

	// List retuns a list of paths in the favourite Store.
	List() []index.Path
}

Store is an interface which defines methods necessary for setting and getting favourites for index paths.

func NewStore

func NewStore(path string) (Store, error)

NewStore creates a basic implementation of a favourites store, using the given path as the source of data. Note: we do not enforce any locking on the underlying file, which is read once to initialise the store, and then overwritten after each call to Set.

Jump to

Keyboard shortcuts

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