middlewares

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeatureFlag

func FeatureFlag(settingsService dataservices.SettingsService, feature portainer.Feature) mux.MiddlewareFunc

func FetchEndpoint

func FetchEndpoint(request *http.Request) (*portainer.Endpoint, error)

func FetchItem

func FetchItem[T any](request *http.Request, contextKey string) (*T, error)

func RestrictDemoEnv

func RestrictDemoEnv(isDemo func() bool) mux.MiddlewareFunc

restrict functionality on demo environments

func WithEndpoint

func WithEndpoint(endpointService dataservices.EndpointService, endpointIDParam string) mux.MiddlewareFunc

func WithItem

func WithItem[TId ~int, TObject any](getter ItemGetter[TId, TObject], idParam string, contextKey ItemContextKey) mux.MiddlewareFunc

Types

type ItemContextKey

type ItemContextKey string

type ItemGetter

type ItemGetter[TId ~int, TObject any] func(id TId) (*TObject, error)

Jump to

Keyboard shortcuts

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