1
0
Fork 0

updated documentation

Dieser Commit ist enthalten in:
Sebastian Tobie 2022-11-05 08:44:37 +01:00
Ursprung 207a7ff58a
Commit 5c33058038
12 geänderte Dateien mit 38 neuen und 3 gelöschten Zeilen

3
auth/doc.go Normale Datei
Datei anzeigen

@ -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

14
constants/auth.go Normale Datei
Datei anzeigen

@ -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"
)

2
constants/doc.go Normale Datei
Datei anzeigen

@ -0,0 +1,2 @@
// Package constants provides static aliases when an value from an enum is required
package constants

2
doc.go Normale Datei
Datei anzeigen

@ -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

2
funcs/doc.go Normale Datei
Datei anzeigen

@ -0,0 +1,2 @@
// Package funcs provides fome functions that for special cases
package funcs

2
menus/doc.go Normale Datei
Datei anzeigen

@ -0,0 +1,2 @@
// Package menus provides an abstraction for providing an global menu that covers multiple sites
package menus

Datei anzeigen

@ -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 (
@ -31,7 +32,7 @@ type Middleware struct {
lock sync.Mutex
}
//NewMiddleware return an initialized Middleware Object.
// NewMiddleware return an initialized Middleware Object.
func NewMiddleware() *Middleware {
return &Middleware{
databases: make(map[string]*pgxpool.Pool),

2
middleware/doc.go Normale Datei
Datei anzeigen

@ -0,0 +1,2 @@
// Package middleware provides some middleware
package middleware

Datei anzeigen

@ -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 {

2
modules/saml/doc.go Normale Datei
Datei anzeigen

@ -0,0 +1,2 @@
// Package saml provides an Authentication Handler for authenticating over SAML
package saml

Datei anzeigen

@ -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()
}

Datei anzeigen

@ -1,3 +1,4 @@
// Package templates helps sites to manage their templates
package templates
import (
@ -19,7 +20,7 @@ var (
_ pongo2.TemplateLoader = &EmptyLoader{}
)
//TemplateSite is an interface that is for storing templates.
// TemplateSite is an interface that is for storing templates.
type TemplateSite interface {
Templates() pongo2.TemplateLoader
}