Documentation ¶
Index ¶
- Constants
- func BaseMiddleware(next http.Handler) http.Handler
- func CachingMiddleware(next http.Handler) http.Handler
- func ContentTypeMiddleware(contentType string) func(next http.Handler) http.Handler
- func ControllerMiddleware(handler Handler) http.Handler
- func StaticContentMiddleware(next http.Handler) http.Handler
- type CloseHandler
- type Controller
- type Endpoint
- type Handler
- type HandlerProvider
- type MessageHandler
- type SitemapController
- type Templater
- type WSClient
Constants ¶
View Source
const ( CacheControlHeader = "Cache-Control" ContentTypeHeader = "Content-Type" ETagHeader = "ETag" LocationHeader = "Location" ContentTypeAtom = "application/atom+xml" ContentTypeHTML = "text/html" ContentTypeJSON = "application/json" ContentTypeText = "text/plain; charset=UTF-8" )
Variables ¶
This section is empty.
Functions ¶
func ContentTypeMiddleware ¶
func ControllerMiddleware ¶
Types ¶
type CloseHandler ¶
type CloseHandler func()
type Controller ¶
type Controller struct { BasePath string Handlers map[Endpoint]Handler Middleware []HandlerProvider }
func NewAssetController ¶
func NewAssetController(basePath string, fileSystem fs.FS) *Controller
func NewTemplateController ¶
func NewTemplateController(fileSystem fs.FS, data any) *Controller
func (*Controller) Register ¶
func (c *Controller) Register(router chi.Router)
type MessageHandler ¶
type SitemapController ¶
type SitemapController struct { Controller // contains filtered or unexported fields }
func NewSitemapController ¶
func NewSitemapController() *SitemapController
func (*SitemapController) AddSite ¶
func (sc *SitemapController) AddSite(url url.URL)
type Templater ¶
type Templater struct {
// contains filtered or unexported fields
}
func NewTemplater ¶
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
func NewWSClient ¶
func NewWSClient(conn *websocket.Conn, onMessage MessageHandler, onClose CloseHandler) *WSClient
func (*WSClient) WriteMessage ¶
Click to show internal directories.
Click to hide internal directories.