cache

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear added in v0.2.0

func Clear() error

Clear clears the cache. It's used for testing.

func Disable added in v0.2.0

func Disable()

Disable disables the cache; for testing.

func Enable added in v0.2.0

func Enable()

Enable enables the cache; for testing.

func WithFile

func WithFile(header string, content string, fn func() (string, error)) (string, error)

WithFile looks (header, content) up in a user-specific file cache. If found, it writes the file contents. Else it calls fn to write to both the writer and the file system.

header and content are distinct parameters to relieve the caller from having to concatenate them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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