storedefs

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package storedefs contains definitions used by the store package.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyHOME = errors.New("environment variable HOME is empty")

ErrEmptyHOME is the error returned by EnsureDataDir when the environmental variable HOME is empty.

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

func EnsureDataDir

func EnsureDataDir() (string, error)

EnsureDataDir ensures Elvish's data directory exists, creating it if necessary. It returns the path to the data directory (never with a trailing slash) and possible error.

Types

type Dir

type Dir struct {
	Path  string
	Score float64
}

Dir is an entry in the directory history.

type Store

type Store interface {
	Seek(int) (int, error)
	Cur() (int, error)
	Prev() (int, error)
	Next() (int, error)
	Remove(int) error
	Add(text string) (int, error)
	One(int) (string, error)
	List(int, int) ([]string, error)
	Walk(from int, to int, f func(string) bool) error
	Search(from int, prefix string) (int, string, error)
	RSearch(upto int, prefix string) (int, string, error)
}

Store is an interface for things like command history It assumes we have a 'cursor', which we can adjust.

Jump to

Keyboard shortcuts

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