storage

package
v0.0.0-...-4ac1f56 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllGroups

func AllGroups() []string

AllGroups returns all group names contained in the local store

func AllItems

func AllItems() []*models.Item

AllItems returns all items contained in the local store

func CreateItem

func CreateItem(group, name, value string)

CreateItem creates an item in the store using the given group name, item name and value

func FlushStore

func FlushStore(data *map[string][]*models.Item)

FlushStore overwrites the local store with the provided contents

func GroupNamed

func GroupNamed(name string) []*models.Item

GroupNamed searches for a group with a given name

func GroupOrItemNamed

func GroupOrItemNamed(name string) ([]*models.Item, string)

GroupOrItemNamed searches for either a group or an item with a given name. First, looks for an item whose name matches the given value. If it can't be found, searches for a group whose name matches the given value. Again, if none found, searches for an item using Levenshtein comparsion.

func ItemNamed

func ItemNamed(name string) *models.Item

ItemNamed searches for an item with a given name

func ItemNamedLev

func ItemNamedLev(name string) *models.Item

ItemNamedLev searches for an item with a given name that either fully matches the provided string or is close, when calculated using the Levenshtein string distance algorithm

func ReadStore

func ReadStore() map[string][]*models.Item

ReadStore returns the local store in a managed state

func RemoveItem

func RemoveItem(group, name string)

RemoveItem removes an item with a given name and group

Types

This section is empty.

Jump to

Keyboard shortcuts

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