Documentation
¶
Index ¶
- Variables
- func AuthWithConfig(config AuthConfig) echo.MiddlewareFunc
- func Etag() echo.MiddlewareFunc
- func Healthz(rs ...Resource) echo.MiddlewareFunc
- func RedirectRepository(config configs.Configuration) echo.MiddlewareFunc
- func WithEtagConfig(config EtagConfig) echo.MiddlewareFunc
- type AuthConfig
- type EtagConfig
- type Resource
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultEtagConfig is the default Etag middleware config. DefaultEtagConfig = EtagConfig{ Skipper: middleware.DefaultSkipper, Weak: true, HashFn: func(config EtagConfig) hash.Hash { if config.Weak { const crcPol = 0xD5828281 crc32qTable := crc32.MakeTable(crcPol) return crc32.New(crc32qTable) } return sha256.New() }, } )
Functions ¶
func AuthWithConfig ¶
func AuthWithConfig(config AuthConfig) echo.MiddlewareFunc
AuthWithConfig returns a middleware which authenticates requests.
func Healthz ¶
func Healthz(rs ...Resource) echo.MiddlewareFunc
Healthz create a health check middleware
func RedirectRepository ¶
func RedirectRepository(config configs.Configuration) echo.MiddlewareFunc
RedirectRepository redirect to frontend repository when request path is a docker pull path Note: namespace MUST be not 'api' or 'v2'
func WithEtagConfig ¶ added in v1.2.0
func WithEtagConfig(config EtagConfig) echo.MiddlewareFunc
WithEtagConfig returns a Etag middleware with config.
Types ¶
type AuthConfig ¶
type AuthConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // DS is distribution service or not. DS bool }
AuthConfig is the configuration for the Auth middleware.
type EtagConfig ¶ added in v1.2.0
type EtagConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // Weak defines if the Etag is weak or strong. Weak bool // HashFn defines the hash function to use. Default is crc32q. HashFn func(config EtagConfig) hash.Hash }
EtagConfig defines the config for Etag middleware.
Click to show internal directories.
Click to hide internal directories.