filebrowser

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Browser

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

func New

func New(logger *slog.Logger) *Browser

func (*Browser) List

func (b *Browser) List(dir string, hidden bool) (*ListResult, error)

func (*Browser) ServeRaw

func (b *Browser) ServeRaw(w http.ResponseWriter, r *http.Request, path string)

func (*Browser) View

func (b *Browser) View(path string) (*FileView, error)

type DirEntry

type DirEntry struct {
	Name    string `json:"name"`
	Type    string `json:"type"` // "dir" or "file"
	ModTime string `json:"modTime"`
}

type FileView

type FileView struct {
	Path     string `json:"path"`
	Type     string `json:"type"` // "text" or "image"
	Content  string `json:"content,omitempty"`
	Language string `json:"language,omitempty"`
	Mime     string `json:"mime,omitempty"`
	Size     int64  `json:"size"`
	URL      string `json:"url,omitempty"`
}

type ListResult

type ListResult struct {
	Path    string     `json:"path"`
	Entries []DirEntry `json:"entries"`
}

Jump to

Keyboard shortcuts

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