Documentation ¶
Index ¶
- Constants
- func CanEditFile(next http.Handler) http.Handler
- func CanEditFolder(next http.Handler) http.Handler
- func CanViewSpace(next http.Handler) http.Handler
- func GetFile(r *http.Request) *models.File
- func GetFolder(r *http.Request) *models.Folder
- func GetSpace(r *http.Request) *models.Space
- func RequireAdmin(next http.Handler) http.Handler
- func RequireUser(next http.Handler) http.Handler
- func Set(config Config) func(http.Handler) http.Handler
- func SetFile(filesRepo repositories.FilesRepo) func(http.Handler) http.Handler
- func SetFolder(foldersRepo repositories.FoldersRepo) func(http.Handler) http.Handler
- func SetSpace(spacesRepo repositories.SpacesRepo) func(http.Handler) http.Handler
- type Config
- type Ctx
- func (c *Ctx) AssetPath(asset string) string
- func (c *Ctx) HandleError(w http.ResponseWriter, r *http.Request, err error)
- func (c *Ctx) Path(name string, params ...any) *url.URL
- func (c *Ctx) PersistFlash(w http.ResponseWriter, f Flash)
- func (c *Ctx) URL(name string, params ...any) *url.URL
- func (c *Ctx) WebSocketPath(topics ...string) string
- type Flash
Constants ¶
View Source
const ( RememberCookie = "deliver.remember" FlashCookiePrefix = "deliver.flash." )
TODO set __Host- cookie prefix in production
Variables ¶
This section is empty.
Functions ¶
func SetFolder ¶
func SetFolder(foldersRepo repositories.FoldersRepo) func(http.Handler) http.Handler
func SetSpace ¶
func SetSpace(spacesRepo repositories.SpacesRepo) func(http.Handler) http.Handler
Types ¶
type Ctx ¶
type Ctx struct { Config Log *zap.SugaredLogger CSRFToken string CSPNonce string User *models.User Flash []Flash // contains filtered or unexported fields }
func (*Ctx) HandleError ¶
func (*Ctx) PersistFlash ¶
func (c *Ctx) PersistFlash(w http.ResponseWriter, f Flash)
func (*Ctx) WebSocketPath ¶
Click to show internal directories.
Click to hide internal directories.