Documentation ¶
Index ¶
- func IsRebuild(path string) bool
- func Options(c *web.C, h http.Handler) http.Handler
- func RepoToC(c *web.C, repo *model.Repo)
- func RequireRepoAdmin(c *web.C, h http.Handler) http.Handler
- func RequireRepoRead(c *web.C, h http.Handler) http.Handler
- func RequireUser(c *web.C, h http.Handler) http.Handler
- func RequireUserAdmin(c *web.C, h http.Handler) http.Handler
- func RoleToC(c *web.C, role *model.Perm)
- func SetHeaders(c *web.C, h http.Handler) http.Handler
- func SetRepo(c *web.C, h http.Handler) http.Handler
- func SetUser(c *web.C, h http.Handler) http.Handler
- func ToRepo(c *web.C) *model.Repo
- func ToRole(c *web.C) *model.Perm
- func ToUser(c *web.C) *model.User
- func UserToC(c *web.C, user *model.User)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Options ¶
Options automatically return an appropriate "Allow" header when the request method is OPTIONS and the request would have otherwise been 404'd.
func RequireRepoAdmin ¶
RequireRepoAdmin is a middleware function that verifies the user has admin access to the repository.
func RequireRepoRead ¶
RequireRepoRead is a middleware function that verifies the user has read access to the repository.
func RequireUser ¶
RequireUser is a middleware function that verifies there is a currently authenticated user stored in the context.
func RequireUserAdmin ¶
RequireUserAdmin is a middleware function that verifies there is a currently authenticated user stored in the context with ADMIN privilege.
func SetHeaders ¶
SetHeaders is a middleware function that applies default headers and caching rules to each request.
func SetRepo ¶
SetRepo is a middleware function that retrieves the repository and stores in the context.
func SetUser ¶
SetUser is a middleware function that retrieves the currently authenticated user from the request and stores in the context.
func ToRepo ¶
ToRepo returns the Repo from the current request context. If the Repo does not exist a nil value is returned.
func ToRole ¶
ToRole returns the Role from the current request context. If the Role does not exist a nil value is returned.
Types ¶
This section is empty.