package
0.0.0-20221003172846-a3e1774ef349
Repository: https://github.com/dsoprea/go-utility.git
Documentation: pkg.go.dev

# README

GoDoc Build Status Coverage Status Go Report Card

lru

An LRU implementation. Accessors available for the first item, last item, list of all keys, count, fullness, membership checks, explicit drops, and popping the oldest in a loop. You can also set a callback for when items are dropped and dump the current contents of the LRU.

mimetype

Convenience function for determining a mime-type from an io.Reader.

# Functions

DetectMimetype is a wrapper for GetMimetypeFromContent which returns the mime-type for the given `File`.
GetMimetypeFromContent uses net/http to map from magic-bytes to mime-type.
NewLru returns a new instance.

# Constants

MimetypeLeadBytesCount is the number of bytes to use for detection.

# Variables

ErrLruEmpty indicates that the LRU is empty..

# Structs

Lru establises an LRU of IDs of any type.

# Interfaces

LruItem is the interface that any item we add to the LRU must satisfy.
LruKey is the type of an LRU key.