middlewares

package
v3.57.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2026 License: AGPL-3.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(c *gin.Context)

Auth is a middleware that checks if the user is logged in. if token is empty, set user to guest

func AuthAdmin

func AuthAdmin(c *gin.Context)

func AuthNotGuest added in v3.39.0

func AuthNotGuest(c *gin.Context)

func Authn added in v3.26.0

func Authn(c *gin.Context)

func Down

func Down(verifyFunc func(string, string) error) func(c *gin.Context)

func DownloadRateLimiter added in v3.43.0

func DownloadRateLimiter(limiter stream.Limiter) gin.HandlerFunc

func ForceHttps added in v3.19.0

func ForceHttps(c *gin.Context)

func FsUp added in v3.5.1

func FsUp(c *gin.Context)

func HandleSession added in v3.52.0

func HandleSession(c *gin.Context, user *model.User) bool

HandleSession verifies device sessions and stores context values.

func MaxAllowed added in v3.7.1

func MaxAllowed(n int) gin.HandlerFunc

func SearchIndex added in v3.6.0

func SearchIndex(c *gin.Context)

func SessionRefresh added in v3.52.0

func SessionRefresh(c *gin.Context)

SessionRefresh updates session's last_active after successful requests.

func StoragesLoaded

func StoragesLoaded(c *gin.Context)

func UploadRateLimiter added in v3.43.0

func UploadRateLimiter(limiter stream.Limiter) gin.HandlerFunc

Types

type ResponseWriterWrapper added in v3.43.0

type ResponseWriterWrapper struct {
	gin.ResponseWriter
	WrapWriter io.Writer
}

func (*ResponseWriterWrapper) Write added in v3.43.0

func (w *ResponseWriterWrapper) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL