Documentation
¶
Index ¶
- Constants
- Variables
- type AdapterContextBridge
- func (b *AdapterContextBridge) ExecuteToolAction(ctx context.Context, contextID string, tool string, action string, ...) (interface{}, error)
- func (b *AdapterContextBridge) GetToolData(ctx context.Context, contextID string, tool string, query interface{}) (interface{}, error)
- func (b *AdapterContextBridge) HandleToolWebhook(ctx context.Context, tool string, eventType string, payload []byte) error
- type ContextManager
- func (cm *ContextManager) CreateContext(ctx context.Context, contextData *models.Context) (*models.Context, error)
- func (cm *ContextManager) DeleteContext(ctx context.Context, contextID string) error
- func (cm *ContextManager) GetContext(ctx context.Context, contextID string) (*models.Context, error)
- func (cm *ContextManager) ListContexts(ctx context.Context, agentID string, sessionID string, ...) ([]*models.Context, error)
- func (cm *ContextManager) SearchInContext(ctx context.Context, contextID string, query string) ([]models.ContextItem, error)
- func (cm *ContextManager) Subscribe(eventType string, handler func(models.Event))
- func (cm *ContextManager) SummarizeContext(ctx context.Context, contextID string) (string, error)
- func (cm *ContextManager) UpdateContext(ctx context.Context, contextID string, updateData *models.Context, ...) (*models.Context, error)
- type DatabaseAdapter
- func (a *DatabaseAdapter) DeleteGitHubContent(ctx context.Context, owner, repo, contentType, contentID string) error
- func (a *DatabaseAdapter) GetDB() *sqlx.DB
- func (a *DatabaseAdapter) GetGitHubContent(ctx context.Context, owner, repo, contentType, contentID string) (*storage.ContentMetadata, error)
- func (a *DatabaseAdapter) GetGitHubContentByChecksum(ctx context.Context, checksum string) (*storage.ContentMetadata, error)
- func (a *DatabaseAdapter) ListGitHubContent(ctx context.Context, owner, repo, contentType string, limit int) ([]*storage.ContentMetadata, error)
- func (a *DatabaseAdapter) StoreGitHubContent(ctx context.Context, metadata *storage.ContentMetadata) error
- type EmbeddingManager
- func (m *EmbeddingManager) CreateEmbeddingFromContent(ctx context.Context, content string, contentType string, contentID string) error
- func (m *EmbeddingManager) CreateEmbeddingsFromCodeFile(ctx context.Context, owner string, repo string, path string, content []byte) error
- func (m *EmbeddingManager) CreateEmbeddingsFromDiscussion(ctx context.Context, owner string, repo string, discussionID string) error
- func (m *EmbeddingManager) CreateEmbeddingsFromDiscussions(ctx context.Context, owner string, repo string, discussionIDs []string) error
- func (m *EmbeddingManager) CreateEmbeddingsFromIssue(ctx context.Context, owner string, repo string, issueNumber int) error
- func (m *EmbeddingManager) CreateEmbeddingsFromIssues(ctx context.Context, owner string, repo string, issueNumbers []int) error
- func (m *EmbeddingManager) ProcessRepository(ctx context.Context, owner string, repo string) error
- func (m *EmbeddingManager) SearchSimilarContent(ctx context.Context, text string, modelType EmbeddingModelType, ...) ([]map[string]interface{}, error)
- type EmbeddingModelType
- type EmbeddingPipeline
- type EmbeddingService
- type EmbeddingStorage
- type EmbeddingVector
- type Engine
- func (e *Engine) Close()
- func (e *Engine) ExecuteAdapterAction(ctx context.Context, contextID string, adapterType string, action string, ...) (interface{}, error)
- func (e *Engine) GetAdapter(adapterType string) (interface{}, error)
- func (e *Engine) GetContextManager() *contextManager.Manager
- func (e *Engine) GetGitHubContentManager() *GitHubContentManager
- func (e *Engine) HandleAdapterWebhook(ctx context.Context, adapterType string, eventType string, payload []byte) error
- func (e *Engine) Health() map[string]string
- func (e *Engine) RecordWebhookInContext(ctx context.Context, agentID string, adapterType string, eventType string, ...) (string, error)
- func (e *Engine) Shutdown(ctx context.Context) error
- type FallbackService
- type GitHubContentManager
- func (m *GitHubContentManager) DeleteContent(ctx context.Context, owner string, repo string, ...) error
- func (m *GitHubContentManager) GetContent(ctx context.Context, owner string, repo string, ...) ([]byte, *storage.ContentMetadata, error)
- func (m *GitHubContentManager) GetContentByChecksum(ctx context.Context, checksum string) ([]byte, *storage.ContentMetadata, error)
- func (m *GitHubContentManager) ListContent(ctx context.Context, owner string, repo string, ...) ([]*storage.ContentMetadata, error)
- func (m *GitHubContentManager) StoreContent(ctx context.Context, owner string, repo string, ...) (*storage.ContentMetadata, error)
- type GitHubRelationshipManager
- type MockCache
- func (m *MockCache) Close() error
- func (m *MockCache) Delete(ctx context.Context, key string) error
- func (m *MockCache) Exists(ctx context.Context, key string) (bool, error)
- func (m *MockCache) Flush(ctx context.Context) error
- func (m *MockCache) Get(ctx context.Context, key string, value interface{}) error
- func (m *MockCache) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
- type MockDB
- func (m *MockDB) CreateContext(ctx context.Context, contextData *models.Context) error
- func (m *MockDB) DeleteContext(ctx context.Context, contextID string) error
- func (m *MockDB) GetContext(ctx context.Context, contextID string) (*models.Context, error)
- func (m *MockDB) GetDB() interface{}
- func (m *MockDB) ListContexts(ctx context.Context, agentID, sessionID string, options map[string]interface{}) ([]*models.Context, error)
- func (m *MockDB) UpdateContext(ctx context.Context, contextData *models.Context) error
- type MockMetricsClient
- func (m *MockMetricsClient) Close() error
- func (m *MockMetricsClient) RecordCacheOperation(operation string, success bool, durationSeconds float64)
- func (m *MockMetricsClient) RecordCounter(name string, value float64, labels map[string]string)
- func (m *MockMetricsClient) RecordGauge(name string, value float64, labels map[string]string)
- func (m *MockMetricsClient) RecordHistogram(name string, value float64, labels map[string]string)
- func (m *MockMetricsClient) RecordOperation(component string, operation string, success bool, durationSeconds float64, ...)
- func (m *MockMetricsClient) RecordTimer(name string, duration time.Duration, labels map[string]string)
- func (m *MockMetricsClient) StartTimer(name string, labels map[string]string) func()
- type MockSystemEventBus
- type SystemEventBus
- func (b *SystemEventBus) Publish(ctx context.Context, event system.Event) error
- func (b *SystemEventBus) Subscribe(eventType system.EventType, handler func(context.Context, system.Event) error)
- func (b *SystemEventBus) Unsubscribe(eventType system.EventType, handler func(context.Context, system.Event) error)
- type TestMockEngine
- type TruncateStrategy
Constants ¶
const ( // TruncateOldestFirst truncates the oldest items first TruncateOldestFirst = "oldest_first" // TruncatePreservingUser truncates by removing assistant responses while preserving user messages TruncatePreservingUser = "preserving_user" // TruncateRelevanceBased truncates based on relevance to the current conversation TruncateRelevanceBased = "relevance_based" )
Constants for truncation strategies
const ( // ModelTypeOpenAI represents OpenAI embedding models ModelTypeOpenAI EmbeddingModelType = "openai" // ModelTypeHuggingFace represents HuggingFace embedding models ModelTypeHuggingFace EmbeddingModelType = "huggingface" // ModelTypeCustom represents custom embedding models ModelTypeCustom EmbeddingModelType = "custom" // Content types for embedding generation ContentTypeCodeChunk = "code_chunk" ContentTypeIssue = "issue" ContentTypeComment = "comment" ContentTypeDiscussion = "discussion" )
Variables ¶
var ErrContextNotFound = errors.New("context not found")
ErrContextNotFound is returned when a context is not found
Functions ¶
This section is empty.
Types ¶
type AdapterContextBridge ¶
type AdapterContextBridge struct {
// contains filtered or unexported fields
}
AdapterContextBridge connects adapters with the context manager for managing context-aware tool interactions
func NewAdapterContextBridge ¶
func NewAdapterContextBridge(contextManager interfaces.ContextManager, adapters map[string]interfaces.Adapter) *AdapterContextBridge
NewAdapterContextBridge creates a new adapter-context bridge
func (*AdapterContextBridge) ExecuteToolAction ¶
func (b *AdapterContextBridge) ExecuteToolAction(ctx context.Context, contextID string, tool string, action string, params map[string]interface{}) (interface{}, error)
ExecuteToolAction executes a tool action with context awareness
func (*AdapterContextBridge) GetToolData ¶
func (b *AdapterContextBridge) GetToolData(ctx context.Context, contextID string, tool string, query interface{}) (interface{}, error)
GetToolData gets data from a tool with context awareness
func (*AdapterContextBridge) HandleToolWebhook ¶
func (b *AdapterContextBridge) HandleToolWebhook(ctx context.Context, tool string, eventType string, payload []byte) error
HandleToolWebhook handles a webhook from a tool
type ContextManager ¶
type ContextManager struct {
// contains filtered or unexported fields
}
ContextManager is a wrapper around the internal context manager This allows us to test core functionality without directly exposing internal implementations
func NewContextManager ¶
func NewContextManager(db interface{}, cache cache.Cache) *ContextManager
NewContextManager creates a new context manager
func (*ContextManager) CreateContext ¶
func (cm *ContextManager) CreateContext(ctx context.Context, contextData *models.Context) (*models.Context, error)
CreateContext creates a new context
func (*ContextManager) DeleteContext ¶
func (cm *ContextManager) DeleteContext(ctx context.Context, contextID string) error
DeleteContext deletes a context
func (*ContextManager) GetContext ¶
func (cm *ContextManager) GetContext(ctx context.Context, contextID string) (*models.Context, error)
GetContext retrieves a context by ID
func (*ContextManager) ListContexts ¶
func (cm *ContextManager) ListContexts(ctx context.Context, agentID string, sessionID string, options map[string]interface{}) ([]*models.Context, error)
ListContexts lists contexts for an agent
func (*ContextManager) SearchInContext ¶
func (cm *ContextManager) SearchInContext(ctx context.Context, contextID string, query string) ([]models.ContextItem, error)
SearchInContext searches for text within a context
func (*ContextManager) Subscribe ¶
func (cm *ContextManager) Subscribe(eventType string, handler func(models.Event))
Subscribe subscribes to context events
func (*ContextManager) SummarizeContext ¶
SummarizeContext generates a summary of a context
func (*ContextManager) UpdateContext ¶
func (cm *ContextManager) UpdateContext(ctx context.Context, contextID string, updateData *models.Context, options *models.ContextUpdateOptions) (*models.Context, error)
UpdateContext updates an existing context
type DatabaseAdapter ¶
type DatabaseAdapter struct {
// contains filtered or unexported fields
}
DatabaseAdapter provides compatibility between internal/database and pkg/database This adapter allows us to migrate code incrementally without breaking existing functionality
func NewDatabaseAdapter ¶
func NewDatabaseAdapter(db *sqlx.DB, logger observability.Logger) (*DatabaseAdapter, error)
NewDatabaseAdapter creates a new adapter that wraps a pkg/database.Database instance but exposes it with the same interface as internal/database.Database
func (*DatabaseAdapter) DeleteGitHubContent ¶
func (a *DatabaseAdapter) DeleteGitHubContent(ctx context.Context, owner, repo, contentType, contentID string) error
DeleteGitHubContent deletes GitHub content metadata from the database
func (*DatabaseAdapter) GetDB ¶
func (a *DatabaseAdapter) GetDB() *sqlx.DB
GetDB returns the underlying sqlx.DB instance
func (*DatabaseAdapter) GetGitHubContent ¶
func (a *DatabaseAdapter) GetGitHubContent(ctx context.Context, owner, repo, contentType, contentID string) (*storage.ContentMetadata, error)
GetGitHubContent retrieves GitHub content metadata from the database
func (*DatabaseAdapter) GetGitHubContentByChecksum ¶
func (a *DatabaseAdapter) GetGitHubContentByChecksum(ctx context.Context, checksum string) (*storage.ContentMetadata, error)
GetGitHubContentByChecksum retrieves GitHub content metadata by checksum
func (*DatabaseAdapter) ListGitHubContent ¶
func (a *DatabaseAdapter) ListGitHubContent(ctx context.Context, owner, repo, contentType string, limit int) ([]*storage.ContentMetadata, error)
ListGitHubContent lists GitHub content metadata from the database
func (*DatabaseAdapter) StoreGitHubContent ¶
func (a *DatabaseAdapter) StoreGitHubContent(ctx context.Context, metadata *storage.ContentMetadata) error
StoreGitHubContent stores GitHub content metadata in the database This method adapts the pkg/database implementation to match the internal/database interface
type EmbeddingManager ¶
type EmbeddingManager struct {
// contains filtered or unexported fields
}
EmbeddingManager manages the embedding pipeline
func NewEmbeddingManager ¶
func NewEmbeddingManager(db *sql.DB, chunkingService *chunking.ChunkingService, pipeline EmbeddingPipeline) (*EmbeddingManager, error)
NewEmbeddingManager creates a new embedding manager
func (*EmbeddingManager) CreateEmbeddingFromContent ¶
func (m *EmbeddingManager) CreateEmbeddingFromContent(ctx context.Context, content string, contentType string, contentID string) error
CreateEmbeddingFromContent generates and stores an embedding for a content string
func (*EmbeddingManager) CreateEmbeddingsFromCodeFile ¶
func (m *EmbeddingManager) CreateEmbeddingsFromCodeFile(ctx context.Context, owner string, repo string, path string, content []byte) error
CreateEmbeddingsFromCodeFile processes a code file to generate and store embeddings
func (*EmbeddingManager) CreateEmbeddingsFromDiscussion ¶
func (m *EmbeddingManager) CreateEmbeddingsFromDiscussion(ctx context.Context, owner string, repo string, discussionID string) error
CreateEmbeddingsFromDiscussion processes a GitHub discussion to generate and store embeddings
func (*EmbeddingManager) CreateEmbeddingsFromDiscussions ¶
func (m *EmbeddingManager) CreateEmbeddingsFromDiscussions(ctx context.Context, owner string, repo string, discussionIDs []string) error
CreateEmbeddingsFromDiscussions processes multiple GitHub discussions to generate and store embeddings
func (*EmbeddingManager) CreateEmbeddingsFromIssue ¶
func (m *EmbeddingManager) CreateEmbeddingsFromIssue(ctx context.Context, owner string, repo string, issueNumber int) error
CreateEmbeddingsFromIssue processes a GitHub issue to generate and store embeddings
func (*EmbeddingManager) CreateEmbeddingsFromIssues ¶
func (m *EmbeddingManager) CreateEmbeddingsFromIssues(ctx context.Context, owner string, repo string, issueNumbers []int) error
CreateEmbeddingsFromIssues processes multiple GitHub issues to generate and store embeddings
func (*EmbeddingManager) ProcessRepository ¶
ProcessRepository processes an entire repository to generate and store embeddings
func (*EmbeddingManager) SearchSimilarContent ¶
func (m *EmbeddingManager) SearchSimilarContent( ctx context.Context, text string, modelType EmbeddingModelType, modelName string, limit int, threshold float32, ) ([]map[string]interface{}, error)
SearchSimilarContent searches for content similar to the provided text
type EmbeddingModelType ¶
type EmbeddingModelType string
EmbeddingModelType represents the type of embedding model
type EmbeddingPipeline ¶
type EmbeddingPipeline interface {
// ProcessContent processes content to generate and store embeddings
ProcessContent(ctx context.Context, content string, contentType string, contentID string) error
// BatchProcessContent processes multiple content items in a batch
BatchProcessContent(ctx context.Context, contents []string, contentType string, contentIDs []string) error
// ProcessCodeChunks processes code chunks to generate and store embeddings
ProcessCodeChunks(ctx context.Context, contentType string, contentID string, chunkIDs []string) error
// ProcessIssues processes GitHub issues to generate and store embeddings
ProcessIssues(ctx context.Context, ownerRepo string, issueNumbers []int) error
// ProcessDiscussions processes GitHub discussions to generate and store embeddings
ProcessDiscussions(ctx context.Context, ownerRepo string, discussionIDs []string) error
}
EmbeddingPipeline coordinates the embedding generation and storage process
type EmbeddingService ¶
type EmbeddingService interface {
// GenerateEmbedding creates an embedding for a single text
GenerateEmbedding(ctx context.Context, text string, contentType string, contentID string) (*EmbeddingVector, error)
// BatchGenerateEmbeddings creates embeddings for multiple texts
BatchGenerateEmbeddings(ctx context.Context, texts []string, contentType string, contentIDs []string) ([]*EmbeddingVector, error)
}
EmbeddingService defines the interface for generating embeddings
type EmbeddingStorage ¶
type EmbeddingStorage interface {
// StoreEmbedding stores a single embedding
StoreEmbedding(ctx context.Context, embedding *EmbeddingVector) error
// BatchStoreEmbeddings stores multiple embeddings in a batch
BatchStoreEmbeddings(ctx context.Context, embeddings []*EmbeddingVector) error
// FindSimilarEmbeddings finds embeddings similar to the provided one
FindSimilarEmbeddings(ctx context.Context, embedding *EmbeddingVector, limit int, threshold float32) ([]*EmbeddingVector, error)
}
EmbeddingStorage defines the interface for storing and retrieving embeddings
type EmbeddingVector ¶
type EmbeddingVector struct {
// The actual embedding vector values
Vector []float32 `json:"vector"`
// Dimensions of the vector
Dimensions int `json:"dimensions"`
// Model ID used to generate this embedding
ModelID string `json:"model_id"`
// ContentType indicates what type of content this is an embedding for
ContentType string `json:"content_type"`
// ContentID is a unique identifier for the content
ContentID string `json:"content_id"`
// Metadata about the embedding and content
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
EmbeddingVector represents a vector embedding with metadata
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the core engine of the MCP server
func NewEngine ¶
func NewEngine( ctx context.Context, config interface{}, db *database.Database, cacheClient cache.Cache, metricsClient observability.MetricsClient, ) (*Engine, error)
NewEngine creates a new engine
func (*Engine) ExecuteAdapterAction ¶
func (e *Engine) ExecuteAdapterAction(ctx context.Context, contextID string, adapterType string, action string, params map[string]interface{}) (interface{}, error)
ExecuteAdapterAction executes an action using the appropriate adapter
func (*Engine) GetAdapter ¶
GetAdapter gets an adapter by type
func (*Engine) GetContextManager ¶
func (e *Engine) GetContextManager() *contextManager.Manager
GetContextManager returns the context manager
func (*Engine) GetGitHubContentManager ¶
func (e *Engine) GetGitHubContentManager() *GitHubContentManager
GetGitHubContentManager returns the GitHub content manager
func (*Engine) HandleAdapterWebhook ¶
func (e *Engine) HandleAdapterWebhook(ctx context.Context, adapterType string, eventType string, payload []byte) error
HandleAdapterWebhook handles a webhook event using the appropriate adapter
type FallbackService ¶
type FallbackService struct {
// contains filtered or unexported fields
}
FallbackService provides degraded service when primary services fail
func NewFallbackService ¶
func NewFallbackService() *FallbackService
NewFallbackService creates a new fallback service
func (*FallbackService) EmergencyHealthCheck ¶
func (s *FallbackService) EmergencyHealthCheck() map[string]string
EmergencyHealthCheck provides a minimal health check
func (*FallbackService) GenerateEmergencyID ¶
func (s *FallbackService) GenerateEmergencyID() string
GenerateEmergencyID generates a unique ID for emergency use
func (*FallbackService) LogEmergencyEvent ¶
func (s *FallbackService) LogEmergencyEvent(ctx context.Context, eventType, details string) error
LogEmergencyEvent logs an emergency event
type GitHubContentManager ¶
type GitHubContentManager struct {
// contains filtered or unexported fields
}
GitHubContentManager manages GitHub content storage and retrieval
func NewGitHubContentManager ¶
func NewGitHubContentManager( db *database.Database, s3Client *storage.S3Client, metricsClient observability.MetricsClient, relationshipService relationship.Service, ) (*GitHubContentManager, error)
NewGitHubContentManager creates a new GitHub content manager
func (*GitHubContentManager) DeleteContent ¶
func (m *GitHubContentManager) DeleteContent( ctx context.Context, owner string, repo string, contentType storage.ContentType, contentID string, ) error
DeleteContent deletes GitHub content
func (*GitHubContentManager) GetContent ¶
func (m *GitHubContentManager) GetContent( ctx context.Context, owner string, repo string, contentType storage.ContentType, contentID string, ) ([]byte, *storage.ContentMetadata, error)
GetContent retrieves GitHub content by owner, repo, type, and ID
func (*GitHubContentManager) GetContentByChecksum ¶
func (m *GitHubContentManager) GetContentByChecksum( ctx context.Context, checksum string, ) ([]byte, *storage.ContentMetadata, error)
GetContentByChecksum retrieves GitHub content by its checksum
func (*GitHubContentManager) ListContent ¶
func (m *GitHubContentManager) ListContent( ctx context.Context, owner string, repo string, contentType storage.ContentType, limit int, ) ([]*storage.ContentMetadata, error)
ListContent lists GitHub content for a repository
func (*GitHubContentManager) StoreContent ¶
func (m *GitHubContentManager) StoreContent( ctx context.Context, owner string, repo string, contentType storage.ContentType, contentID string, data []byte, metadata map[string]interface{}, ) (*storage.ContentMetadata, error)
StoreContent stores GitHub content in S3 and indexes it in the database
type GitHubRelationshipManager ¶
type GitHubRelationshipManager struct {
// contains filtered or unexported fields
}
GitHubRelationshipManager manages relationships between GitHub entities
func NewGitHubRelationshipManager ¶
func NewGitHubRelationshipManager(relationshipService relationship.Service, contentManager *GitHubContentManager) *GitHubRelationshipManager
NewGitHubRelationshipManager creates a new relationship manager for GitHub content
func (*GitHubRelationshipManager) ProcessContentRelationships ¶
func (m *GitHubRelationshipManager) ProcessContentRelationships( ctx context.Context, metadata *storage.ContentMetadata, content []byte, ) error
ProcessContentRelationships processes relationships for stored content
type MockCache ¶
MockCache is a mock implementation of the cache.Cache for testing
type MockDB ¶
MockDB is a mock implementation for database operations in tests
func (*MockDB) CreateContext ¶
CreateContext mocks creating a context in the database
func (*MockDB) DeleteContext ¶
DeleteContext mocks deleting a context from the database
func (*MockDB) GetContext ¶
GetContext mocks retrieving a context from the database
func (*MockDB) GetDB ¶
func (m *MockDB) GetDB() interface{}
GetDB mocks getting the underlying database connection
type MockMetricsClient ¶
type MockMetricsClient struct{}
MockMetricsClient is a mock implementation of observability.MetricsClient
func (*MockMetricsClient) Close ¶
func (m *MockMetricsClient) Close() error
Close is a no-op implementation
func (*MockMetricsClient) RecordCacheOperation ¶
func (m *MockMetricsClient) RecordCacheOperation(operation string, success bool, durationSeconds float64)
RecordCacheOperation is a no-op implementation
func (*MockMetricsClient) RecordCounter ¶
func (m *MockMetricsClient) RecordCounter(name string, value float64, labels map[string]string)
RecordCounter is a no-op implementation
func (*MockMetricsClient) RecordGauge ¶
func (m *MockMetricsClient) RecordGauge(name string, value float64, labels map[string]string)
RecordGauge is a no-op implementation
func (*MockMetricsClient) RecordHistogram ¶
func (m *MockMetricsClient) RecordHistogram(name string, value float64, labels map[string]string)
RecordHistogram is a no-op implementation
func (*MockMetricsClient) RecordOperation ¶
func (m *MockMetricsClient) RecordOperation(component string, operation string, success bool, durationSeconds float64, labels map[string]string)
RecordOperation is a no-op implementation
func (*MockMetricsClient) RecordTimer ¶
func (m *MockMetricsClient) RecordTimer(name string, duration time.Duration, labels map[string]string)
RecordTimer is a no-op implementation
func (*MockMetricsClient) StartTimer ¶
func (m *MockMetricsClient) StartTimer(name string, labels map[string]string) func()
StartTimer is a no-op implementation
type MockSystemEventBus ¶
type MockSystemEventBus struct{}
MockSystemEventBus is a mock implementation of system.EventBus
func (*MockSystemEventBus) Subscribe ¶
func (b *MockSystemEventBus) Subscribe(eventType system.EventType, handler func(ctx context.Context, event system.Event) error)
Subscribe is a no-op implementation
func (*MockSystemEventBus) Unsubscribe ¶
func (b *MockSystemEventBus) Unsubscribe(eventType system.EventType, handler func(ctx context.Context, event system.Event) error)
Unsubscribe is a no-op implementation
type SystemEventBus ¶
type SystemEventBus struct {
// contains filtered or unexported fields
}
SystemEventBus implements the system.EventBus interface
func NewSystemEventBus ¶
func NewSystemEventBus() *SystemEventBus
NewSystemEventBus creates a new system event bus
func (*SystemEventBus) Subscribe ¶
func (b *SystemEventBus) Subscribe(eventType system.EventType, handler func(context.Context, system.Event) error)
Subscribe subscribes to events of a specific type
func (*SystemEventBus) Unsubscribe ¶
func (b *SystemEventBus) Unsubscribe(eventType system.EventType, handler func(context.Context, system.Event) error)
Unsubscribe unsubscribes from events of a specific type
type TestMockEngine ¶
type TestMockEngine struct {
ContextManager interface{} // Added to satisfy tests
// contains filtered or unexported fields
}
TestMockEngine is a mock implementation of the Engine for testing
func NewTestMockEngine ¶
func NewTestMockEngine() *TestMockEngine
NewTestMockEngine creates a new mock engine for testing
func (*TestMockEngine) GetAdapter ¶
func (m *TestMockEngine) GetAdapter(name string) (interface{}, error)
GetAdapter returns an adapter by name
func (*TestMockEngine) Health ¶
func (m *TestMockEngine) Health() map[string]string
Health returns a map of component health statuses
func (*TestMockEngine) ProcessEvent ¶
func (m *TestMockEngine) ProcessEvent(event interface{}) error
ProcessEvent processes an event
func (*TestMockEngine) RegisterAdapter ¶
func (m *TestMockEngine) RegisterAdapter(name string, adapter interface{})
RegisterAdapter registers an adapter with the mock engine
type TruncateStrategy ¶
type TruncateStrategy string
TruncateStrategy defines the strategy for truncating a context