localcache

package
v0.0.0-...-5859b4f Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug    bool
	Disabled bool
)

Functions

func Delete

func Delete(key string)

func Get

func Get(key string) (value interface{}, ok bool)

func GetAll

func GetAll() (items []string)

func Init

func Init(num int)

func Mget

func Mget(keys []string) (values, valuesAlter map[string]interface{})

func Set

func Set(key string, value interface{}, expire time.Duration) (ent *entry)

Types

type Elem

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

type HashMap

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

func (*HashMap) Delete

func (m *HashMap) Delete(key string)

func (*HashMap) Get

func (m *HashMap) Get(key string) (value interface{}, ok bool)

func (*HashMap) Init

func (m *HashMap) Init(num int) *HashMap

func (*HashMap) Len

func (m *HashMap) Len() int

func (*HashMap) Set

func (m *HashMap) Set(key string, value interface{})

type Lru

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

func NewLru

func NewLru(capacity int) *Lru

func (*Lru) Delete

func (lru *Lru) Delete(key string)

func (*Lru) Get

func (lru *Lru) Get(key string) (ent *entry, ok bool)

func (*Lru) Set

func (lru *Lru) Set(ent *entry)

type MyList

type MyList struct {
	*list.List
}

func (*MyList) MoveToFront

func (l *MyList) MoveToFront(e *list.Element)

func (*MyList) PushFront

func (l *MyList) PushFront(v interface{}) *list.Element

Jump to

Keyboard shortcuts

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