files

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package files implements the tailkitd files integration:

POST /files        — receive a file written atomically to the node
GET  /files?path=  — read a single file (JSON wrapper or raw bytes)
GET  /files?dir=   — list a directory

Both reads and writes are gated by files.toml configuration. Path traversal is checked on every operation before any filesystem I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves GET and POST /files.

func NewHandler

func NewHandler(cfg config.FilesConfig, reg *exec.Registry, jobs *exec.JobStore, logger *zap.Logger) *Handler

NewHandler constructs a files Handler. If cfg.Enabled is false the handler responds 503 to all requests.

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux)

Register mounts the files endpoints onto mux.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP dispatches on HTTP method.

Jump to

Keyboard shortcuts

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