example

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: 1

Documentation

Index

Constants

View Source
const (
	//NotFoundErrorTestValue not found error
	NotFoundErrorTestValue = cacheErrorTestValue("key not found")
	//NilValueErrorTestValue nil pointer given
	NilValueErrorTestValue = cacheErrorTestValue("value pointer shouldnt be nil")
	//CloseErrorTestValue cache is closed
	CloseErrorTestValue = cacheErrorTestValue("cache has been closed")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheTestValue

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

CacheTestValue typed cache

func NewNiceCacheTestValue

func NewNiceCacheTestValue() *CacheTestValue

NewNiceCacheTestValue typed cache constructor

func (*CacheTestValue) Close

func (c *CacheTestValue) Close()

Close cache

func (*CacheTestValue) Delete

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

Delete value by key

func (*CacheTestValue) Flush

func (c *CacheTestValue) Flush() error

Flush cache. Can take a time

func (*CacheTestValue) Get

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

Get value by key

func (*CacheTestValue) Len

func (c *CacheTestValue) Len() int

Len get stored elements count

func (*CacheTestValue) Set

func (c *CacheTestValue) 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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