tex2cache

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package tex2cache provides caching mechanism for caching and scheduling the process of caching.

The cache is done by SHA256 hashing the key, and append zero bytes to the end when there's collision.

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 the interface object to accessing cache.

func New

func New(
	ctx context.Context, group *errgroup.Group,
	readDir, writeDir string, cacheSize int,
) (*Cache, error)

New creates the cache object and so that they could be used for application here.

func (*Cache) Load

func (cache *Cache) Load(
	key []byte, generate func() ([]byte, error),
) ([]byte, error)

Load access the cache and retrieve the content.

Jump to

Keyboard shortcuts

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