files

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package files is the Files module: a file browser over a small set of named places (root directories on this machine), for the owner and for the agent.

Every path is a place and a path relative to it. locate resolves and checks each one: nothing outside a place is reached, by ".." or through a symbolic link, and files that look like credentials are refused (see sensitive). Nothing is ever overwritten except a text file by a write that names it, and there is no recursive delete.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name string `json:"name"`
	// Path is relative to the place, slash separated.
	Path string `json:"path"`
	Dir  bool   `json:"dir"`
	// Size is in bytes; zero for a folder.
	Size int64 `json:"size"`
	// Modified is RFC 3339, UTC.
	Modified string `json:"modified"`
	Symlink  bool   `json:"symlink,omitempty"`
	// Locked marks an entry on the denylist: it is listed, and nothing else can be done
	// with it.
	Locked bool `json:"locked,omitempty"`
}

Entry is one item of a folder listing.

type Match

type Match struct {
	// Path is relative to the place, slash separated.
	Path string `json:"path"`
	Line int    `json:"line"`
	Text string `json:"text"`
}

Match is one matching line.

type Place

type Place struct {
	// ID is a short slug made from the name ("home", "work-notes").
	ID   string `json:"id"`
	Name string `json:"name"`
	// Path is the absolute path of the root directory.
	Path string `json:"path"`
}

Place is a named root directory on this machine. Files reaches nothing outside its places.

type Text

type Text struct {
	Text string `json:"text"`
	// Truncated says the file goes on after Text.
	Truncated bool `json:"truncated"`
	// Size is the whole file's size in bytes.
	Size int64 `json:"size"`
	// StartLine and EndLine are the first and last line in Text, counted from 1. EndLine
	// is zero when Text is empty.
	StartLine int `json:"start_line"`
	EndLine   int `json:"end_line"`
}

Text is part of a text file.

Jump to

Keyboard shortcuts

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