Documentation
¶
Index ¶
- func Auth(c *gin.Context)
- func AuthAdmin(c *gin.Context)
- func AuthNotGuest(c *gin.Context)
- func Authn(c *gin.Context)
- func Down(verifyFunc func(string, string) error) func(c *gin.Context)
- func DownloadRateLimiter(limiter stream.Limiter) gin.HandlerFunc
- func FilteredLoggerWithConfig(config FilteredLoggerConfig) gin.HandlerFunc
- func ForceHttps(c *gin.Context)
- func FsUp(c *gin.Context)
- func HTTPFilteredLogger() gin.HandlerFunc
- func MaxAllowed(n int) gin.HandlerFunc
- func S3FilteredLogger() gin.HandlerFunc
- func SearchIndex(c *gin.Context)
- func StoragesLoaded(c *gin.Context)
- func UnifiedFilteredLogger(serverType string) gin.HandlerFunc
- func UploadRateLimiter(limiter stream.Limiter) gin.HandlerFunc
- type FilteredLoggerConfig
- type ResponseWriterWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Auth ¶
Auth is a middleware that checks if the user is logged in. if token is empty, set user to guest
func AuthNotGuest ¶
func DownloadRateLimiter ¶
func DownloadRateLimiter(limiter stream.Limiter) gin.HandlerFunc
func FilteredLoggerWithConfig ¶ added in v4.0.9
func FilteredLoggerWithConfig(config FilteredLoggerConfig) gin.HandlerFunc
FilteredLoggerWithConfig returns a gin.HandlerFunc (middleware) that logs requests but skips logging for specified paths, methods, or path prefixes
func ForceHttps ¶
func HTTPFilteredLogger ¶ added in v4.0.9
func HTTPFilteredLogger() gin.HandlerFunc
HTTPFilteredLogger returns a filtered logger for the main HTTP server
func MaxAllowed ¶
func MaxAllowed(n int) gin.HandlerFunc
func S3FilteredLogger ¶ added in v4.0.9
func S3FilteredLogger() gin.HandlerFunc
S3FilteredLogger returns a filtered logger for the S3 server
func SearchIndex ¶
func StoragesLoaded ¶
func UnifiedFilteredLogger ¶ added in v4.0.9
func UnifiedFilteredLogger(serverType string) gin.HandlerFunc
UnifiedFilteredLogger returns a filtered logger using global configuration serverType: "http" for main HTTP server, "s3" for S3 server
func UploadRateLimiter ¶
func UploadRateLimiter(limiter stream.Limiter) gin.HandlerFunc
Types ¶
type FilteredLoggerConfig ¶ added in v4.0.9
type FilteredLoggerConfig struct {
// SkipPaths is a list of URL paths to skip logging
SkipPaths []string
// SkipMethods is a list of HTTP methods to skip logging
SkipMethods []string
// SkipPathPrefixes is a list of URL path prefixes to skip logging
SkipPathPrefixes []string
// Output is the writer where logs will be written
Output io.Writer
}
FilteredLoggerConfig defines the configuration for the filtered logger
type ResponseWriterWrapper ¶
type ResponseWriterWrapper struct {
gin.ResponseWriter
WrapWriter io.Writer
}
Click to show internal directories.
Click to hide internal directories.