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

localfiles

package
v0.1.70 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

Local file browsing

The connection service mounts GET /api/v1/connections/files?path=/path/to/directory. An empty path starts at the server user's home; a file path opens its parent. Responses contain path, parent, and entries with name, path, directory, and an optional problem. File contents are never returned. Symlinks navigate to their targets; inaccessible entries carry an error.

Both the client address and HTTP Host must be loopback. Cross-site browser requests are refused. Forwarded headers do not grant access. Local development proxies may use a loopback Origin on another port.

Query exposes file-backed connections from the global XDG flanksource/connections folder, its configured state directory's connections folder, and the working directory's .connections folder. Later folders override earlier folders by namespace/name. They are live and read-only, and take precedence over database connection names. Normal connection access is available remotely; directory browsing is restricted to loopback.

Run query serve --dev --port 8088, open http://localhost:8088/connection, and choose Add Connection → SQLite → Browse. Selection updates the form draft; Save persists it.

Query passes accept={[".db", ".sqlite", ".sqlite3"]} to the generic shared picker. SQLite URL conversion lives in www/src/sqliteFileURL.ts: sqliteFileURL escapes path delimiters and retains existing DSN options, while sqlitePath extracts the initial browsing path. The shared component has no SQLite-specific filtering or URL handling.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(prefix string, next http.Handler) http.Handler

Handler serves metadata only. It deliberately ignores forwarded client addresses.

Types

type FileEntry

type FileEntry struct {
	Name      string `json:"name"`
	Path      string `json:"path"`
	Directory bool   `json:"directory"`
	Problem   string `json:"problem,omitempty"`
}

type Listing

type Listing struct {
	Path    string      `json:"path"`
	Parent  string      `json:"parent"`
	Entries []FileEntry `json:"entries"`
}

Jump to

Keyboard shortcuts

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