Documentation ¶ Index ¶ type Browser func New(logger *slog.Logger) *Browser func (b *Browser) List(dir string, hidden bool) (*ListResult, error) func (b *Browser) ServeRaw(w http.ResponseWriter, r *http.Request, path string) func (b *Browser) View(path string) (*FileView, error) type DirEntry type FileView type ListResult 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"` } Source Files ¶ View all Source files browser.go Click to show internal directories. Click to hide internal directories.