router

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRegoMiddleware added in v0.18.0

func CreateRegoMiddleware(regoFilePath string, logger *flog.Logrus) (func(next http.Handler) http.Handler, error)

CreateRegoMiddleware dynamically parses the rego file at the path specified in options and return a function that allows or denies the request based on the policy. Will return a nil function and an error if the given file path is blank or invalid.

func New

func New(opts *Options) (http.Handler, error)

New creates a new router and registers the handlers to it. Returns a handler object The struct definitions of the HTTP responses come from https://github.com/moby/moby/tree/master/api/types.

func VersionMiddleware

func VersionMiddleware(next http.Handler) http.Handler

VersionMiddleware checks for the requested version of the api and makes sure it falls within the bounds of the supported version.

Types

type Options

type Options struct {
	Config              *config.Config
	ContainerService    container.Service
	ImageService        image.Service
	NetworkService      network.Service
	SystemService       system.Service
	BuilderService      builder.Service
	VolumeService       volume.Service
	ExecService         exec.Service
	DistributionService distribution.Service
	CredentialService   *credential.CredentialService
	RegoFilePath        string

	// NerdctlWrapper wraps the interactions with nerdctl to build
	NerdctlWrapper *backend.NerdctlWrapper
}

Options defines the router options to be passed into the handlers.

Jump to

Keyboard shortcuts

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