options

package
v0.0.0-...-01ad037 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouterOption

type RouterOption interface {
	Apply(s *RouterSettings)
}

func WithCustomCacheExpiration

func WithCustomCacheExpiration(cacheExpiration time.Duration) RouterOption

WithCustomCacheExpiration returns a RouterOption that specifies custom expiration value for cache

func WithMiddlewares

func WithMiddlewares(middlewares ...echo.MiddlewareFunc) RouterOption

WithMiddlewares returns a RouterOption that specifies an array of echo.Middleware

func WithNoCache

func WithNoCache() RouterOption

WithNoCache returns a RouterOption that disable cache

type RouterSettings

type RouterSettings struct {
	Middlewares           []echo.MiddlewareFunc
	CustomCacheExpiration *time.Duration
	NoCache               bool
}

func ApplyOptions

func ApplyOptions(options ...RouterOption) *RouterSettings

Jump to

Keyboard shortcuts

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