Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFallbackInvalid = errors.New("fallback is invalid")
)
Functions ¶
func ChooseFile ¶
func ChooseFile(options []language.Tag, fallback language.Tag, acceptLangHeader string) (string, error)
Choose which file to show from options based on the Language-Accept header. Fallback will be chosen when the Language-Accept header does not contain an available language.
The file name will be returned.
func HTTPError ¶
func HTTPError(w http.ResponseWriter, code int)
Send an error to the HTTP client with the status text and code.
Types ¶
type Handler ¶
type Handler func(w http.ResponseWriter, r *http.Request) error
A Handler is an http.HandlerFunc that can return an error.
type HandlerError ¶
A HandlerError contains information about an error that occured inside a Handler.
func NewHandlerError ¶
func NewHandlerError(err error, code int) *HandlerError
Create a new HandlerError with error and code.
func (HandlerError) Error ¶
func (e HandlerError) Error() string
type Server ¶
A Server is a wrapper for an HTTP server that serves manuals from a filesystem.
The Chi library is used and is fully compatible with net/http.
type ServerOptions ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package parser implements types and methods to parse markdown files in a filesystem to HTML to a destination filesystem that can be used to serve needforheat manuals.
|
Package parser implements types and methods to parse markdown files in a filesystem to HTML to a destination filesystem that can be used to serve needforheat manuals. |
Package wfs implements interfaces, types and methods for working with an fs.FS you can write to.
|
Package wfs implements interfaces, types and methods for working with an fs.FS you can write to. |
dirfs
Package dirfs provides an implementation of a filesystem (an fs.FS) that is writable.
|
Package dirfs provides an implementation of a filesystem (an fs.FS) that is writable. |
Click to show internal directories.
Click to hide internal directories.