Documentation
¶
Overview ¶
Package workspace holds fetched files in the lockfile account: one private directory per handle, a random file name, never the source name. Nothing here is shown to the agent but the handle; Info is for the audit.
Index ¶
Constants ¶
const ( DefaultMaxBytes = 1 << 30 DefaultTTL = 30 * time.Minute )
Defaults for zero Config fields.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle string
Handle names a fetched file for the agent: "f_" and 10 base62 characters from crypto/rand, unrelated to anything about the file.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func Open ¶
Open prepares the workspace root (0700) and removes everything a previous console left in it.
func (*Manager) Create ¶
Create streams r into a new handle, hashing as it copies. It fails with ErrTooLarge, and leaves nothing behind, as soon as the file exceeds max or the space left in the workspace.
func (*Manager) Expire ¶
func (m *Manager) Expire()
Expire deletes the files of every handle past its TTL. The handles keep answering ErrExpired.