Documentation
¶
Overview ¶
templ: version: v0.3.1001
Package filebrowse is the shared file browser: one fragment UI and one set of route bodies over any store that can list/read/write/delete by path. Backends today: docker volumes (db data volumes, service volume tiles) and s3 buckets.
Index ¶
- func Browse(c echo.Context, fs Backend, base string) error
- func Browser(c echo.Context, base, dir string, entries []Entry, canWrite bool) templ.Component
- func CleanDir(p string) string
- func Delete(c echo.Context, fs Backend, base string) error
- func Download(c echo.Context, fs Backend) error
- func ErrorFrag(base, msg string) templ.Component
- func Loader(base string) templ.Component
- func Upload(c echo.Context, fs Backend, base string) error
- type Backend
- type Entry
- type VolumeFS
- func (v VolumeFS) Delete(ctx context.Context, p string, dir bool) error
- func (v VolumeFS) List(ctx context.Context, dir string) ([]Entry, error)
- func (v VolumeFS) Read(ctx context.Context, file string) (io.ReadCloser, error)
- func (v VolumeFS) Write(ctx context.Context, file string, src io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Browser ¶
Browser is the listing fragment. base is the files route it re-fetches itself from; every navigation swaps the whole fragment in place.
func Delete ¶
Delete removes form value "target" (dir flag in "dir"), then re-renders the listing at "path".
Types ¶
type Backend ¶
type Backend interface {
List(ctx context.Context, dir string) ([]Entry, error)
Read(ctx context.Context, file string) (io.ReadCloser, error)
Write(ctx context.Context, file string, src io.Reader) error
Delete(ctx context.Context, p string, dir bool) error
}
Backend is what a store must speak for the shared handlers/templ.
type VolumeFS ¶
VolumeFS browses a docker volume via the throwaway-container ops, on whichever node holds it.
Node is the tile's home node and is the whole multi-node story here: a volume is a directory on one machine's disk, so browsing one on the manager while the tile runs on a worker shows the manager's copy, the wrong files, with no error to say so. Empty means "here", which is every single-node install.