adapters

package
v0.2.0-alpha Latest Latest
Warning

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

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

Documentation

Overview

Package adapters provides infrastructure adapters that implement application ports. These adapters wrap existing infrastructure components to satisfy port interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineAdapter

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

EngineAdapter wraps infrastructure engine to implement port interface.

func (*EngineAdapter) Close

func (a *EngineAdapter) Close(ctx context.Context) error

Close closes the wrapped engine.

func (*EngineAdapter) Execute

Execute executes the profile using the wrapped engine.

type EngineFactoryAdapter

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

EngineFactoryAdapter creates execution engines.

func NewEngineFactoryAdapter

func NewEngineFactoryAdapter(redactor *redaction.Redactor, wasmMemoryLimitMB int) *EngineFactoryAdapter

NewEngineFactoryAdapter creates a new engine factory adapter.

func (*EngineFactoryAdapter) CreateEngine

func (a *EngineFactoryAdapter) CreateEngine(
	ctx context.Context,
	profile entities.ProfileReader,
	grantedCaps map[string][]capabilities.Capability,
	pluginDir string,
	filters dto.FilterOptions,
	execution dto.ExecutionOptions,
	_ bool,
) (ports.ExecutionEngine, error)

CreateEngine creates an execution engine with capabilities.

type PluginAdapter

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

PluginAdapter wraps wasm.Plugin to implement ports.Plugin.

func (*PluginAdapter) Describe

func (p *PluginAdapter) Describe(ctx context.Context) (*ports.PluginInfo, error)

Describe returns plugin metadata.

type PluginDirectoryAdapter

type PluginDirectoryAdapter struct{}

PluginDirectoryAdapter resolves plugin directory paths.

func NewPluginDirectoryAdapter

func NewPluginDirectoryAdapter() *PluginDirectoryAdapter

NewPluginDirectoryAdapter creates a new plugin directory adapter.

func (*PluginDirectoryAdapter) ResolvePluginDir

func (a *PluginDirectoryAdapter) ResolvePluginDir(_ context.Context) (string, error)

ResolvePluginDir determines the plugin directory.

type PluginRuntimeAdapter

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

PluginRuntimeAdapter wraps wasm.Runtime to implement ports.PluginRuntime.

func (*PluginRuntimeAdapter) Close

func (r *PluginRuntimeAdapter) Close(ctx context.Context) error

Close releases runtime resources.

func (*PluginRuntimeAdapter) LoadPlugin

func (r *PluginRuntimeAdapter) LoadPlugin(ctx context.Context, name string, wasmBytes []byte) (ports.Plugin, error)

LoadPlugin loads a plugin from WASM bytes.

func (*PluginRuntimeAdapter) UnwrapRuntime

func (r *PluginRuntimeAdapter) UnwrapRuntime() *wasm.Runtime

UnwrapRuntime returns the underlying wasm.Runtime for infrastructure-layer use. This should only be used by infrastructure code that needs the concrete type.

type PluginRuntimeFactoryAdapter

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

PluginRuntimeFactoryAdapter creates PluginRuntime instances. This adapter decouples the application layer from the concrete wasm.Runtime.

func NewPluginRuntimeFactoryAdapter

func NewPluginRuntimeFactoryAdapter(redactor *redaction.Redactor) *PluginRuntimeFactoryAdapter

NewPluginRuntimeFactoryAdapter creates a new runtime factory adapter.

func (*PluginRuntimeFactoryAdapter) NewRuntime

NewRuntime creates a new plugin runtime for capability collection.

func (*PluginRuntimeFactoryAdapter) NewRuntimeWithCapabilities

func (f *PluginRuntimeFactoryAdapter) NewRuntimeWithCapabilities(
	ctx context.Context,
	caps map[string][]capabilities.Capability,
	memoryLimitMB int,
) (ports.PluginRuntime, error)

NewRuntimeWithCapabilities creates a runtime with granted capabilities.

type ProfileLoaderAdapter

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

ProfileLoaderAdapter adapts infrastructure profile loader to port interface.

func NewProfileLoaderAdapter

func NewProfileLoaderAdapter() *ProfileLoaderAdapter

NewProfileLoaderAdapter creates a new profile loader adapter.

func (*ProfileLoaderAdapter) LoadProfile

func (a *ProfileLoaderAdapter) LoadProfile(path string) (*entities.Profile, error)

LoadProfile loads and substitutes variables in a profile.

type ProfileValidatorAdapter

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

ProfileValidatorAdapter adapts infrastructure validator to port interface.

func NewProfileValidatorAdapter

func NewProfileValidatorAdapter() *ProfileValidatorAdapter

NewProfileValidatorAdapter creates a new profile validator adapter.

func (*ProfileValidatorAdapter) Validate

func (a *ProfileValidatorAdapter) Validate(profile *entities.Profile) error

Validate validates profile structure.

func (*ProfileValidatorAdapter) ValidateWithSchemas

func (a *ProfileValidatorAdapter) ValidateWithSchemas(ctx context.Context, profile *entities.Profile, runtime ports.PluginRuntime) error

ValidateWithSchemas validates observation configs against plugin schemas.

type SystemConfigAdapter

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

SystemConfigAdapter adapts system config loader to port interface.

func NewSystemConfigAdapter

func NewSystemConfigAdapter() *SystemConfigAdapter

NewSystemConfigAdapter creates a new system config adapter.

func (*SystemConfigAdapter) LoadConfig

func (a *SystemConfigAdapter) LoadConfig(_ context.Context, path string) (*system.Config, error)

LoadConfig loads system configuration from path.

Jump to

Keyboard shortcuts

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