benbjohnson / benbjohnson/genesis

Making the filesystem walkable?

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
294
Forks
1
PR merge metrics
No merged PRs in 30d

Description

I was wondering if you had any interest in making the `http.FileSystem` walkable? I'd be happy to contribute this feature.

The use case is to be able to be able precompile templates on startup, rather than on the request. `http.Dir(...)` already supports walking the filesystem, so the idea is that you'd have two walkable filesystems, `http.Dir` for development, `genesis.FileSystem()` for production.

The walk function would be nearly the same as `filepath.Walk`. Here's what that would look like: https://github.com/shurcooL/httpfs/blob/master/vfsutil/walk.go#L12-L22

Thanks for creating this library!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing http.FileSystem and genesis.FileSystem() APIs, then compare http.Dir’s walking behavior with the referenced vfsutil/walk.go example and filepath.Walk. Done means production’s embedded filesystem can be walked for startup template precompilation while preserving the existing development and production use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.