lethe

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasLetheCapabilities

func HasLetheCapabilities() bool

HasLetheCapabilities checks if any Lethe providers are registered

func IsLetheWriter

func IsLetheWriter(writer interface{}) bool

IsLetheWriter checks if a writer implements Lethe optimizations

func RegisterCapability

func RegisterCapability(provider CapabilityProvider)

RegisterCapability allows Lethe to register its capabilities at runtime This is called by Lethe's init() function when both packages are imported

Types

type CapabilityProvider

type CapabilityProvider struct {
	Name                string
	CreateOptimizedSink func(string, ...interface{}) (interface{}, error)
	DetectWriter        func(interface{}) bool
}

CapabilityProvider defines functions that can be registered by Lethe

func GetLetheProvider

func GetLetheProvider() (CapabilityProvider, bool)

GetLetheProvider returns the Lethe provider if available

func GetRegisteredCapabilities

func GetRegisteredCapabilities() []CapabilityProvider

GetRegisteredCapabilities returns all registered Lethe capabilities

type LetheWriter

type LetheWriter interface {
	// Standard WriteSyncer methods
	Write([]byte) (int, error)
	Sync() error
	Close() error

	// Lethe-specific optimization methods
	WriteOwned([]byte) (int, error) // Zero-copy write for owned buffers
	GetOptimalBufferSize() int      // Auto-tuning hint
	SupportsHotReload() bool        // Configuration hot-reload capability
}

LetheWriter defines the enhanced interface that Lethe writers implement When Iris detects this interface, it automatically enables optimizations

func DetectLetheCapabilities

func DetectLetheCapabilities(writer interface{}) LetheWriter

DetectLetheCapabilities checks if a writer supports Lethe optimizations Returns the enhanced interface if available, nil otherwise

Jump to

Keyboard shortcuts

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