putil

package
v0.0.0-...-e9a8072 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoCacheMiddleware = CacheControlMiddleware("no-store", true)

Functions

func CacheControlMiddleware

func CacheControlMiddleware(cacheControl string, capture bool) echo.MiddlewareFunc

func DeliverFile

func DeliverFile(g *echo.Group, path, contentType string) bool

func LastModified

func LastModified(c echo.Context, lastModified time.Time) (bool, error)

Types

type CacheConfig

type CacheConfig struct {
	Disabled     bool
	TTL          time.Duration
	FS           afero.Fs
	CacheControl bool
}

type CacheMiddleware

type CacheMiddleware struct {
	// contains filtered or unexported fields
}

func NewCacheMiddleware

func NewCacheMiddleware(cfg CacheConfig) *CacheMiddleware

func (*CacheMiddleware) Middleware

func (m *CacheMiddleware) Middleware() echo.MiddlewareFunc

type KeyLock

type KeyLock[T comparable] struct {
	// contains filtered or unexported fields
}

func NewKeyLock

func NewKeyLock[T comparable]() *KeyLock[T]

func (*KeyLock[T]) Lock

func (l *KeyLock[T]) Lock(key T)

func (*KeyLock[T]) Unlock

func (l *KeyLock[T]) Unlock(key T)

Jump to

Keyboard shortcuts

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