Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v0.2.42 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDir

func DefaultDir() string

DefaultDir returns ~/.langsmith/cache.

func PathForKey

func PathForKey(dir, prefix, key string) string

PathForKey returns a cache file path using a SHA256 hash of the key.

func ReadIfFresh

func ReadIfFresh(path string, ttl time.Duration) ([]byte, error)

ReadIfFresh reads a cached file if it exists and is within TTL.

func Write

func Write(path string, data []byte) error

Write writes data to a cache file, creating parent directories as needed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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