Versions in this module Expand all Collapse all v0 v0.1.1 Oct 25, 2026 v0.1.0 Oct 12, 2026 Changes in this version + const CSRFField + const CSRFHeader + const DefaultMaxBodyBytes + var ErrNoCookie = errors.New("web: no valid sealed cookie") + func AllowCSP(extra CSP) gin.HandlerFunc + func CSRF(c *gin.Context) + func CSRFToken(c *gin.Context) string + func ClearSealedCookie(c *gin.Context, name string) + func Log(c *gin.Context) *slog.Logger + func MaxBody(n int64) gin.HandlerFunc + func New(cfg Config) (*gin.Engine, error) + func SealedCookie(c *gin.Context, name string) ([]byte, error) + func Serve(ctx context.Context, s Server, ready func(context.Context) error) error + func SetSealedCookie(c *gin.Context, name string, value []byte, maxAge time.Duration) + func URL(c *gin.Context, path string) string + type CSP struct + Connect []string + Fonts []string + FormActions []string + Frames []string + Images []string + Scripts []string + Styles []string + func (p CSP) String() string + type Config struct + AnyHost bool + CSP CSP + Logger *slog.Logger + MaxBodyBytes int64 + Origins []string + PublicURL string + SecretKey string + TrustedProxies []string + type Server struct + Addr string + DrainDelay time.Duration + Handler http.Handler + HealthPath string + Logger *slog.Logger + ShutdownTimeout time.Duration