storedefs

package
v0.0.0-...-91dc524 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

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

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

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

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

Functions

This section is empty.

Types

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.

Jump to

Keyboard shortcuts

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