lists

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Back

func Back(list string) (data interface{}, seq int, err error)

Back returns last element and it's sequence number Returns error if list is empty

func Drop

func Drop(list string) (err error)

func Front

func Front(list string) (data interface{}, seq int, err error)

Front moves cursor to the front of the list, returns first element and it's sequence number Returns error if list is empty

func Get added in v0.0.20

func Get(list string, n int) (data interface{}, err error)

Get returns element by provided sequence number Returns error if list is empty or element was not found

func GetByID added in v0.0.20

func GetByID(list string, _id string) (data interface{}, n int, err error)

GetByID returns element by provided _id property of the stored map Returns error if list is empty or element was not found

func Init

func Init(file string)

Init is the main entrypoint for the package

func Len

func Len(list string) (l uint64)

Len returns total number of the elements in the list

func Next

func Next(list string, _n int) (data interface{}, n int, err error)

func Prev

func Prev(list string, _n int) (data interface{}, n int, err error)

func PushBack

func PushBack(list string, data interface{}) (n int, err error)

PushBack adds element to the back of the list and returns it's sequence number Returns error if it can't add element

func PushFront

func PushFront(list string, data interface{}) (n int, err error)

PushFront adds element to the front of the list and returns it's sequence number Returns error if it can't add element

func Remove

func Remove(list string, n int) (err error)

Remove removes element by provided sequence number Returns error if queue is not exists or it can't write changes

func RemoveByID

func RemoveByID(list string, _id string) (err error)

RemoveByID removes element by provided _id property of the stored map Returns error if queue is not exists or it can't write changes

func UpdateByID added in v0.0.21

func UpdateByID(list string, data interface{}) (err error)

UpdateByID updates element by provided _id property of the passed element Returns error if queue is not exists or if item was not found it can't write changes

Types

This section is empty.

Jump to

Keyboard shortcuts

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