Documentation
¶
Index ¶
- Constants
- func InitRequest(r *http.Request, observeLatencyMillis latencyMillisObserver) *http.Request
- func Pretty(r *http.Request) bool
- func RespondError(w http.ResponseWriter, r *http.Request, statusCode int, err error, ...)
- func RespondErrorf(w http.ResponseWriter, r *http.Request, statusCode int, format string, ...)
- func RespondJSON(w http.ResponseWriter, r *http.Request, statusCode int, obj any, ...)
- func RespondNotFound(w http.ResponseWriter)
- func RespondText(w http.ResponseWriter, r *http.Request, statusCode int, text string)
- type DirectoryHandler
- func (h *DirectoryHandler) HandleDirectory(pattern string, dirLister DirectoryLister)
- func (h *DirectoryHandler) HandleMetadata(pattern string, handler MetadataHandler)
- func (n *DirectoryHandler) MarshalJSON() ([]byte, error)
- func (h *DirectoryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type DirectoryLister
- type MetadataHandler
- type MetadataHandlerFunc
- type TokenHandler
Constants ¶
View Source
const StatusClientClosedRequest = 499
Variables ¶
This section is empty.
Functions ¶
func InitRequest ¶ added in v0.11.0
func RespondError ¶
func RespondErrorf ¶
func RespondJSON ¶
func RespondNotFound ¶
func RespondNotFound(w http.ResponseWriter)
func RespondText ¶
Types ¶
type DirectoryHandler ¶
type DirectoryHandler struct {
// contains filtered or unexported fields
}
func (*DirectoryHandler) HandleDirectory ¶ added in v0.15.0
func (h *DirectoryHandler) HandleDirectory(pattern string, dirLister DirectoryLister)
func (*DirectoryHandler) HandleMetadata ¶ added in v0.15.0
func (h *DirectoryHandler) HandleMetadata(pattern string, handler MetadataHandler)
func (*DirectoryHandler) MarshalJSON ¶
func (*DirectoryHandler) ServeHTTP ¶
func (h *DirectoryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type DirectoryLister ¶
type MetadataHandler ¶ added in v0.15.0
type MetadataHandlerFunc ¶ added in v0.15.0
func (MetadataHandlerFunc) GetMetadata ¶ added in v0.15.0
func (f MetadataHandlerFunc) GetMetadata(w http.ResponseWriter, r *http.Request) (any, error)
type TokenHandler ¶ added in v0.15.0
type TokenHandler struct{ MetadataHandler }
Click to show internal directories.
Click to hide internal directories.