cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotCached = errors.New("not cached")

Functions

func DefaultDir

func DefaultDir() string

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func New

func New(dir string) (*Cache, error)

func (*Cache) Resolve

func (c *Cache) Resolve(ctx context.Context, m module.Module, ttl time.Duration) block.Block

Resolve returns the block for a module, using cache if fresh, running it if stale.

type Entry

type Entry struct {
	Text      string        `json:"text"`
	Status    *block.Status `json:"status,omitempty"`
	FetchedAt time.Time     `json:"fetched_at"`
}

Jump to

Keyboard shortcuts

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