cache

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteView

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

func (ByteView) ByteSlice

func (v ByteView) ByteSlice() []byte

func (ByteView) Len

func (v ByteView) Len() int

func (ByteView) String

func (v ByteView) String() string

type Cache

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

func GetCacheByName

func GetCacheByName(name string) *Cache

func NewCacheByName

func NewCacheByName(name string, cacheBytes int64, getter Getter) *Cache

func (*Cache) Add

func (c *Cache) Add(key string, value ByteView)

func (*Cache) Get

func (c *Cache) Get(key string) (value ByteView, ok bool)

type Getter

type Getter interface {
	Get(key string) ([]byte, error)
}

A Getter loads data for a key.

type GetterFunc

type GetterFunc func(key string) ([]byte, error)

A GetterFunc implements Getter with a function.

func (GetterFunc) Get

func (f GetterFunc) Get(key string) ([]byte, error)

Get implements Getter interface function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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