1
0
Fork 0
httpserver/site.go

26 Zeilen
682 B
Go

package httpserver
import "github.com/gin-gonic/gin"
// Site is an Interface to abstract the modularized group of pages.
// The Middleware must be able to detect multiple calls by itself. Deduplication is not performed.
type Site interface {
Init(*gin.RouterGroup)
}
// ConfigSite is for sites that have to be configured
type ConfigSite interface {
Site
Defaults() SiteConfig
Setup(SiteConfig) error
}
// TeardownSite is for sites that require to do steps before shutdown
type TeardownSite interface {
2022-11-04 23:04:45 +00:00
Site
Teardown()
}
// SiteConfig is an interface for configitems of the site. The methods return the required items for the server
type SiteConfig map[string]interface{}