native

package
v0.0.0-...-5607d3c Latest Latest
Warning

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

Go to latest
Published: May 13, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	LastN uint8
	Board string
	ID    uint64
}

Key stores the ID of either a thread or board page

type NativeCache

type NativeCache struct {

	// Size sets the maximum size of the cache before evicting unread data in MB
	Size float64
	// contains filtered or unexported fields
}

NativeCache implements cache.Cache

func New

func New(sz float64) *NativeCache

New Creates New Native Cache instance

func (*NativeCache) ClearAll

func (n *NativeCache) ClearAll()

Clear the cache. Only used for testing.

func (*NativeCache) Get

func (n *NativeCache) Get(key common.SearchParam, fn func() ([]model.Torrent, int, error)) (
	data []model.Torrent, count int, err error,
)

Check the cache for and existing record. If miss, run fn to retrieve fresh values.

Jump to

Keyboard shortcuts

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