memory

package
v0.0.0-...-b98e79d Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 2 Imported by: 8

Documentation

Overview

Package memory provides an in-memory imageserver/cache.Cache implementation.

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 is an in-memory imageserver/cache.Cache implementation.

It uses https://github.com/pierrre/lrucache (copy of https://github.com/youtube/vitess/tree/master/go/cache) .

func New

func New(capacity int64) *Cache

New creates a new Cache.

capacity is the maximum cache size (in bytes).

func (*Cache) Get

func (cache *Cache) Get(key string, params imageserver.Params) (*imageserver.Image, error)

Get implements imageserver/cache.Cache.

func (*Cache) Set

func (cache *Cache) Set(key string, image *imageserver.Image, params imageserver.Params) error

Set implements imageserver/cache.Cache.

Jump to

Keyboard shortcuts

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