cache

package
v0.0.0-...-4e81ba4 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: 4

Documentation

Overview

Package cache manager

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache cache

func NewCache

func NewCache(max int32) *Cache

NewCache set amx

func (*Cache) AddORUpdate

func (cc *Cache) AddORUpdate(key string, v interface{}) (c int32, err error)

AddORUpdate set value

func (*Cache) Del

func (cc *Cache) Del(key string)

Del delete

func (*Cache) Delete

func (cc *Cache) Delete(key string)

Delete delete

func (*Cache) Get

func (cc *Cache) Get(key string) (v interface{}, err error)

Get get value

func (*Cache) Len

func (cc *Cache) Len() int32

Len get record

func (*Cache) Range

func (cc *Cache) Range(fn RangeCall)

Range range

func (*Cache) Set

func (cc *Cache) Set(key string, v interface{}) (c int32, err error)

Set set value

type RangeCall

type RangeCall func(k, v interface{}) bool

RangeCall range call back

Jump to

Keyboard shortcuts

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