features

package
v2.17.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: BSD-3-Clause Imports: 0 Imported by: 2

Documentation

Overview

Package features defines runtime features and their settings contracts.

Index

Constants

View Source
const (
	// VulnerabilityManagement identifies scanning, reports, and scan-based patching.
	VulnerabilityManagement ID = "vulnerabilityManagement"

	// VulnerabilityManagementSettingKey is the persisted toggle for vulnerability management.
	VulnerabilityManagementSettingKey = "featureVulnerabilityManagementEnabled"

	// Swarm identifies the Docker Swarm pages. An active swarm cluster keeps it enabled
	// regardless of the persisted toggle.
	Swarm ID = "swarm"

	// SwarmSettingKey is the persisted toggle for Docker Swarm.
	SwarmSettingKey = "featureSwarmEnabled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	ID             ID
	SettingKey     string
	DefaultEnabled bool
}

Definition connects a runtime feature to its persisted setting and default.

func All

func All() []Definition

All returns the supported runtime features.

func Lookup

func Lookup(id ID) (Definition, bool)

Lookup returns the definition of a supported runtime feature.

type DisabledError

type DisabledError struct {
	Status  int    `json:"status"`
	Title   string `json:"title"`
	Detail  string `json:"detail"`
	Code    string `json:"code"`
	Feature ID     `json:"feature"`
}

DisabledError describes an unavailable runtime feature using problem details.

func (*DisabledError) ContentType

func (e *DisabledError) ContentType(contentType string) string

ContentType selects the problem-details media type for JSON and CBOR responses.

func (*DisabledError) Error

func (e *DisabledError) Error() string

Error returns the reason the feature operation was rejected.

func (*DisabledError) GetStatus

func (e *DisabledError) GetStatus() int

GetStatus supplies the HTTP response status to Huma.

type ID

type ID string

ID identifies a feature independently of permissions and build options.

Jump to

Keyboard shortcuts

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