storefile

package
v0.7.58 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package storefile holds the file primitives the stores under the runner home share (the credential stores of pkg/runner/connection and pkg/runner/modelsignin, the MCP server store of pkg/runner/mcpinstall): an exclusive lock file a writer holds, waited for or tried, a 0600 write by rename, and a removal that takes a missing file as done.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(path, what string) (func(), error)

Lock holds an exclusive lock on the file at path, made 0600 (its directory 0700) when missing, waiting for another process holding it, until the returned func is called. what names it in an error.

func RemoveIfThere

func RemoveIfThere(path string) error

RemoveIfThere removes path; a missing one is not an error.

func TryLock

func TryLock(path, what string) (unlock func(), held bool, err error)

TryLock is Lock without waiting: held says another process, or another open file of this one, holds the lock, and nothing is held then.

func WriteAtomic

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

WriteAtomic writes data 0600 beside path and renames it over path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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