graphcache

package
v1.166.0 Latest Latest
Warning

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

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

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