internal

package
v0.0.0-...-9d6603c Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//NotFoundError not found error
	NotFoundError = cacheError("key not found")
	//NilValueError nil pointer given
	NilValueError = cacheError("value pointer shouldn`t be nil")
	//CloseError cache is closed
	CloseError = cacheError("cache has been closed")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache typed cache

func NewNiceCache

func NewNiceCache() *Cache

NewNiceCache typed cache constructor

func (*Cache) Close

func (c *Cache) Close()

Close cache

func (*Cache) Delete

func (c *Cache) Delete(key []byte) error

Delete value by key

func (*Cache) Flush

func (c *Cache) Flush() error

Flush cache. Can take a time

func (*Cache) Get

func (c *Cache) Get(key []byte, value *TestValue) error

Get value by key

func (*Cache) Len

func (c *Cache) Len() int

Len get stored elements count

func (*Cache) Set

func (c *Cache) Set(key []byte, value *TestValue, expireSeconds int) error

Set value by key

type TestItem

type TestItem struct {
	ID           string
	N            uint32
	Stat         uint32
	Published    bool
	Deprecated   *bool
	System       uint32
	Subsystem    uint32
	ParentID     string
	Name         string
	Name2        string
	Description  string
	Description2 string
	CreatedBy    uint32
	UpdatedBy    *uint32
	List1        []uint32
	List2        []uint32
}

TestItem some test type to test cache in different package

type TestValue

type TestValue struct {
	ID           string
	N            uint32
	Stat         uint32
	Published    bool
	Deprecated   *bool
	System       uint32
	Subsystem    uint32
	ParentID     string
	Name         string
	Name2        string
	Description  string
	Description2 string
	CreatedBy    uint32
	UpdatedBy    *uint32
	List1        []uint32
	List2        []uint32
	Items        []TestItem
}

TestValue some test type

Jump to

Keyboard shortcuts

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