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) PathTo(name string, pairs ...string) *url.URL
- func (c *Ctx) PersistFlash(w http.ResponseWriter, f Flash)
- func (c *Ctx) URLTo(name string, pairs ...string) *url.URL
- func (c *Ctx) WebSocketPath(channels ...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 Config ¶
type Config struct { Repo *repositories.Repo Storage objectstore.Store MaxFileSize int64 Auth *oidc.Auth Router *ich.Mux ErrorHandlers map[int]http.HandlerFunc Permissions *models.Permissions Assets mix.Manifest Hub *htmx.Hub Env string }
type Ctx ¶
type Ctx struct { Config Log *zap.SugaredLogger CSRFToken string CSRFTag string User *models.User Flash []Flash Env string // 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.