updated documentation
Dieser Commit ist enthalten in:
Ursprung
207a7ff58a
Commit
5c33058038
|
@ -0,0 +1,3 @@
|
|||
// Package auth is for the abstraction of the authentication method.
|
||||
// this enables the application developer to seperate the authentication from the authentication itself.
|
||||
package auth
|
|
@ -0,0 +1,14 @@
|
|||
package constants
|
||||
|
||||
// AccountConstant is an type for easier linting.
|
||||
type AccountConstant string
|
||||
|
||||
// These are Constants to save specific attributes in single points of use.
|
||||
const (
|
||||
// AccountID is the ID of the session. Prefferably it should be an UUIDv4 to mitigate security errors.
|
||||
AccountID AccountConstant = "jti"
|
||||
// AccountAnon is to identify Sessions as Anonymous sessions.
|
||||
AccountAnon AccountConstant = "anon"
|
||||
// AccountUser is an attribute that identifies the user with an string that is unique for the user, for Example the username.
|
||||
AccountUser AccountConstant = "uid"
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
// Package constants provides static aliases when an value from an enum is required
|
||||
package constants
|
|
@ -0,0 +1,2 @@
|
|||
// Package httpserver provides developers with an HTTP-Server that route parts of the site on different domains and is configurable after the build
|
||||
package httpserver
|
|
@ -0,0 +1,2 @@
|
|||
// Package funcs provides fome functions that for special cases
|
||||
package funcs
|
|
@ -0,0 +1,2 @@
|
|||
// Package menus provides an abstraction for providing an global menu that covers multiple sites
|
||||
package menus
|
|
@ -1,3 +1,4 @@
|
|||
// Package db is an middleware that manages multiple database pools and provides applications with an way to access the database
|
||||
package db
|
||||
|
||||
import (
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
// Package middleware provides some middleware
|
||||
package middleware
|
|
@ -11,7 +11,7 @@ import (
|
|||
"go.sebtobie.de/httpserver/constants"
|
||||
)
|
||||
|
||||
// LogMiddleware is an middleware to log requests to phuslu/log and catches panics.
|
||||
// LogMiddleware is an middleware to log requests to rs/zerolog and catches panics.
|
||||
// If it is added multiple times, only the first time sends entries to the log.
|
||||
func LogMiddleware(c *gin.Context) {
|
||||
if _, exists := c.Get("xid"); exists {
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
// Package saml provides an Authentication Handler for authenticating over SAML
|
||||
package saml
|
4
site.go
4
site.go
|
@ -11,13 +11,17 @@ type Site interface {
|
|||
// ConfigSite is for sites that have to be configured
|
||||
type ConfigSite interface {
|
||||
Site
|
||||
// Defaults returns the default values for the configuration
|
||||
Defaults() SiteConfig
|
||||
// Setup configures the Site with the read configuration.
|
||||
// For the order how the methods are called refer to [Server.Setup]
|
||||
Setup(SiteConfig) error
|
||||
}
|
||||
|
||||
// TeardownSite is for sites that require to do steps before shutdown
|
||||
type TeardownSite interface {
|
||||
Site
|
||||
// Teardown is called before shutting down the server. Its for gracefully shutdowns of goroutines or longstanding connections
|
||||
Teardown()
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// Package templates helps sites to manage their templates
|
||||
package templates
|
||||
|
||||
import (
|
||||
|
|
Laden…
In neuem Issue referenzieren