Categorygithub.com/mholt/caddy-sqlite-fs
modulepackage
0.0.0-20241031163628-907dd6d956bf
Repository: https://github.com/mholt/caddy-sqlite-fs.git
Documentation: pkg.go.dev

# README

SQLite FS plugin for Caddy

[!WARNING] I whipped this up quickly as a proof of concept. It is experimental and likely has bugs.

This package implements a virtual file system for Caddy using SQLite.

It expects a path to a SQLite database with at least this table in its schema:

CREATE TABLE IF NOT EXISTS "files" (
	"name" TEXT PRIMARY KEY, -- full file path compliant with: https://pkg.go.dev/io/fs#ValidPath
	"content" BLOB,          -- file bytes
	"modified" INTEGER,      -- unix timestamp of last modification
	"mode" INTEGER           -- file mode
);

It can be used like so in the Caddyfile:

file_server /database/* {
	fs sqlite data.sql
}

[!NOTE] This is not an official repository of the Caddy Web Server organization.

# Structs

SQLiteFS implements a virtual file system with a sqlite database.