graphcache

package
v1.167.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package graphcache keeps derived script graphs: a least-recently-used map keyed by the digest of what a graph was derived from (scriptflow).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[V any] struct {
	// contains filtered or unexported fields
}

Cache is a least-recently-used map of values by key.

func New

func New[V any](limit int) *Cache[V]

New is a cache keeping at most limit values.

func (*Cache[V]) Get

func (c *Cache[V]) Get(key Key) (V, bool)

Get is the value kept under key, marking it the most recently used.

func (*Cache[V]) Put

func (c *Cache[V]) Put(key Key, value V)

Put keeps value under key, dropping the least recently used past the limit.

type Key

type Key = [sha256.Size]byte

Key is the digest a value is kept under.

func KeyOf

func KeyOf(source string, parts map[string]string) Key

KeyOf is the digest of source and each named part, the parts in name order, so the same inputs always give the same key.

Jump to

Keyboard shortcuts

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