shared

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ConditionTypeReady = "Ready"

	ConditionTypeProgressing = "Progressing"

	ConditionTypeDegraded = "Degraded"

	ConditionTypeAvailable = "Available"

	ConditionTypeError = "Error"

	ConditionTypeDependenciesMet = "DependenciesMet"

	ConditionTypeResourcesAllocated = "ResourcesAllocated"

	ConditionTypeValidated = "Validated"

	ConditionStatusTrue = "True"

	ConditionStatusFalse = "False"

	ConditionStatusUnknown = "Unknown"

	DependencyTypeBlocking = "blocking"

	DependencyTypeSoft = "soft"

	DependencyTypeNotification = "notification"

	ResourceStatusAllocated = "allocated"

	ResourceStatusReleased = "released"

	ResourceStatusPending = "pending"

	ResourceStatusFailed = "failed"

	LockTypeExclusive = "exclusive"

	LockTypeShared = "shared"

	ConflictResolutionLatest = "latest"

	ConflictResolutionMerge = "merge"

	ConflictResolutionManual = "manual"

	SyncTypeFull = "full"

	SyncTypeIncremental = "incremental"

	SyncTypeValidate = "validate"

	SeverityLow = "low"

	SeverityMedium = "medium"

	SeverityHigh = "high"

	SeverityCritical = "critical"
)

Variables

View Source
var (
	ErrClientClosed       = errors.New("client is closed")
	ErrInvalidRequest     = errors.New("invalid request")
	ErrServiceUnavailable = errors.New("service unavailable")
	ErrRateLimited        = errors.New("rate limited")
)

Standard errors for interface implementations

View Source
var (
	DefaultRequestOptions = RequestOptions{
		Timeout: 30 * time.Second,
		RetryPolicy: &RetryPolicy{
			MaxRetries:      3,
			BackoffBase:     time.Second,
			BackoffMax:      10 * time.Second,
			BackoffJitter:   true,
			RetryableErrors: nil,
		},
	}

	DefaultRateLimiter = GenericRateLimiterConfig{
		RequestsPerSecond: 10.0,
		BurstSize:         5,
		Timeout:           5 * time.Second,
	}
)

Default configurations following Go 1.24 best practices

Functions

func CosineSimilarity

func CosineSimilarity(a, b []float32) float64

CosineSimilarity calculates the cosine similarity between two vectors

func EuclideanDistance

func EuclideanDistance(a, b []float32) float64

EuclideanDistance calculates the Euclidean distance between two vectors

func NetworkIntentPhaseToProcessingPhase

func NetworkIntentPhaseToProcessingPhase(phase nephoranv1.NetworkIntentPhase) interfaces.ProcessingPhase

func NetworkIntentPhaseToString

func NetworkIntentPhaseToString(phase nephoranv1.NetworkIntentPhase) string

func Normalize

func Normalize(vector []float32) []float32

Normalize normalizes a vector to unit length

func ProcessingPhaseToNetworkIntentPhase

func ProcessingPhaseToNetworkIntentPhase(phase interfaces.ProcessingPhase) nephoranv1.NetworkIntentPhase

func Sqrt

func Sqrt(x float64) float64

Sqrt calculates the square root of x Consolidated from pkg/rag/optimized_rag_pipeline.go and pkg/rag/embedding_service_interface.go

func StringToNetworkIntentPhase

func StringToNetworkIntentPhase(phase string) nephoranv1.NetworkIntentPhase

func ValidateClientInterface

func ValidateClientInterface(client ClientInterface) error

ValidateClientInterface checks if a client properly implements the interface

Types

type BatchProcessor

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

func (*BatchProcessor) Add

func (bp *BatchProcessor) Add(item interface{})

func (*BatchProcessor) Stop

func (bp *BatchProcessor) Stop()

type CPUManager

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

func NewCPUManager

func NewCPUManager(maxCPU, throttleThreshold float64) *CPUManager

func (*CPUManager) Optimize

func (cm *CPUManager) Optimize(ctx context.Context) error

type CacheConfig

type CacheConfig struct {
	MaxSize int `json:"maxSize"`

	DefaultTTL time.Duration `json:"defaultTTL"`

	CleanupInterval time.Duration `json:"cleanupInterval"`

	EvictionPolicy string `json:"evictionPolicy"` // "lru", "lfu", "ttl"

	MaxMemoryMB int64 `json:"maxMemoryMB"`

	EnableStatistics bool `json:"enableStatistics"`

	EnableMetrics bool `json:"enableMetrics"`
}

func DefaultCacheConfig

func DefaultCacheConfig() *CacheConfig

type CacheEntry

type CacheEntry struct {
	Key string

	Value interface{}

	ExpiresAt time.Time

	AccessCount int64

	LastAccess time.Time

	CreatedAt time.Time

	Size int64
	// contains filtered or unexported fields
}

type CacheEntryStats

type CacheEntryStats struct {
	AccessCount int64 `json:"accessCount"`

	LastAccess time.Time `json:"lastAccess"`

	CreatedAt time.Time `json:"createdAt"`

	Size int64 `json:"size"`

	TimeToExpiry time.Duration `json:"timeToExpiry"`
}

type CacheOptimizer

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

func NewCacheOptimizer

func NewCacheOptimizer(hitRateThreshold float64, evictionStrategy string,

	sizeThreshold int64,
) *CacheOptimizer

func (*CacheOptimizer) Optimize

func (co *CacheOptimizer) Optimize(ctx context.Context) error

type CacheStats

type CacheStats struct {
	Hits int64 `json:"hits"`

	Misses int64 `json:"misses"`

	HitRate float64 `json:"hitRate"`

	Evictions int64 `json:"evictions"`

	CurrentSize int64 `json:"currentSize"`

	MaxSize int64 `json:"maxSize"`

	EntryCount int64 `json:"entryCount"`
}

type ChatMessage

type ChatMessage struct {
	Role    string `json:"role"` // system, user, assistant
	Content string `json:"content"`
}

ChatMessage represents a chat message

type ClientError

type ClientError struct {
	Op     string // operation that failed
	Client string // client identifier
	Err    error  // underlying error
}

ClientError wraps client-specific errors with context (Go 1.24 error patterns)

func NewClientError

func NewClientError(op, client string, err error) *ClientError

NewClientError creates a new client error with structured context

func (*ClientError) Error

func (e *ClientError) Error() string

func (*ClientError) Unwrap

func (e *ClientError) Unwrap() error

type ClientFactory

type ClientFactory[T ClientInterface] interface {
	Create(config interface{}) (T, error)
	Validate(client T) error
}

ClientFactory creates clients with compile-time type safety

type ClientInterface

type ClientInterface interface {
	// Basic operations
	ProcessRequest(ctx context.Context, request *LLMRequest) (*LLMResponse, error)
	ProcessStreamingRequest(ctx context.Context, request *LLMRequest) (<-chan *StreamingChunk, error)
	ProcessIntent(ctx context.Context, intent string) (string, error)

	// Health and status
	HealthCheck(ctx context.Context) error
	GetStatus() ClientStatus

	// Configuration
	GetModelCapabilities() ModelCapabilities
	GetEndpoint() string
	Close() error
}

ClientInterface defines the standard LLM client interface

type ClientMetrics

type ClientMetrics struct {
	RequestCount    int64         `json:"request_count"`
	ErrorCount      int64         `json:"error_count"`
	AverageLatency  time.Duration `json:"average_latency"`
	P95Latency      time.Duration `json:"p95_latency"`
	TotalTokensUsed int64         `json:"total_tokens_used"`
	LastReset       time.Time     `json:"last_reset"`
}

ClientMetrics provides client performance metrics

type ClientStatus

type ClientStatus string

ClientStatus represents the status of a client

const (
	ClientStatusHealthy     ClientStatus = "healthy"
	ClientStatusUnhealthy   ClientStatus = "unhealthy"
	ClientStatusUnavailable ClientStatus = "unavailable"
	ClientStatusMaintenance ClientStatus = "maintenance"
)

type ComponentStatus

type ComponentStatus struct {
	Type ComponentType `json:"type"`

	Name string `json:"name"`

	Status string `json:"status"`

	Healthy bool `json:"healthy"`

	LastUpdate time.Time `json:"lastUpdate"`

	Version string `json:"version,omitempty"`

	Metadata json.RawMessage `json:"metadata,omitempty"`

	Metrics map[string]float64 `json:"metrics,omitempty"`

	Errors []string `json:"errors,omitempty"`
}

type ComponentType

type ComponentType string
const (
	ComponentTypeLLMProcessor ComponentType = "llm-processor"

	ComponentTypeResourcePlanner ComponentType = "resource-planner"

	ComponentTypeManifestGenerator ComponentType = "manifest-generator"

	ComponentTypeGitOpsController ComponentType = "gitops-controller"

	ComponentTypeDeploymentVerifier ComponentType = "deployment-verifier"

	ComponentTypeRAGSystem ComponentType = "rag-system"

	ComponentTypeNephioIntegration ComponentType = "nephio-integration"

	ComponentTypeAuthentication ComponentType = "authentication"

	ComponentTypeDatabase ComponentType = "database"

	ComponentTypeCache ComponentType = "cache"

	ComponentTypeKubernetes ComponentType = "kubernetes"

	ComponentTypeNetworking ComponentType = "networking"
)

type ConfigChangeNotifier

type ConfigChangeNotifier interface {
	OnConfigChange(configType string, oldConfig, newConfig interface{}) error
}

type ConfigStatus

type ConfigStatus struct {
	Type string `json:"type"`

	Loaded bool `json:"loaded"`

	HasFile bool `json:"hasFile"`

	FilePath string `json:"filePath,omitempty"`

	LastLoaded time.Time `json:"lastLoaded"`

	LastModified time.Time `json:"lastModified,omitempty"`

	Valid bool `json:"valid"`

	ValidationError string `json:"validationError,omitempty"`
}

type ConfigValidator

type ConfigValidator interface {
	Validate(config interface{}) error

	GetConfigType() string
}

type ConfigWatcher

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

type ConfigurationManager

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

func NewConfigurationManager

func NewConfigurationManager(configDir string) *ConfigurationManager

func (*ConfigurationManager) GetAllConfigTypes

func (cm *ConfigurationManager) GetAllConfigTypes() []string

func (*ConfigurationManager) GetConfigurationStatus

func (cm *ConfigurationManager) GetConfigurationStatus() map[string]ConfigStatus

func (*ConfigurationManager) GetName

func (cm *ConfigurationManager) GetName() string

func (*ConfigurationManager) IsHealthy

func (cm *ConfigurationManager) IsHealthy() bool

func (*ConfigurationManager) LoadConfiguration

func (cm *ConfigurationManager) LoadConfiguration(configType string, target interface{}) error

func (*ConfigurationManager) RegisterBuiltinValidators

func (cm *ConfigurationManager) RegisterBuiltinValidators()

func (*ConfigurationManager) RegisterChangeNotifier

func (cm *ConfigurationManager) RegisterChangeNotifier(notifier ConfigChangeNotifier)

func (*ConfigurationManager) RegisterConfigFile

func (cm *ConfigurationManager) RegisterConfigFile(configType, filePath string) error

func (*ConfigurationManager) RegisterValidator

func (cm *ConfigurationManager) RegisterValidator(validator ConfigValidator)

func (*ConfigurationManager) ReloadAllConfigurations

func (cm *ConfigurationManager) ReloadAllConfigurations() error

func (*ConfigurationManager) ReloadConfiguration

func (cm *ConfigurationManager) ReloadConfiguration(configType string) error

func (*ConfigurationManager) SaveConfiguration

func (cm *ConfigurationManager) SaveConfiguration(configType string, config interface{}) error

func (*ConfigurationManager) Start

func (cm *ConfigurationManager) Start(ctx context.Context) error

func (*ConfigurationManager) Stop

func (cm *ConfigurationManager) Stop(ctx context.Context) error

type Connection

type Connection interface {
	ID() string

	IsHealthy() bool

	LastUsed() time.Time

	Close() error
}

type ConnectionPool

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

func (*ConnectionPool) Close

func (cp *ConnectionPool) Close()

func (*ConnectionPool) Get

func (cp *ConnectionPool) Get(ctx context.Context) (Connection, error)

func (*ConnectionPool) Return

func (cp *ConnectionPool) Return(conn Connection)

type ControllerInterface

type ControllerInterface interface {
	GetComponentType() ComponentType

	ProcessPhase(ctx context.Context, intent types.NamespacedName, phase interfaces.ProcessingPhase, data interface{}) error

	IsHealthy() bool

	GetMetrics() map[string]interface{}

	ValidatePhaseData(phase interfaces.ProcessingPhase, data interface{}) error
}

type CoordinationConfig

type CoordinationConfig struct {
	MaxConcurrentIntents int `json:"maxConcurrentIntents"`

	DefaultPhaseTimeout time.Duration `json:"defaultPhaseTimeout"`

	PhaseTransitionTimeout time.Duration `json:"phaseTransitionTimeout"`

	EnableParallelProcessing bool `json:"enableParallelProcessing"`

	ParallelLimits map[interfaces.ProcessingPhase]int `json:"parallelLimits"`

	ParallelGroups map[string][]interfaces.ProcessingPhase `json:"parallelGroups"`

	MaxRetryAttempts int `json:"maxRetryAttempts"`

	RetryBackoff time.Duration `json:"retryBackoff"`

	ErrorStrategies map[interfaces.ProcessingPhase]ErrorStrategy `json:"errorStrategies"`

	HealthCheckInterval time.Duration `json:"healthCheckInterval"`

	UnhealthyThreshold int `json:"unhealthyThreshold"`

	WorkerPoolSize int `json:"workerPoolSize"`

	QueueCapacity int `json:"queueCapacity"`

	BatchProcessing bool `json:"batchProcessing"`

	BatchSize int `json:"batchSize"`
}

func DefaultCoordinationConfig

func DefaultCoordinationConfig() *CoordinationConfig

type CoordinationManager

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

func NewCoordinationManager

func NewCoordinationManager(stateManager *StateManager, eventBus EventBus, config *CoordinationConfig) *CoordinationManager

func (*CoordinationManager) ProcessIntent

func (cm *CoordinationManager) ProcessIntent(ctx context.Context, intentName types.NamespacedName) error

func (*CoordinationManager) RegisterController

func (cm *CoordinationManager) RegisterController(controller ControllerInterface) error

func (*CoordinationManager) RegisterPhaseExecutor

func (cm *CoordinationManager) RegisterPhaseExecutor(phase interfaces.ProcessingPhase, executor PhaseExecutor)

func (*CoordinationManager) Start

func (cm *CoordinationManager) Start(ctx context.Context) error

func (*CoordinationManager) Stop

func (cm *CoordinationManager) Stop(ctx context.Context) error

func (*CoordinationManager) TransitionPhase

func (cm *CoordinationManager) TransitionPhase(ctx context.Context, intentName types.NamespacedName, fromPhase, toPhase interfaces.ProcessingPhase, data interface{}) error

type CoordinationManagerAdapter

type CoordinationManagerAdapter struct {
	*CoordinationManager
}

func (*CoordinationManagerAdapter) GetName

func (cma *CoordinationManagerAdapter) GetName() string

func (*CoordinationManagerAdapter) IsHealthy

func (cma *CoordinationManagerAdapter) IsHealthy() bool

type DeadLetterEvent

type DeadLetterEvent struct {
	Event ProcessingEvent `json:"event"`

	Error string `json:"error"`

	Timestamp time.Time `json:"timestamp"`

	AttemptCount int `json:"attemptCount"`

	LastAttempt time.Time `json:"lastAttempt"`
}

type DeadLetterQueue

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

func NewDeadLetterQueue

func NewDeadLetterQueue(enabled bool) *DeadLetterQueue

func (*DeadLetterQueue) Add

func (dlq *DeadLetterQueue) Add(event ProcessingEvent, err error)

func (*DeadLetterQueue) Clear

func (dlq *DeadLetterQueue) Clear()

func (*DeadLetterQueue) GetEvents

func (dlq *DeadLetterQueue) GetEvents() []DeadLetterEvent

type DocumentType

type DocumentType string

DocumentType represents the type of telecom document

const (
	DocumentTypeSpec     DocumentType = "specification"
	DocumentTypeStandard DocumentType = "standard"
	DocumentTypeGuide    DocumentType = "guide"
	DocumentTypeAPI      DocumentType = "api"
	DocumentTypeConfig   DocumentType = "configuration"
	DocumentTypePolicy   DocumentType = "policy"
	DocumentTypeOther    DocumentType = "other"
)

type EmbeddingServiceInterface

type EmbeddingServiceInterface interface {
	CreateEmbedding(ctx context.Context, text string) ([]float32, error)
	CreateBatchEmbeddings(ctx context.Context, texts []string) ([][]float32, error)
	CalculateSimilarity(ctx context.Context, text1, text2 string) (float32, error)
	GetDimensions() int
	GetModel() string
}

EmbeddingServiceInterface defines the interface for embedding service

type EnhancedClientInterface

type EnhancedClientInterface interface {
	ClientInterface

	// Process request with options (Go 1.24 functional options pattern)
	ProcessRequestWithOptions(ctx context.Context, request *LLMRequest, opts ...RequestOption) (*LLMResponse, error)

	// Batch processing with structured concurrency
	ProcessBatch(ctx context.Context, requests []*LLMRequest, opts ...RequestOption) ([]*LLMResponse, error)

	// Health check with detailed status
	HealthCheckDetailed(ctx context.Context) (*HealthStatus, error)

	// Metrics and observability
	GetMetrics(ctx context.Context) (*ClientMetrics, error)
}

EnhancedClientInterface extends ClientInterface with Go 1.24 patterns

type EnhancedEventBus

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

func NewEnhancedEventBus

func NewEnhancedEventBus(config *EventBusConfig) *EnhancedEventBus

func (*EnhancedEventBus) AddEventFilter

func (eb *EnhancedEventBus) AddEventFilter(eventType string, filter EventFilter)

func (*EnhancedEventBus) AddEventRoute

func (eb *EnhancedEventBus) AddEventRoute(eventType string, targetComponents []string)

func (*EnhancedEventBus) GetEventHistory

func (eb *EnhancedEventBus) GetEventHistory(ctx context.Context, intentID string) ([]ProcessingEvent, error)

func (*EnhancedEventBus) GetEventsByType

func (eb *EnhancedEventBus) GetEventsByType(ctx context.Context, eventType string, limit int) ([]ProcessingEvent, error)

func (*EnhancedEventBus) Publish

func (eb *EnhancedEventBus) Publish(ctx context.Context, event ProcessingEvent) error

func (*EnhancedEventBus) PublishStateChange

func (eb *EnhancedEventBus) PublishStateChange(ctx context.Context, event StateChangeEvent) error

func (*EnhancedEventBus) Start

func (eb *EnhancedEventBus) Start(ctx context.Context) error

func (*EnhancedEventBus) Stop

func (eb *EnhancedEventBus) Stop(ctx context.Context) error

func (*EnhancedEventBus) Subscribe

func (eb *EnhancedEventBus) Subscribe(eventType string, handler EventHandler) error

func (*EnhancedEventBus) Unsubscribe

func (eb *EnhancedEventBus) Unsubscribe(eventType string) error

type EnhancedEventBusAdapter

type EnhancedEventBusAdapter struct {
	*EnhancedEventBus
}

func (*EnhancedEventBusAdapter) GetName

func (eeba *EnhancedEventBusAdapter) GetName() string

func (*EnhancedEventBusAdapter) IsHealthy

func (eeba *EnhancedEventBusAdapter) IsHealthy() bool

type ErrorStrategy

type ErrorStrategy struct {
	Type string `json:"type"` // "retry", "skip", "fail", "rollback"

	MaxRetries int `json:"maxRetries"`

	RetryBackoff time.Duration `json:"retryBackoff"`

	FallbackPhase string `json:"fallbackPhase,omitempty"`

	NotifyOnError bool `json:"notifyOnError"`
}

type EventBus

type EventBus interface {
	PublishStateChange(ctx context.Context, event StateChangeEvent) error

	Subscribe(eventType string, handler EventHandler) error

	Unsubscribe(eventType string) error

	Start(ctx context.Context) error

	Stop(ctx context.Context) error

	GetEventHistory(ctx context.Context, intentID string) ([]ProcessingEvent, error)

	GetEventsByType(ctx context.Context, eventType string, limit int) ([]ProcessingEvent, error)
}

type EventBusConfig

type EventBusConfig struct {
	BufferSize int `json:"bufferSize"`

	MaxEventSize int64 `json:"maxEventSize"`

	BatchSize int `json:"batchSize"`

	BatchTimeout time.Duration `json:"batchTimeout"`

	PersistenceDir string `json:"persistenceDir"`

	EnablePersistence bool `json:"enablePersistence"`

	LogRotationSize int64 `json:"logRotationSize"`

	LogRetentionDays int `json:"logRetentionDays"`

	MaxRetries int `json:"maxRetries"`

	RetryBackoff time.Duration `json:"retryBackoff"`

	AckTimeout time.Duration `json:"ackTimeout"`

	DeadLetterEnabled bool `json:"deadLetterEnabled"`

	OrderingMode string `json:"orderingMode"` // "none", "global", "partition"

	PartitionStrategy string `json:"partitionStrategy"` // "intent", "component", "hash"

	MaxPartitions int `json:"maxPartitions"`

	EnableBatching bool `json:"enableBatching"`

	EnableCompression bool `json:"enableCompression"`

	CompressionLevel int `json:"compressionLevel"`

	WorkerCount int `json:"workerCount"`

	EnableMetrics bool `json:"enableMetrics"`

	MetricsInterval time.Duration `json:"metricsInterval"`

	HealthCheckInterval time.Duration `json:"healthCheckInterval"`
}

func DefaultEventBusConfig

func DefaultEventBusConfig() *EventBusConfig

type EventBusMetrics

type EventBusMetrics interface {
	GetTotalEventsPublished() int64

	GetTotalEventsProcessed() int64

	GetFailedHandlers() int64

	GetAverageProcessingTime() int64 // in milliseconds

	GetBufferUtilization() float64

	RecordEventPublished(eventType string)

	RecordEventProcessed(processingTime time.Duration)

	RecordHandlerFailure()

	SetBufferUtilization(utilization float64)

	SetPartitionCount(count int)
}

type EventBusMetricsImpl

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

func NewEventBusMetricsImpl

func NewEventBusMetricsImpl() *EventBusMetricsImpl

func (*EventBusMetricsImpl) GetAverageProcessingTime

func (m *EventBusMetricsImpl) GetAverageProcessingTime() int64

func (*EventBusMetricsImpl) GetBufferUtilization

func (m *EventBusMetricsImpl) GetBufferUtilization() float64

func (*EventBusMetricsImpl) GetFailedHandlers

func (m *EventBusMetricsImpl) GetFailedHandlers() int64

func (*EventBusMetricsImpl) GetTotalEventsProcessed

func (m *EventBusMetricsImpl) GetTotalEventsProcessed() int64

func (*EventBusMetricsImpl) GetTotalEventsPublished

func (m *EventBusMetricsImpl) GetTotalEventsPublished() int64

func (*EventBusMetricsImpl) RecordEventProcessed

func (m *EventBusMetricsImpl) RecordEventProcessed(processingTime time.Duration)

func (*EventBusMetricsImpl) RecordEventPublished

func (m *EventBusMetricsImpl) RecordEventPublished(eventType string)

func (*EventBusMetricsImpl) RecordHandlerFailure

func (m *EventBusMetricsImpl) RecordHandlerFailure()

func (*EventBusMetricsImpl) SetBufferUtilization

func (m *EventBusMetricsImpl) SetBufferUtilization(utilization float64)

func (*EventBusMetricsImpl) SetPartitionCount

func (m *EventBusMetricsImpl) SetPartitionCount(count int)

type EventFilter

type EventFilter interface {
	ShouldProcess(event ProcessingEvent) bool
}

type EventHandler

type EventHandler func(ctx context.Context, event ProcessingEvent) error

type EventHealthChecker

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

func NewEventHealthChecker

func NewEventHealthChecker(interval time.Duration) *EventHealthChecker

func (*EventHealthChecker) AddHealthCheck

func (ehc *EventHealthChecker) AddHealthCheck(name string, check func() error)

func (*EventHealthChecker) IsHealthy

func (ehc *EventHealthChecker) IsHealthy() bool

func (*EventHealthChecker) Start

func (ehc *EventHealthChecker) Start(ctx context.Context, wg *sync.WaitGroup)

type EventLog

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

func NewEventLog

func NewEventLog(dir string, rotationSize int64, retentionDays int) *EventLog

func (*EventLog) Close

func (el *EventLog) Close() error

func (*EventLog) GetEventsByIntentID

func (el *EventLog) GetEventsByIntentID(intentID string) ([]ProcessingEvent, error)

func (*EventLog) GetEventsByType

func (el *EventLog) GetEventsByType(eventType string, limit int) ([]ProcessingEvent, error)

func (*EventLog) WriteEvent

func (el *EventLog) WriteEvent(event ProcessingEvent) error

type EventOrdering

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

func NewEventOrdering

func NewEventOrdering(mode, strategy string) EventOrdering

type EventPartition

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

func NewEventPartition

func NewEventPartition(id string, maxSize int) *EventPartition

func (*EventPartition) AddEvent

func (ep *EventPartition) AddEvent(event ProcessingEvent)

func (*EventPartition) GetEvents

func (ep *EventPartition) GetEvents() []ProcessingEvent

type ExecutionQueue

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

func NewExecutionQueue

func NewExecutionQueue(capacity int) *ExecutionQueue

func (*ExecutionQueue) CancelTask

func (eq *ExecutionQueue) CancelTask(intentName types.NamespacedName, phase interfaces.ProcessingPhase) error

func (*ExecutionQueue) CleanupExpiredTasks

func (eq *ExecutionQueue) CleanupExpiredTasks() int

func (*ExecutionQueue) CompleteTask

func (eq *ExecutionQueue) CompleteTask(task *ExecutionTask)

func (*ExecutionQueue) Dequeue

func (eq *ExecutionQueue) Dequeue() (*ExecutionTask, error)

func (*ExecutionQueue) Enqueue

func (eq *ExecutionQueue) Enqueue(task *ExecutionTask) error

func (*ExecutionQueue) FailTask

func (eq *ExecutionQueue) FailTask(task *ExecutionTask, err error) error

func (*ExecutionQueue) FilterTasks

func (eq *ExecutionQueue) FilterTasks(filter *TaskFilter, includeActive, includePending, includeCompleted bool) []*ExecutionTask

func (*ExecutionQueue) GetActiveCount

func (eq *ExecutionQueue) GetActiveCount() int

func (*ExecutionQueue) GetPendingCount

func (eq *ExecutionQueue) GetPendingCount() int

func (*ExecutionQueue) GetStats

func (eq *ExecutionQueue) GetStats() *QueueStats

func (*ExecutionQueue) ListActiveTasks

func (eq *ExecutionQueue) ListActiveTasks() []*ExecutionTask

func (*ExecutionQueue) ListPendingTasks

func (eq *ExecutionQueue) ListPendingTasks() []*ExecutionTask

type ExecutionTask

type ExecutionTask struct {
	IntentName types.NamespacedName `json:"intentName"`

	Phase interfaces.ProcessingPhase `json:"phase"`

	Priority int `json:"priority"`

	Timestamp time.Time `json:"timestamp"`

	Context json.RawMessage `json:"context"`

	RetryCount int `json:"retryCount"`

	MaxRetries int `json:"maxRetries"`

	Dependencies []string `json:"dependencies,omitempty"`
	// contains filtered or unexported fields
}

type GenericRateLimiterConfig

type GenericRateLimiterConfig struct {
	RequestsPerSecond float64       `json:"requests_per_second"`
	BurstSize         int           `json:"burst_size"`
	Timeout           time.Duration `json:"timeout"`
}

GenericRateLimiterConfig configures rate limiting for generic use cases

type HealthCheck

type HealthCheck struct {
	Name string

	Check func() error

	LastRun time.Time

	LastError error
}

type HealthChecker

type HealthChecker interface {
	Check(ctx context.Context) error

	GetName() string
}

type HealthStatus

type HealthStatus struct {
	Status      ClientStatus    `json:"status"`
	Latency     time.Duration   `json:"latency"`
	LastChecked time.Time       `json:"last_checked"`
	Errors      []string        `json:"errors,omitempty"`
	Details     json.RawMessage `json:"details,omitempty"`
}

HealthStatus provides detailed health information

type IOOptimizer

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

func NewIOOptimizer

func NewIOOptimizer(maxConcurrent int, defaultTimeout time.Duration,

	bufferingEnabled bool, bufferSize int,
) *IOOptimizer

func (*IOOptimizer) Optimize

func (io *IOOptimizer) Optimize(ctx context.Context) error

type IntegrationConfig

type IntegrationConfig struct {
	MetricsAddr string `json:"metricsAddr"`

	ProbeAddr string `json:"probeAddr"`

	PprofAddr string `json:"pprofAddr"`

	EnableLeaderElection bool `json:"enableLeaderElection"`

	LeaderElectionID string `json:"leaderElectionID"`

	StateManager *StateManagerConfig `json:"stateManager,omitempty"`

	EventBus *EventBusConfig `json:"eventBus,omitempty"`

	Coordination *CoordinationConfig `json:"coordination,omitempty"`

	Performance *PerformanceConfig `json:"performance,omitempty"`

	Recovery *RecoveryConfig `json:"recovery,omitempty"`

	HealthCheckInterval time.Duration `json:"healthCheckInterval"`

	MetricsInterval time.Duration `json:"metricsInterval"`

	EnableProfiling bool `json:"enableProfiling"`

	WebhookPort int `json:"webhookPort"`

	WebhookCertDir string `json:"webhookCertDir"`

	EnableRBAC bool `json:"enableRBAC"`

	SecureMetrics bool `json:"secureMetrics"`
}

func DefaultIntegrationConfig

func DefaultIntegrationConfig() *IntegrationConfig

type IntegrationConfigValidator

type IntegrationConfigValidator struct{}

func (*IntegrationConfigValidator) GetConfigType

func (v *IntegrationConfigValidator) GetConfigType() string

func (*IntegrationConfigValidator) Validate

func (v *IntegrationConfigValidator) Validate(config interface{}) error

type IntegrationManager

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

func NewIntegrationManager

func NewIntegrationManager(mgr manager.Manager, config *IntegrationConfig) (*IntegrationManager, error)

func (*IntegrationManager) GetCoordinationManager

func (im *IntegrationManager) GetCoordinationManager() *CoordinationManager

func (*IntegrationManager) GetEventBus

func (im *IntegrationManager) GetEventBus() EventBus

func (*IntegrationManager) GetMetrics

func (im *IntegrationManager) GetMetrics() map[string]interface{}

func (*IntegrationManager) GetPerformanceOptimizer

func (im *IntegrationManager) GetPerformanceOptimizer() *PerformanceOptimizer

func (*IntegrationManager) GetRecoveryManager

func (im *IntegrationManager) GetRecoveryManager() *RecoveryManager

func (*IntegrationManager) GetStateManager

func (im *IntegrationManager) GetStateManager() *StateManager

func (*IntegrationManager) GetSystemHealth

func (im *IntegrationManager) GetSystemHealth() *SystemHealth

func (*IntegrationManager) RegisterController

func (im *IntegrationManager) RegisterController(controller ControllerInterface) error

func (*IntegrationManager) RegisterHealthChecker

func (im *IntegrationManager) RegisterHealthChecker(checker HealthChecker)

func (*IntegrationManager) RegisterWebhook

func (im *IntegrationManager) RegisterWebhook(name string, webhook WebhookInterface) error

func (*IntegrationManager) SetupWithManager

func (im *IntegrationManager) SetupWithManager() error

func (*IntegrationManager) Start

func (im *IntegrationManager) Start(ctx context.Context) error

func (*IntegrationManager) Stop

func (im *IntegrationManager) Stop(ctx context.Context) error

type IntentDependency

type IntentDependency struct {
	Intent string `json:"intent"`

	Phase interfaces.ProcessingPhase `json:"phase"`

	Type string `json:"type"` // "blocking", "soft", "notification"

	Timestamp time.Time `json:"timestamp"`

	Condition string `json:"condition,omitempty"`

	Timeout time.Duration `json:"timeout,omitempty"`
}

type IntentState

type IntentState struct {
	NamespacedName types.NamespacedName `json:"namespacedName"`

	Version string `json:"version"`

	CreationTime time.Time `json:"creationTime"`

	LastModified time.Time `json:"lastModified"`

	CurrentPhase interfaces.ProcessingPhase `json:"currentPhase"`

	PhaseStartTime time.Time `json:"phaseStartTime"`

	PhaseTransitions []PhaseTransition `json:"phaseTransitions"`

	PhaseData map[interfaces.ProcessingPhase]interface{} `json:"phaseData"`

	PhaseErrors map[interfaces.ProcessingPhase][]string `json:"phaseErrors"`

	Conditions []StateCondition `json:"conditions"`

	Dependencies []IntentDependency `json:"dependencies"`

	DependentIntents []string `json:"dependentIntents"`

	LastError string `json:"lastError,omitempty"`

	LastErrorTime time.Time `json:"lastErrorTime,omitempty"`

	RetryCount int `json:"retryCount"`

	AllocatedResources []ResourceAllocation `json:"allocatedResources"`

	ResourceLocks []ResourceLock `json:"resourceLocks"`

	ProcessingDuration time.Duration `json:"processingDuration"`

	PhaseMetrics map[interfaces.ProcessingPhase]PhaseMetrics `json:"phaseMetrics"`

	Metadata json.RawMessage `json:"metadata"`

	Tags []string `json:"tags"`
}

type LLMError

type LLMError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Type    string `json:"type"`
}

LLMError represents an error from LLM service

type LLMRequest

type LLMRequest struct {
	Model       string          `json:"model"`
	Messages    []ChatMessage   `json:"messages"`
	MaxTokens   int             `json:"max_tokens,omitempty"`
	Temperature float32         `json:"temperature,omitempty"`
	Stream      bool            `json:"stream,omitempty"`
	Metadata    json.RawMessage `json:"metadata,omitempty"`
}

LLMRequest represents a request to an LLM service

type LLMResponse

type LLMResponse struct {
	ID      string     `json:"id"`
	Content string     `json:"content"`
	Model   string     `json:"model"`
	Usage   TokenUsage `json:"usage"`
	Created time.Time  `json:"created"`
	Error   *LLMError  `json:"error,omitempty"`
}

LLMResponse represents a response from an LLM service

type LatencyTracker

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

func NewLatencyTracker

func NewLatencyTracker(maxSamples int) *LatencyTracker

func (*LatencyTracker) GetP50

func (lt *LatencyTracker) GetP50() time.Duration

func (*LatencyTracker) GetP95

func (lt *LatencyTracker) GetP95() time.Duration

func (*LatencyTracker) GetP99

func (lt *LatencyTracker) GetP99() time.Duration

func (*LatencyTracker) RecordLatency

func (lt *LatencyTracker) RecordLatency(latency time.Duration)

type Lock

type Lock struct {
	Key string `json:"key"`

	Owner string `json:"owner"`

	LockType string `json:"lockType"`

	AcquiredAt time.Time `json:"acquiredAt"`

	ExpiresAt time.Time `json:"expiresAt"`

	Renewable bool `json:"renewable"`

	Metadata map[string]string `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

type LockManager

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

func NewLockManager

func NewLockManager(defaultTimeout, retryInterval time.Duration, maxRetries int) *LockManager

func (*LockManager) AcquireLock

func (lm *LockManager) AcquireLock(ctx context.Context, key string) error

func (*LockManager) AcquireLockWithOptions

func (lm *LockManager) AcquireLockWithOptions(ctx context.Context, key string, opts *LockOptions) error

func (*LockManager) ActiveLocks

func (lm *LockManager) ActiveLocks() int

func (*LockManager) GetLock

func (lm *LockManager) GetLock(key string) (*Lock, bool)

func (*LockManager) GetStats

func (lm *LockManager) GetStats() *LockStats

func (*LockManager) IsLocked

func (lm *LockManager) IsLocked(key string) bool

func (*LockManager) ListLocks

func (lm *LockManager) ListLocks() []*Lock

func (*LockManager) LockWithContext

func (lm *LockManager) LockWithContext(ctx context.Context, key string, fn func() error) error

func (*LockManager) ReleaseLock

func (lm *LockManager) ReleaseLock(key string) error

func (*LockManager) RenewLock

func (lm *LockManager) RenewLock(key string, duration time.Duration) error

func (*LockManager) Stop

func (lm *LockManager) Stop()

func (*LockManager) TryLockWithTimeout

func (lm *LockManager) TryLockWithTimeout(ctx context.Context, key string, timeout time.Duration) error

type LockOptions

type LockOptions struct {
	Timeout time.Duration `json:"timeout,omitempty"`

	LockType string `json:"lockType,omitempty"` // "exclusive", "shared"

	Renewable bool `json:"renewable,omitempty"`

	Owner string `json:"owner,omitempty"`

	Metadata map[string]string `json:"metadata,omitempty"`

	RetryCount int `json:"retryCount,omitempty"`

	RetryBackoff time.Duration `json:"retryBackoff,omitempty"`
}

func DefaultLockOptions

func DefaultLockOptions() *LockOptions

type LockStats

type LockStats struct {
	ActiveLocks int64 `json:"activeLocks"`

	LocksAcquired int64 `json:"locksAcquired"`

	LocksReleased int64 `json:"locksReleased"`

	LockTimeouts int64 `json:"lockTimeouts"`

	LockConflicts int64 `json:"lockConflicts"`
}

type MainIntegration

type MainIntegration struct{}

MainIntegration provides a stub for integration tests

func NewMainIntegration

func NewMainIntegration() *MainIntegration

NewMainIntegration creates a new integration test instance

type MemoryManager

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

func NewMemoryManager

func NewMemoryManager(maxMemory int64, gcThreshold float64) *MemoryManager

func (*MemoryManager) Optimize

func (mm *MemoryManager) Optimize(ctx context.Context) error

type MetricError

type MetricError struct {
	Timestamp time.Time `json:"timestamp"`

	Operation string `json:"operation"`

	Error string `json:"error"`

	Context string `json:"context,omitempty"`

	Severity string `json:"severity"`
}

type MetricsCollector

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

type ModelCapabilities

type ModelCapabilities struct {
	SupportsStreaming    bool            `json:"supports_streaming"`
	SupportsSystemPrompt bool            `json:"supports_system_prompt"`
	SupportsChatFormat   bool            `json:"supports_chat_format"`
	SupportsChat         bool            `json:"supports_chat"`
	SupportsFunction     bool            `json:"supports_function"`
	MaxTokens            int             `json:"max_tokens"`
	CostPerToken         float64         `json:"cost_per_token"`
	SupportedMimeTypes   []string        `json:"supported_mime_types"`
	ModelVersion         string          `json:"model_version"`
	Features             json.RawMessage `json:"features"`
}

ModelCapabilities represents model capabilities

type PerformanceConfig

type PerformanceConfig struct {
	DefaultPoolSize int `json:"defaultPoolSize"`

	MaxPoolSize int `json:"maxPoolSize"`

	PoolIdleTimeout time.Duration `json:"poolIdleTimeout"`

	PoolHealthCheckInterval time.Duration `json:"poolHealthCheckInterval"`

	DefaultBatchSize int `json:"defaultBatchSize"`

	MaxBatchSize int `json:"maxBatchSize"`

	BatchTimeout time.Duration `json:"batchTimeout"`

	EnableAdaptiveBatching bool `json:"enableAdaptiveBatching"`

	MaxMemoryUsage int64 `json:"maxMemoryUsage"` // in bytes

	GCThreshold float64 `json:"gcThreshold"` // memory usage percentage

	MemoryCheckInterval time.Duration `json:"memoryCheckInterval"`

	MaxCPUUsage float64 `json:"maxCPUUsage"` // percentage

	CPUThrottleThreshold float64 `json:"cpuThrottleThreshold"`

	CPUCheckInterval time.Duration `json:"cpuCheckInterval"`

	MaxConcurrentIO int `json:"maxConcurrentIO"`

	IOTimeoutDefault time.Duration `json:"ioTimeoutDefault"`

	EnableIOBuffering bool `json:"enableIOBuffering"`

	IOBufferSize int `json:"ioBufferSize"`

	CacheHitRateThreshold float64 `json:"cacheHitRateThreshold"`

	CacheEvictionStrategy string `json:"cacheEvictionStrategy"`

	CacheSizeThreshold int64 `json:"cacheSizeThreshold"`

	MonitoringInterval time.Duration `json:"monitoringInterval"`

	MetricsRetentionDays int `json:"metricsRetentionDays"`

	EnableProfiling bool `json:"enableProfiling"`
}

func DefaultPerformanceConfig

func DefaultPerformanceConfig() *PerformanceConfig

type PerformanceMetric

type PerformanceMetric struct {
	Name string `json:"name"`

	Value float64 `json:"value"`

	Unit string `json:"unit"`

	Timestamp time.Time `json:"timestamp"`

	Tags map[string]string `json:"tags"`

	History []float64 `json:"history"`
}

type PerformanceMonitor

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

func NewPerformanceMonitor

func NewPerformanceMonitor(interval time.Duration, retentionDays int,

	profiling bool,
) *PerformanceMonitor

func (*PerformanceMonitor) CollectMetrics

func (pm *PerformanceMonitor) CollectMetrics(ctx context.Context)

type PerformanceOptimizer

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

func NewPerformanceOptimizer

func NewPerformanceOptimizer(config *PerformanceConfig) *PerformanceOptimizer

func (*PerformanceOptimizer) CreateBatchProcessor

func (po *PerformanceOptimizer) CreateBatchProcessor(name string, batchSize int,

	processor func([]interface{}) error,
) *BatchProcessor

func (*PerformanceOptimizer) CreateConnectionPool

func (po *PerformanceOptimizer) CreateConnectionPool(name string, factory func() (Connection, error), maxSize int) *ConnectionPool

func (*PerformanceOptimizer) GetBatchProcessor

func (po *PerformanceOptimizer) GetBatchProcessor(name string) *BatchProcessor

func (*PerformanceOptimizer) GetConnectionPool

func (po *PerformanceOptimizer) GetConnectionPool(name string) *ConnectionPool

func (*PerformanceOptimizer) OptimizeCPUUsage

func (po *PerformanceOptimizer) OptimizeCPUUsage(ctx context.Context) error

func (*PerformanceOptimizer) OptimizeCachePerformance

func (po *PerformanceOptimizer) OptimizeCachePerformance(ctx context.Context) error

func (*PerformanceOptimizer) OptimizeIOPerformance

func (po *PerformanceOptimizer) OptimizeIOPerformance(ctx context.Context) error

func (*PerformanceOptimizer) OptimizeMemoryUsage

func (po *PerformanceOptimizer) OptimizeMemoryUsage(ctx context.Context) error

func (*PerformanceOptimizer) Start

func (po *PerformanceOptimizer) Start(ctx context.Context) error

func (*PerformanceOptimizer) Stop

func (po *PerformanceOptimizer) Stop(ctx context.Context) error

type PerformanceOptimizerAdapter

type PerformanceOptimizerAdapter struct {
	*PerformanceOptimizer
}

func (*PerformanceOptimizerAdapter) GetName

func (poa *PerformanceOptimizerAdapter) GetName() string

func (*PerformanceOptimizerAdapter) IsHealthy

func (poa *PerformanceOptimizerAdapter) IsHealthy() bool

type PhaseExecutor

type PhaseExecutor interface {
	Execute(ctx context.Context, intent types.NamespacedName, phase interfaces.ProcessingPhase, data interface{}) error

	Validate(phase interfaces.ProcessingPhase, data interface{}) error

	GetEstimatedDuration(phase interfaces.ProcessingPhase) time.Duration

	CanExecuteParallel() bool
}

type PhaseMetrics

type PhaseMetrics struct {
	StartTime time.Time `json:"startTime"`

	EndTime time.Time `json:"endTime"`

	Duration time.Duration `json:"duration"`

	AttemptsCount int `json:"attemptsCount"`

	SuccessCount int `json:"successCount"`

	ErrorCount int `json:"errorCount"`

	ResourcesUsed []string `json:"resourcesUsed"`

	ProcessedItems int `json:"processedItems"`

	ThroughputRate float64 `json:"throughputRate"`

	MemoryUsageMB float64 `json:"memoryUsageMB"`

	CPUUsagePercent float64 `json:"cpuUsagePercent"`
}

type PhaseTransition

type PhaseTransition struct {
	FromPhase interfaces.ProcessingPhase `json:"fromPhase"`

	ToPhase interfaces.ProcessingPhase `json:"toPhase"`

	Timestamp time.Time `json:"timestamp"`

	Duration time.Duration `json:"duration"`

	TriggerReason string `json:"triggerReason,omitempty"`

	Metadata json.RawMessage `json:"metadata,omitempty"`

	Success bool `json:"success"`

	ErrorMessage string `json:"errorMessage,omitempty"`
}

type ProcessingEvent

type ProcessingEvent struct {
	Type string `json:"type"`

	Source string `json:"source"`

	IntentID string `json:"intentId"`

	Phase string `json:"phase"`

	Success bool `json:"success"`

	Data json.RawMessage `json:"data"`

	Timestamp int64 `json:"timestamp"` // Unix timestamp

	CorrelationID string `json:"correlationId"`

	Metadata map[string]string `json:"metadata,omitempty"`
}

type QueryRequest

type QueryRequest struct {
	Query     string          `json:"query"`
	Filters   json.RawMessage `json:"filters,omitempty"`
	Limit     int             `json:"limit,omitempty"`
	Threshold float32         `json:"threshold,omitempty"`
	UserID    string          `json:"user_id,omitempty"`
	SessionID string          `json:"session_id,omitempty"`
}

QueryRequest represents a request for query processing

type QueueStats

type QueueStats struct {
	PendingTasks int64 `json:"pendingTasks"`

	ActiveTasks int64 `json:"activeTasks"`

	CompletedTasks int64 `json:"completedTasks"`

	EnqueuedCount int64 `json:"enqueuedCount"`

	DequeuedCount int64 `json:"dequeuedCount"`

	DroppedCount int64 `json:"droppedCount"`

	Capacity int64 `json:"capacity"`

	MaxPendingTasks int64 `json:"maxPendingTasks"`
}

type RAGError

type RAGError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Type    string `json:"type"`
}

RAGError represents an error from RAG system

type RAGResponse

type RAGResponse struct {
	Query       string            `json:"query"`
	Results     []SearchResult    `json:"results"`
	Context     string            `json:"context"`
	Documents   []TelecomDocument `json:"documents"`
	TotalTime   time.Duration     `json:"total_time"`
	Took        time.Duration     `json:"took"` // Time taken for the search
	Confidence  float64           `json:"confidence"`
	Error       *RAGError         `json:"error,omitempty"`
	ProcessedAt time.Time         `json:"processed_at,omitempty"` // When the response was processed
	Metadata    json.RawMessage   `json:"metadata,omitempty"`     // Additional metadata
}

RAGResponse represents the response from RAG system

type RAGServiceInterface

type RAGServiceInterface interface {
	Search(ctx context.Context, query *SearchQuery) (*RAGResponse, error)
	IndexDocument(ctx context.Context, document *TelecomDocument) error
	DeleteDocument(ctx context.Context, documentID string) error
	GetDocument(ctx context.Context, documentID string) (*TelecomDocument, error)
	HealthCheck(ctx context.Context) error
	Close() error
}

RAGServiceInterface defines the interface for RAG service

type RecoveryAction

type RecoveryAction struct {
	Type string `json:"type"`

	Description string `json:"description"`

	Timestamp time.Time `json:"timestamp"`

	Success bool `json:"success"`

	Error string `json:"error,omitempty"`

	Data json.RawMessage `json:"data,omitempty"`
}

type RecoveryAttempt

type RecoveryAttempt struct {
	ID string `json:"id"`

	IntentName types.NamespacedName `json:"intentName"`

	Phase interfaces.ProcessingPhase `json:"phase"`

	Strategy *RecoveryStrategy `json:"strategy"`

	StartTime time.Time `json:"startTime"`

	EndTime time.Time `json:"endTime"`

	AttemptNumber int `json:"attemptNumber"`

	Status string `json:"status"` // "running", "success", "failed", "timeout"

	Error string `json:"error,omitempty"`

	RecoveryActions []RecoveryAction `json:"recoveryActions"`

	StateBeforeRecovery *IntentState `json:"stateBeforeRecovery,omitempty"`

	StateAfterRecovery *IntentState `json:"stateAfterRecovery,omitempty"`

	Metadata json.RawMessage `json:"metadata,omitempty"`
}

type RecoveryCondition

type RecoveryCondition struct {
	Type string `json:"type"` // "state_field", "resource_exists", "time_threshold", "custom"

	Field string `json:"field,omitempty"`

	Operator string `json:"operator"` // "equals", "not_equals", "greater_than", "less_than", "exists", "not_exists"

	Value interface{} `json:"value,omitempty"`

	Description string `json:"description,omitempty"`
}

type RecoveryConfig

type RecoveryConfig struct {
	RecoveryInterval time.Duration `json:"recoveryInterval"`

	StateCheckInterval time.Duration `json:"stateCheckInterval"`

	MaxRecoveryAttempts int `json:"maxRecoveryAttempts"`

	RecoveryTimeout time.Duration `json:"recoveryTimeout"`

	MaxConcurrentRecoveries int `json:"maxConcurrentRecoveries"`

	DefaultStrategy string `json:"defaultStrategy"` // "restart", "rollback", "skip", "manual"

	EnableAutoRecovery bool `json:"enableAutoRecovery"`

	EnablePreemptiveRecovery bool `json:"enablePreemptiveRecovery"`

	EnableStateValidation bool `json:"enableStateValidation"`

	StateCorruptionAction string `json:"stateCorruptionAction"` // "restore", "recreate", "alert"

	BackupRetentionDays int `json:"backupRetentionDays"`
}

func DefaultRecoveryConfig

func DefaultRecoveryConfig() *RecoveryConfig

type RecoveryHandler

type RecoveryHandler func(ctx context.Context, attempt *RecoveryAttempt) error

type RecoveryManager

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

func NewRecoveryManager

func NewRecoveryManager(stateManager *StateManager, eventBus EventBus) *RecoveryManager

func (*RecoveryManager) GetRecoveryHistory

func (rm *RecoveryManager) GetRecoveryHistory(intentName types.NamespacedName) []*RecoveryAttempt

func (*RecoveryManager) GetRecoveryStats

func (rm *RecoveryManager) GetRecoveryStats() *RecoveryStats

func (*RecoveryManager) RecoverIntent

func (rm *RecoveryManager) RecoverIntent(ctx context.Context, intentName types.NamespacedName, phase interfaces.ProcessingPhase, reason string) error

func (*RecoveryManager) RegisterRecoveryStrategy

func (rm *RecoveryManager) RegisterRecoveryStrategy(phase interfaces.ProcessingPhase, strategy *RecoveryStrategy)

func (*RecoveryManager) Start

func (rm *RecoveryManager) Start(ctx context.Context) error

func (*RecoveryManager) Stop

func (rm *RecoveryManager) Stop(ctx context.Context) error

type RecoveryManagerAdapter

type RecoveryManagerAdapter struct {
	*RecoveryManager
}

func (*RecoveryManagerAdapter) GetName

func (rma *RecoveryManagerAdapter) GetName() string

func (*RecoveryManagerAdapter) IsHealthy

func (rma *RecoveryManagerAdapter) IsHealthy() bool

type RecoveryStats

type RecoveryStats struct {
	TotalAttempts int `json:"totalAttempts"`

	SuccessfulAttempts int `json:"successfulAttempts"`

	FailedAttempts int `json:"failedAttempts"`

	RunningAttempts int `json:"runningAttempts"`

	AttemptsByPhase map[string]int `json:"attemptsByPhase"`

	AttemptsByStrategy map[string]int `json:"attemptsByStrategy"`
}

type RecoveryStrategy

type RecoveryStrategy struct {
	Type string `json:"type"` // "restart", "rollback", "skip", "manual", "custom"

	MaxAttempts int `json:"maxAttempts"`

	BackoffMultiplier float64 `json:"backoffMultiplier"`

	InitialBackoff time.Duration `json:"initialBackoff"`

	MaxBackoff time.Duration `json:"maxBackoff"`

	PreConditions []RecoveryCondition `json:"preConditions,omitempty"`

	PostConditions []RecoveryCondition `json:"postConditions,omitempty"`

	CustomHandler RecoveryHandler `json:"-"` // Function for custom recovery

	NotificationTargets []string `json:"notificationTargets,omitempty"`
}

type RequestOption

type RequestOption func(*RequestOptions)

RequestOption represents functional options for requests (Go 1.24 pattern)

func WithHeaders

func WithHeaders(headers map[string]string) RequestOption

func WithRateLimiter

func WithRateLimiter(config GenericRateLimiterConfig) RequestOption

func WithRetryPolicy

func WithRetryPolicy(policy *RetryPolicy) RequestOption

func WithTimeout

func WithTimeout(timeout time.Duration) RequestOption

Functional option constructors

type RequestOptions

type RequestOptions struct {
	Timeout     time.Duration            `json:"timeout,omitempty"`
	RetryPolicy *RetryPolicy             `json:"retry_policy,omitempty"`
	RateLimiter GenericRateLimiterConfig `json:"rate_limiter,omitempty"`
	Headers     map[string]string        `json:"headers,omitempty"`
	Metadata    json.RawMessage          `json:"metadata,omitempty"`
}

RequestOptions provides optional configuration for requests

func ApplyRequestOptions

func ApplyRequestOptions(base *RequestOptions, opts ...RequestOption) *RequestOptions

Helper function to apply request options

type ResourceAllocation

type ResourceAllocation struct {
	ResourceType string `json:"resourceType"`

	ResourceID string `json:"resourceId"`

	Quantity string `json:"quantity"`

	Status string `json:"status"` // "allocated", "released", "pending"

	AllocatedAt time.Time `json:"allocatedAt"`

	Metadata map[string]string `json:"metadata,omitempty"`
}

type ResourceLock

type ResourceLock struct {
	LockID string `json:"lockId"`

	ResourceType string `json:"resourceType"`

	ResourceID string `json:"resourceId"`

	LockType string `json:"lockType"` // "exclusive", "shared"

	AcquiredAt time.Time `json:"acquiredAt"`

	ExpiresAt time.Time `json:"expiresAt"`

	Metadata map[string]string `json:"metadata,omitempty"`
}

type ResourceUsage

type ResourceUsage struct {
	CPUPercent float64 `json:"cpuPercent"`

	MemoryPercent float64 `json:"memoryPercent"`

	DiskPercent float64 `json:"diskPercent"`

	NetworkInMBps float64 `json:"networkInMBps"`

	NetworkOutMBps float64 `json:"networkOutMBps"`

	ActiveConnections int `json:"activeConnections"`
}

type Result

type Result[T any] struct {
	Value T
	Err   error
}

Result represents a generic result with error handling (Go 1.24 pattern)

func (Result[T]) IsOK

func (r Result[T]) IsOK() bool

IsOK returns true if the result contains no error

func (Result[T]) Unwrap

func (r Result[T]) Unwrap() (T, error)

Unwrap returns the value and error

type RetryPolicy

type RetryPolicy struct {
	MaxRetries int `json:"maxRetries"`

	BackoffBase time.Duration `json:"backoffBase"`

	BackoffMax time.Duration `json:"backoffMax"`

	BackoffJitter bool `json:"backoffJitter"`

	RetryableErrors []string `json:"retryableErrors,omitempty"`
}

func (*RetryPolicy) Execute

func (rp *RetryPolicy) Execute(fn func() error) error

type SearchQuery

type SearchQuery struct {
	Query         string          `json:"query"`
	Limit         int             `json:"limit,omitempty"`
	Offset        int             `json:"offset,omitempty"`
	Threshold     float32         `json:"threshold,omitempty"`
	Filters       json.RawMessage `json:"filters,omitempty"`
	ContextID     string          `json:"context_id,omitempty"`
	UserID        string          `json:"user_id,omitempty"`
	Namespace     string          `json:"namespace,omitempty"`
	HybridSearch  bool            `json:"hybrid_search,omitempty"`
	HybridAlpha   float32         `json:"hybrid_alpha,omitempty"`
	UseReranker   bool            `json:"use_reranker,omitempty"`
	MinConfidence float32         `json:"min_confidence,omitempty"`
	IncludeVector bool            `json:"include_vector,omitempty"`
	ExpandQuery   bool            `json:"expand_query,omitempty"`
	TargetVectors []string        `json:"target_vectors,omitempty"`
}

SearchQuery represents a query to the RAG system

type SearchResponse

type SearchResponse struct {
	Results []*SearchResult `json:"results"`

	Took int64 `json:"took"`

	Total int64 `json:"total"`
}

type SearchResult

type SearchResult struct {
	ID         string           `json:"id"`
	Content    string           `json:"content"`
	Metadata   json.RawMessage  `json:"metadata"`
	Score      float32          `json:"score"`
	Distance   float32          `json:"distance"` // Added for test compatibility
	Source     string           `json:"source"`
	Chunk      int              `json:"chunk"`
	Title      string           `json:"title"`
	Summary    string           `json:"summary"`
	Document   *TelecomDocument `json:"document"` // Added for test compatibility
	CreatedAt  time.Time        `json:"created_at"`
	UpdatedAt  time.Time        `json:"updated_at"`
	Confidence float32          `json:"confidence"` // Added for test compatibility
}

SearchResult represents a single search result from RAG

type SimpleEventFilter

type SimpleEventFilter struct {
	AllowedSources []string

	AllowedPhases []string

	MinTimestamp int64
}

func (*SimpleEventFilter) ShouldProcess

func (f *SimpleEventFilter) ShouldProcess(event ProcessingEvent) bool

type StartableComponent

type StartableComponent interface {
	Start(ctx context.Context) error

	Stop(ctx context.Context) error

	IsHealthy() bool

	GetName() string
}

type StateCache

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

func NewStateCache

func NewStateCache(maxSize int, defaultTTL time.Duration) *StateCache

func (*StateCache) Cleanup

func (c *StateCache) Cleanup() int

func (*StateCache) Clear

func (c *StateCache) Clear()

func (*StateCache) Contains

func (c *StateCache) Contains(key string) bool

func (*StateCache) Delete

func (c *StateCache) Delete(key string) bool

func (*StateCache) Get

func (c *StateCache) Get(key string) interface{}

func (*StateCache) GetMostRecent

func (c *StateCache) GetMostRecent() (string, interface{}, bool)

func (*StateCache) GetMultiple

func (c *StateCache) GetMultiple(keys []string) map[string]interface{}

func (*StateCache) GetOldest

func (c *StateCache) GetOldest() (string, interface{}, bool)

func (*StateCache) GetWithStats

func (c *StateCache) GetWithStats(key string) (interface{}, *CacheEntryStats)

func (*StateCache) Keys

func (c *StateCache) Keys() []string

func (*StateCache) Set

func (c *StateCache) Set(key string, value interface{}, ttl time.Duration)

func (*StateCache) SetMultiple

func (c *StateCache) SetMultiple(entries map[string]interface{}, ttl time.Duration)

func (*StateCache) SetWithCallback

func (c *StateCache) SetWithCallback(key string, value interface{}, ttl time.Duration, callback func(string, interface{}))

func (*StateCache) Size

func (c *StateCache) Size() int

func (*StateCache) Stats

func (c *StateCache) Stats() *CacheStats

func (*StateCache) Stop

func (c *StateCache) Stop()

type StateChangeEvent

type StateChangeEvent struct {
	Type string `json:"type"`

	IntentName types.NamespacedName `json:"intentName"`

	OldPhase interfaces.ProcessingPhase `json:"oldPhase,omitempty"`

	NewPhase interfaces.ProcessingPhase `json:"newPhase"`

	Version string `json:"version"`

	Timestamp time.Time `json:"timestamp"`

	ChangeReason string `json:"changeReason,omitempty"`

	Metadata json.RawMessage `json:"metadata,omitempty"`

	AffectedFields []string `json:"affectedFields,omitempty"`
}

type StateCondition

type StateCondition struct {
	Type string `json:"type"`

	Status string `json:"status"`

	LastTransitionTime time.Time `json:"lastTransitionTime"`

	Reason string `json:"reason,omitempty"`

	Message string `json:"message,omitempty"`

	Severity string `json:"severity,omitempty"`
}

type StateConflict

type StateConflict struct {
	IntentName types.NamespacedName `json:"intentName"`

	ConflictType string `json:"conflictType"`

	Field string `json:"field"`

	CachedValue interface{} `json:"cachedValue"`

	KubernetesValue interface{} `json:"kubernetesValue"`

	LastModified time.Time `json:"lastModified"`

	Severity string `json:"severity"` // "low", "medium", "high", "critical"

	Resolution string `json:"resolution,omitempty"`
}

type StateManager

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

func NewStateManager

func NewStateManager(client client.Client, recorder record.EventRecorder, logger logr.Logger, scheme *runtime.Scheme, eventBus EventBus) *StateManager

func (*StateManager) AddDependency

func (sm *StateManager) AddDependency(ctx context.Context, intentName, dependsOnIntent types.NamespacedName) error

func (*StateManager) CheckDependencies

func (sm *StateManager) CheckDependencies(ctx context.Context, namespacedName types.NamespacedName) (bool, []string, error)

func (*StateManager) GetIntentState

func (sm *StateManager) GetIntentState(ctx context.Context, namespacedName types.NamespacedName) (*IntentState, error)

func (*StateManager) GetPhaseData

func (sm *StateManager) GetPhaseData(ctx context.Context, namespacedName types.NamespacedName, phase interfaces.ProcessingPhase) (interface{}, error)

func (*StateManager) GetStatistics

func (sm *StateManager) GetStatistics() *StateStatistics

func (*StateManager) ListStates

func (sm *StateManager) ListStates(ctx context.Context, namespace string, labelSelector map[string]string) ([]*IntentState, error)

func (*StateManager) SetPhaseData

func (sm *StateManager) SetPhaseData(ctx context.Context, namespacedName types.NamespacedName, phase interfaces.ProcessingPhase, data interface{}) error

func (*StateManager) SetPhaseError

func (sm *StateManager) SetPhaseError(ctx context.Context, namespacedName types.NamespacedName, phase interfaces.ProcessingPhase, err error) error

func (*StateManager) Start

func (sm *StateManager) Start(ctx context.Context) error

func (*StateManager) Stop

func (sm *StateManager) Stop(ctx context.Context) error

func (*StateManager) TransitionPhase

func (sm *StateManager) TransitionPhase(ctx context.Context, namespacedName types.NamespacedName, newPhase interfaces.ProcessingPhase, metadata map[string]interface{}) error

func (*StateManager) UpdateIntentState

func (sm *StateManager) UpdateIntentState(ctx context.Context, namespacedName types.NamespacedName, updateFn func(*IntentState) error) error

type StateManagerAdapter

type StateManagerAdapter struct {
	*StateManager
}

func (*StateManagerAdapter) GetName

func (sma *StateManagerAdapter) GetName() string

func (*StateManagerAdapter) IsHealthy

func (sma *StateManagerAdapter) IsHealthy() bool

type StateManagerConfig

type StateManagerConfig struct {
	CacheSize int `json:"cacheSize"`

	CacheTTL time.Duration `json:"cacheTTL"`

	CacheCleanupInterval time.Duration `json:"cacheCleanupInterval"`

	LockTimeout time.Duration `json:"lockTimeout"`

	LockRetryInterval time.Duration `json:"lockRetryInterval"`

	MaxLockRetries int `json:"maxLockRetries"`

	SyncInterval time.Duration `json:"syncInterval"`

	StateValidationEnabled bool `json:"stateValidationEnabled"`

	ConflictResolutionMode string `json:"conflictResolutionMode"` // "latest", "merge", "manual"

	BatchStateUpdates bool `json:"batchStateUpdates"`

	BatchSize int `json:"batchSize"`

	BatchTimeout time.Duration `json:"batchTimeout"`
}

func DefaultStateManagerConfig

func DefaultStateManagerConfig() *StateManagerConfig

type StateManagerConfigValidator

type StateManagerConfigValidator struct{}

func (*StateManagerConfigValidator) GetConfigType

func (v *StateManagerConfigValidator) GetConfigType() string

func (*StateManagerConfigValidator) Validate

func (v *StateManagerConfigValidator) Validate(config interface{}) error

type StateMetrics

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

func NewStateMetrics

func NewStateMetrics() *StateMetrics

func (*StateMetrics) GetAverageUpdateTime

func (sm *StateMetrics) GetAverageUpdateTime() time.Duration

func (*StateMetrics) GetCacheHitRate

func (sm *StateMetrics) GetCacheHitRate() float64

func (*StateMetrics) GetLastSyncTime

func (sm *StateMetrics) GetLastSyncTime() time.Time

func (*StateMetrics) GetMetrics

func (sm *StateMetrics) GetMetrics() *StateMetricsSnapshot

func (*StateMetrics) GetRecentErrors

func (sm *StateMetrics) GetRecentErrors(count int) []MetricError

func (*StateMetrics) GetValidationErrors

func (sm *StateMetrics) GetValidationErrors() int64

func (*StateMetrics) RecordActiveLocks

func (sm *StateMetrics) RecordActiveLocks(count int)

func (*StateMetrics) RecordCPUUsage

func (sm *StateMetrics) RecordCPUUsage(percent float64)

func (*StateMetrics) RecordCacheCleanup

func (sm *StateMetrics) RecordCacheCleanup()

func (*StateMetrics) RecordCacheHit

func (sm *StateMetrics) RecordCacheHit()

func (*StateMetrics) RecordCacheMiss

func (sm *StateMetrics) RecordCacheMiss()

func (*StateMetrics) RecordCacheSize

func (sm *StateMetrics) RecordCacheSize(size int64)

func (*StateMetrics) RecordConflictResolution

func (sm *StateMetrics) RecordConflictResolution()

func (*StateMetrics) RecordDiskUsage

func (sm *StateMetrics) RecordDiskUsage(bytes int64)

func (*StateMetrics) RecordError

func (sm *StateMetrics) RecordError(operation, errorMsg, context, severity string)

func (*StateMetrics) RecordLockAcquisition

func (sm *StateMetrics) RecordLockAcquisition()

func (*StateMetrics) RecordLockRelease

func (sm *StateMetrics) RecordLockRelease()

func (*StateMetrics) RecordLockTimeout

func (sm *StateMetrics) RecordLockTimeout()

func (*StateMetrics) RecordMemoryUsage

func (sm *StateMetrics) RecordMemoryUsage(bytes int64)

func (*StateMetrics) RecordStateSync

func (sm *StateMetrics) RecordStateSync()

func (*StateMetrics) RecordStateSyncTime

func (sm *StateMetrics) RecordStateSyncTime(duration time.Duration)

func (*StateMetrics) RecordStateUpdate

func (sm *StateMetrics) RecordStateUpdate()

func (*StateMetrics) RecordStateUpdateTime

func (sm *StateMetrics) RecordStateUpdateTime(duration time.Duration)

func (*StateMetrics) RecordValidationError

func (sm *StateMetrics) RecordValidationError()

type StateMetricsSnapshot

type StateMetricsSnapshot struct {
	Timestamp time.Time `json:"timestamp"`

	CacheHits int64 `json:"cacheHits"`

	CacheMisses int64 `json:"cacheMisses"`

	CacheHitRate float64 `json:"cacheHitRate"`

	CacheSize int64 `json:"cacheSize"`

	CacheCleanups int64 `json:"cacheCleanups"`

	StateUpdates int64 `json:"stateUpdates"`

	StateSyncs int64 `json:"stateSyncs"`

	ValidationErrors int64 `json:"validationErrors"`

	ConflictResolutions int64 `json:"conflictResolutions"`

	ActiveLocks int64 `json:"activeLocks"`

	LockAcquisitions int64 `json:"lockAcquisitions"`

	LockReleases int64 `json:"lockReleases"`

	LockTimeouts int64 `json:"lockTimeouts"`

	AverageUpdateTime time.Duration `json:"averageUpdateTime"`

	LastSyncTime time.Time `json:"lastSyncTime"`

	Throughput float64 `json:"throughput"` // Operations per second

	LatencyP50 time.Duration `json:"latencyP50"`

	LatencyP95 time.Duration `json:"latencyP95"`

	LatencyP99 time.Duration `json:"latencyP99"`

	MemoryUsage int64 `json:"memoryUsage"`

	CPUUsage float64 `json:"cpuUsage"`

	DiskUsage int64 `json:"diskUsage"`

	RecentErrorCount int64 `json:"recentErrorCount"`
}

type StateMutex

type StateMutex struct {
	Name string `json:"name"`

	Owner string `json:"owner"`

	AcquiredAt time.Time `json:"acquiredAt"`

	ExpiresAt time.Time `json:"expiresAt"`

	Renewable bool `json:"renewable"`

	Metadata map[string]string `json:"metadata,omitempty"`
}

type StateQuery

type StateQuery struct {
	Namespace string `json:"namespace,omitempty"`

	Name string `json:"name,omitempty"`

	Phase interfaces.ProcessingPhase `json:"phase,omitempty"`

	Phases []interfaces.ProcessingPhase `json:"phases,omitempty"`

	Labels map[string]string `json:"labels,omitempty"`

	Tags []string `json:"tags,omitempty"`

	CreatedAfter *time.Time `json:"createdAfter,omitempty"`

	CreatedBefore *time.Time `json:"createdBefore,omitempty"`

	ModifiedAfter *time.Time `json:"modifiedAfter,omitempty"`

	ModifiedBefore *time.Time `json:"modifiedBefore,omitempty"`

	HasErrors *bool `json:"hasErrors,omitempty"`

	HasDependencies *bool `json:"hasDependencies,omitempty"`

	OrderBy string `json:"orderBy,omitempty"` // "name", "created", "modified", "phase"

	Order string `json:"order,omitempty"` // "asc", "desc"

	Limit int `json:"limit,omitempty"`

	Offset int `json:"offset,omitempty"`
}

type StateQueryResult

type StateQueryResult struct {
	States []*IntentState `json:"states"`

	TotalCount int `json:"totalCount"`

	FilteredCount int `json:"filteredCount"`

	ExecutionTime time.Duration `json:"executionTime"`

	HasMore bool `json:"hasMore"`

	NextOffset int `json:"nextOffset,omitempty"`
}

type StateRecoveryInfo

type StateRecoveryInfo struct {
	IntentName types.NamespacedName `json:"intentName"`

	LastKnownGoodVersion string `json:"lastKnownGoodVersion"`

	CorruptedVersion string `json:"corruptedVersion"`

	RecoveryStrategy string `json:"recoveryStrategy"`

	RecoveryTime time.Time `json:"recoveryTime"`

	DataLoss bool `json:"dataLoss"`

	RecoveredFields []string `json:"recoveredFields"`

	Notes string `json:"notes,omitempty"`
}

type StateSnapshot

type StateSnapshot struct {
	IntentName types.NamespacedName `json:"intentName"`

	Version string `json:"version"`

	SnapshotTime time.Time `json:"snapshotTime"`

	State *IntentState `json:"state"`

	Checksum string `json:"checksum"`

	CompressedSize int64 `json:"compressedSize"`

	Metadata map[string]string `json:"metadata,omitempty"`
}

type StateStatistics

type StateStatistics struct {
	TotalStates int `json:"totalStates"`

	StatesByPhase map[string]int `json:"statesByPhase"`

	CacheHitRate float64 `json:"cacheHitRate"`

	ActiveLocks int `json:"activeLocks"`

	AverageUpdateTime time.Duration `json:"averageUpdateTime"`

	StateValidationErrors int64 `json:"stateValidationErrors"`

	LastSyncTime time.Time `json:"lastSyncTime"`

	ConflictResolutions int64 `json:"conflictResolutions"`

	DependencyViolations int64 `json:"dependencyViolations"`
}

type StateSyncRequest

type StateSyncRequest struct {
	IntentName types.NamespacedName `json:"intentName"`

	RequestedBy string `json:"requestedBy"`

	SyncType string `json:"syncType"` // "full", "incremental", "validate"

	ForceSync bool `json:"forceSync"`

	Timestamp time.Time `json:"timestamp"`

	TargetVersion string `json:"targetVersion,omitempty"`
}

type StateSyncResponse

type StateSyncResponse struct {
	RequestID string `json:"requestId"`

	Success bool `json:"success"`

	ConflictsFound int `json:"conflictsFound"`

	ConflictsResolved int `json:"conflictsResolved"`

	UpdatesApplied int `json:"updatesApplied"`

	ErrorMessage string `json:"errorMessage,omitempty"`

	ProcessingTime time.Duration `json:"processingTime"`

	Metadata map[string]string `json:"metadata,omitempty"`
}

type StateValidationError

type StateValidationError struct {
	Field string `json:"field"`

	Value interface{} `json:"value"`

	Constraint string `json:"constraint"`

	Message string `json:"message"`

	Severity string `json:"severity"`

	Metadata json.RawMessage `json:"metadata,omitempty"`
}

type StateValidationResult

type StateValidationResult struct {
	Valid bool `json:"valid"`

	Errors []StateValidationError `json:"errors,omitempty"`

	Warnings []StateValidationWarning `json:"warnings,omitempty"`

	ValidationTime time.Duration `json:"validationTime"`

	ValidatedFields int `json:"validatedFields"`

	Version string `json:"version"`
}

type StateValidationWarning

type StateValidationWarning struct {
	Field string `json:"field"`

	Value interface{} `json:"value"`

	Message string `json:"message"`

	Suggestion string `json:"suggestion,omitempty"`

	Metadata json.RawMessage `json:"metadata,omitempty"`
}

type StreamingChunk

type StreamingChunk struct {
	ID        string          `json:"id"`
	Content   string          `json:"content"`
	Delta     string          `json:"delta"`
	Done      bool            `json:"done"`
	IsLast    bool            `json:"is_last"`
	Timestamp time.Time       `json:"timestamp"`
	Metadata  json.RawMessage `json:"metadata,omitempty"`
	Error     *LLMError       `json:"error,omitempty"`
}

StreamingChunk represents a chunk of streamed response

type SystemHealth

type SystemHealth struct {
	OverallStatus string `json:"overallStatus"`

	Healthy bool `json:"healthy"`

	Components map[string]*ComponentStatus `json:"components"`

	LastUpdate time.Time `json:"lastUpdate"`

	ActiveIntents int `json:"activeIntents"`

	ProcessingRate float64 `json:"processingRate"`

	ErrorRate float64 `json:"errorRate"`

	ResourceUsage ResourceUsage `json:"resourceUsage"`
}

type TaskFilter

type TaskFilter struct {
	IntentNamespace string `json:"intentNamespace,omitempty"`

	IntentName string `json:"intentName,omitempty"`

	Phase interfaces.ProcessingPhase `json:"phase,omitempty"`

	MinPriority *int `json:"minPriority,omitempty"`

	MaxPriority *int `json:"maxPriority,omitempty"`

	CreatedAfter *time.Time `json:"createdAfter,omitempty"`

	CreatedBefore *time.Time `json:"createdBefore,omitempty"`
}

type TaskHeap

type TaskHeap []*ExecutionTask

func (TaskHeap) Len

func (h TaskHeap) Len() int

func (TaskHeap) Less

func (h TaskHeap) Less(i, j int) bool

func (*TaskHeap) Pop

func (h *TaskHeap) Pop() interface{}

func (*TaskHeap) Push

func (h *TaskHeap) Push(x interface{})

func (TaskHeap) Swap

func (h TaskHeap) Swap(i, j int)

type TelecomDocument

type TelecomDocument struct {
	ID              string          `json:"id"`
	Title           string          `json:"title"`
	Content         string          `json:"content"`
	Type            DocumentType    `json:"type"`
	DocumentType    string          `json:"document_type"` // String representation of type
	Category        string          `json:"category"`
	Standard        string          `json:"standard"` // e.g., "3GPP TS 38.401"
	Version         string          `json:"version"`  // e.g., "16.0.0"
	Section         string          `json:"section"`  // e.g., "7.2.1"
	Keywords        []string        `json:"keywords"`
	Source          string          `json:"source"`           // Added for test compatibility
	NetworkFunction []string        `json:"network_function"` // Added for test compatibility
	Technology      []string        `json:"technology"`       // Added for test compatibility
	Confidence      float64         `json:"confidence"`       // Added for test compatibility
	Score           float64         `json:"score"`            // Added for test compatibility
	UseCase         string          `json:"use_case"`         // For compatibility
	Timestamp       time.Time       `json:"timestamp"`        // For compatibility
	Metadata        json.RawMessage `json:"metadata"`
	CreatedAt       time.Time       `json:"created_at"`
	UpdatedAt       time.Time       `json:"updated_at"`
	Indexed         bool            `json:"indexed"`
}

TelecomDocument represents a telecom-specific document

type ThroughputTracker

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

func NewThroughputTracker

func NewThroughputTracker(windowSize time.Duration) *ThroughputTracker

func (*ThroughputTracker) GetCurrentThroughput

func (tt *ThroughputTracker) GetCurrentThroughput() float64

func (*ThroughputTracker) RecordOperation

func (tt *ThroughputTracker) RecordOperation()

type TokenUsage

type TokenUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

TokenUsage represents token usage information

type VectorStoreInterface

type VectorStoreInterface interface {
	Store(ctx context.Context, id string, vector []float32, metadata map[string]interface{}) error
	Search(ctx context.Context, vector []float32, limit int, threshold float32) ([]SearchResult, error)
	Delete(ctx context.Context, id string) error
	Get(ctx context.Context, id string) (*SearchResult, error)
	HealthCheck(ctx context.Context) error
	Close() error
}

VectorStoreInterface defines the interface for vector storage

type WebhookInterface

type WebhookInterface interface {
	SetupWithManager(mgr manager.Manager) error

	GetPath() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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