keycache

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 4 Imported by: 0

README

keycache

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSign

func CheckSign(b, sign []byte) bool

func Encode

func Encode(item IItem) ([]byte, error)

Types

type IItem

type IItem interface {
	Key() string
	Sign() []byte

	Decode([]byte) error
	Encode() ([]byte, error)
}

type IKeyCache

type IKeyCache interface {
	Count() int
	Get(item IItem) error
	Set(item IItem) error
	Del(item IItem)
	Exists(item IItem) bool
}

func New

func New(maxSize ...int) IKeyCache

type KeyCache

type KeyCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*KeyCache) Count

func (cache *KeyCache) Count() int

func (*KeyCache) Del

func (cache *KeyCache) Del(item IItem)

func (*KeyCache) Exists

func (cache *KeyCache) Exists(item IItem) bool

func (*KeyCache) Get

func (cache *KeyCache) Get(item IItem) error

func (*KeyCache) Set

func (cache *KeyCache) Set(item IItem) error

Directories

Path Synopsis
Package mmock is a generated GoMock package.
Package mmock is a generated GoMock package.

Jump to

Keyboard shortcuts

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