cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OBJECT_STORE_MAX_CAP = 1000
)
View Source
const (
	THREAD_SAFE_MAP_MAX_CAP = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IObjStore

type IObjStore interface {
	Add(interface{}, string, interface{}) error
	Get(interface{}, string) (interface{}, error)

	Exist(interface{}, string) bool
	Len() int

	Delete(interface{}, string) error
	Update(interface{}, string, interface{}) error
	List() []IThreadSafeMap
}

func NewObjStore

func NewObjStore(cap int) IObjStore

type IThreadSafeMap

type IThreadSafeMap interface {
	Add(string, interface{}) error
	Get(string) (interface{}, error)

	CleanAll() error
	Exist(string) bool
	Len() int

	Delete(string) error
	Update(string, interface{}) error
	List() []interface{}
}

thread safe map

func NewThreadSafeMap

func NewThreadSafeMap(cap int) IThreadSafeMap

type ObjStore

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

func (*ObjStore) Add

func (obj *ObjStore) Add(section interface{}, key string, value interface{}) error

func (*ObjStore) Delete

func (obj *ObjStore) Delete(section interface{}, key string) error

func (*ObjStore) Exist

func (obj *ObjStore) Exist(section interface{}, key string) bool

func (*ObjStore) Get

func (obj *ObjStore) Get(section interface{}, key string) (interface{}, error)

func (*ObjStore) Len

func (obj *ObjStore) Len() int

func (*ObjStore) List

func (obj *ObjStore) List() []IThreadSafeMap

func (*ObjStore) Update

func (obj *ObjStore) Update(section interface{}, key string, value interface{}) error

type ThreadSafeMap

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

func (*ThreadSafeMap) Add

func (t *ThreadSafeMap) Add(key string, item interface{}) error

func (*ThreadSafeMap) CleanAll

func (t *ThreadSafeMap) CleanAll() error

清理

func (*ThreadSafeMap) Delete

func (t *ThreadSafeMap) Delete(key string) error

func (*ThreadSafeMap) Exist

func (t *ThreadSafeMap) Exist(key string) bool

func (*ThreadSafeMap) Get

func (t *ThreadSafeMap) Get(key string) (interface{}, error)

func (*ThreadSafeMap) Len

func (t *ThreadSafeMap) Len() int

func (*ThreadSafeMap) List

func (t *ThreadSafeMap) List() []interface{}

func (*ThreadSafeMap) Update

func (t *ThreadSafeMap) Update(key string, item interface{}) error

Jump to

Keyboard shortcuts

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