Documentation ¶
Index ¶
- Constants
- func JSOpenModal(selector string) string
- func JSTooltip() string
- type ContextKey
- type Module
- func (m *Module) Middleware(next http.Handler) http.Handler
- func (m *Module) MiddlewareRequireAdmin(next http.Handler) http.Handler
- func (*Module) Name() string
- func (m *Module) Route(s *bhttp.Server) error
- func (m *Module) SetServer(s *bhttp.Server)
- func (m *Module) WrapInMiddlewares(h http.Handler) http.Handler
- type SessionKey
Constants ¶
View Source
const ( COAnonymous = "anonymous" ActionAdd = "add" FormAction = "action" FormDescription = "desc" FormDomain = "domain" FormForce = "force" FormName = "name" FormObfuscatedDomain = "obfuscated-domain" )
View Source
const (
// FormInstance is the key for a domain form field.
FormInstance = "instance"
)
View Source
const SessionMaxAge = 30 * 24 * time.Hour // 30 days
Variables ¶
This section is empty.
Functions ¶
func JSOpenModal ¶
Types ¶
type ContextKey ¶
type ContextKey int
ContextKey is a key used in http request contexts.
const ( // ContextKeySession is the persistent session. ContextKeySession ContextKey = iota // ContextKeyLocalizer is the language localizer. ContextKeyLocalizer // ContextKeyLanguage is the language. ContextKeyLanguage // ContextKeyAccount is the logged in user's account. ContextKeyAccount // ContextKeyOauthNonce is the oauth nonce. ContextKeyOauthNonce )
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) Middleware ¶
Middleware runs on every http request.
func (*Module) MiddlewareRequireAdmin ¶
MiddlewareRequireAdmin will redirect a user to login page if user not in context and will return unauthorized for a non admin user.
type SessionKey ¶
type SessionKey int
SessionKey is a key used for storing data in a web session.
const ( // SessionKeyAccountID contains the id of the currently logged-in user. SessionKeyAccountID SessionKey = iota // SessionKeyLoginRedirect contains the url to be redirected too after logging in. SessionKeyLoginRedirect )
Click to show internal directories.
Click to hide internal directories.