config

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	ReadEntries() (scoring.Entries, error)
	WriteEntries(scoring.Entries) error

	ReadSearch() Search
	WriteSearch(string, int) error

	ReadPins() (map[string]string, error)
	FindPin(string) (string, bool)
	WritePin(string, string) error
	RemovePin(string) error
}

Config represents the config directory and all the miscellaneous configuration files we can have in there.

func Setup

func Setup(dir string) (Config, error)

Setup setups the config folder from a directory path.

If the directories don't already exists, they are created and if the score file is present, it is loaded.

func SetupDefault

func SetupDefault(dir string) (Config, error)

SetupDefault setups the config folder from a directory path.

If the directory path is an empty string, the path is automatically guessed.

type Search struct {
	Term  string
	Index int
}

Search represents a search term used for advancing through the entries of the same term.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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