package storedefs

import ""

Package storedefs contains definitions of the store API.

It is a separate package so that packages that only depend on the store API does not need to depend on the concrete implementation.


Package Files



var ErrNoMatchingCmd = errors.New("no matching command line")

ErrNoMatchingCmd is the error returned when a LastCmd or FirstCmd query completes with no result.

var NoBlacklist = map[string]struct{}{}

NoBlacklist is an empty blacklist, to be used in GetDirs.

type Cmd

type Cmd struct {
    Text string
    Seq  int

Cmd is an entry in the command history.

func (Cmd) IsStructMap

func (Cmd) IsStructMap()

type Dir

type Dir struct {
    Path  string
    Score float64

Dir is an entry in the directory history.

func (Dir) IsStructMap

func (Dir) IsStructMap()

type Store

type Store interface {
    NextCmdSeq() (int, error)
    AddCmd(text string) (int, error)
    DelCmd(seq int) error
    Cmd(seq int) (string, error)
    CmdsWithSeq(from, upto int) ([]Cmd, error)
    NextCmd(from int, prefix string) (Cmd, error)
    PrevCmd(upto int, prefix string) (Cmd, error)

    AddDir(dir string, incFactor float64) error
    DelDir(dir string) error
    Dirs(blacklist map[string]struct{}) ([]Dir, error)

    SharedVar(name string) (string, error)
    SetSharedVar(name, value string) error
    DelSharedVar(name string) error

Store is an interface satisfied by the storage service.

Package storedefs imports 1 packages (graph).

Version v0.17.0 (latest) | Published Dec 7, 2021 | Platform: linux/amd64 | Updated 1 day ago

Tools for package owners.