capabilities

package
v0.4.5-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor interface {
	// Extract analyzes the configuration and returns a GrantSet of required capabilities.
	Extract(config map[string]interface{}) *entities.GrantSet
}

Extractor is an interface for extracting capabilities from a plugin configuration. Implementations of this interface contain plugin-specific logic for determining required permissions based on the user's configuration.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry manages the registration and retrieval of capability extractors.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new, empty capability registry.

func (*Registry) Get

func (r *Registry) Get(pluginName string) (Extractor, bool)

Get retrieves the extractor for a given plugin. Returns nil and false if no extractor is registered.

func (*Registry) Register

func (r *Registry) Register(pluginName string, extractor Extractor)

Register adds a capability extractor for a specific plugin. If an extractor allows overwriting, it will replace any existing one.

Jump to

Keyboard shortcuts

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