Documentation
¶
Index ¶
- Variables
- func AfterEpoch(t time.Time) bool
- func FileServer(root http.FileSystem) http.Handler
- func GetTemplate() (*template.Template, error)
- type Crumb
- type DirEntry
- type Directory
- func (d *Directory) AddEntry(remote string, isDir bool)
- func (d *Directory) AddHTMLEntry(remote string, isDir bool, size int64, modTime time.Time)
- func (d *Directory) ProcessQueryParams(sortParm string, orderParm string) *Directory
- func (d *Directory) Serve(w http.ResponseWriter, r *http.Request)
- func (d *Directory) SetQuery(queryParams url.Values) *Directory
Constants ¶
This section is empty.
Variables ¶
View Source
var Assets embed.FS
Assets holds the embedded filesystem for the default template
Functions ¶
func AfterEpoch ¶
AfterEpoch returns the time since the epoch for the given time
func FileServer ¶
func FileServer(root http.FileSystem) http.Handler
func GetTemplate ¶
GetTemplate returns the HTML template for serving directories via HTTP/WebDAV
Types ¶
type DirEntry ¶
type DirEntry struct {
URL string
Leaf string
IsDir bool
Size int64
ModTime time.Time
// contains filtered or unexported fields
}
DirEntry is a directory entry
type Directory ¶
type Directory struct {
DirRemote string
Title string
Name string
Entries []DirEntry
Query string
HTMLTemplate *template.Template
Breadcrumb []Crumb
Sort string
Order string
}
Directory represents a directory
func NewDirectory ¶
NewDirectory makes an empty Directory
func (*Directory) AddHTMLEntry ¶
AddHTMLEntry adds an entry to that directory
func (*Directory) ProcessQueryParams ¶
ProcessQueryParams takes and sorts/orders based on the request sort/order parameters and default is namedirfirst/asc
Click to show internal directories.
Click to hide internal directories.