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

runcache

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package runcache keeps the JSON report of the last analysis of each project in the user cache directory, so a later command can read it back without running the analysis again.

Layout, under the root (<user cache dir>/plumber/runs):

<provider>/<owner>/<repo>.json  a remote or detected project
local/<hash>.json               a local analysis with no project path,
                                the hash of its absolute working directory
last                            the path, relative to the root, of the
                                most recently written report

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(root, provider, project string) (string, error)

Find is the cached report of project, under provider, or under the one provider that has it when provider is empty; an error wrapping fs.ErrNotExist when none has it.

func Key

func Key(provider, project, cwd string) string

Key is where a run's report goes, relative to the root, in slash form: <provider>/<project segments>.json for a project, local/<hash>.json with no project, the hash read off cwd. Every segment is sanitized (segment), so a key never leaves the root.

func Last

func Last(root string) (string, error)

Last is the path of the most recently written report; an error wrapping fs.ErrNotExist when no run was cached.

func Root

func Root(userCacheDir string) string

Root is the cache root under a user cache directory.

func Write

func Write(root, rel string, payload []byte) error

Write stores payload at rel under root, then points last at it. Both writes go through a temporary file renamed into place, readable by the user alone.

Types

This section is empty.

Jump to

Keyboard shortcuts

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