storage

package
v0.0.0-...-fffcc82 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

Collection describes a collection of key value pairs

func New

func New(name string) (*Collection, error)

New return a instance of collection

func (*Collection) Flush

func (c *Collection) Flush() error

Flush delete a collection with its value

func (*Collection) Get

func (c *Collection) Get(key string, value interface{}) error

Get retrieve a value from collection by key

func (*Collection) Has

func (c *Collection) Has(key string) bool

Has check a key exist in the collection

func (*Collection) List

func (c *Collection) List() ([]string, error)

List fetch all items key in collection

func (*Collection) Put

func (c *Collection) Put(key string, value interface{}) error

Put store a new key with value in the collection

func (*Collection) Remove

func (c *Collection) Remove(key string) error

Remove delete a key from collection

func (*Collection) TotalItem

func (c *Collection) TotalItem() int

TotalItem return total item count

Jump to

Keyboard shortcuts

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