middlewares

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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'

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 Resource

type Resource interface {
	HealthCheck() error // returns error if health check no passed
}

Resource something that need be health checked

Jump to

Keyboard shortcuts

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