Documentation
¶
Overview ¶
Package memory provides in-memory implementations of driven ports. These adapters are used for testing and development.
Index ¶
- type ConfigStore
- func (s *ConfigStore) Get(key string) (any, bool)
- func (s *ConfigStore) GetBool(key string) bool
- func (s *ConfigStore) GetInt(key string) int
- func (s *ConfigStore) GetString(key string) string
- func (s *ConfigStore) GetStringSlice(key string) []string
- func (s *ConfigStore) Load() error
- func (s *ConfigStore) Path() string
- func (s *ConfigStore) Save() error
- func (s *ConfigStore) Set(key string, value any) error
- type DocumentStore
- func (s *DocumentStore) DeleteDocument(_ context.Context, id string) error
- func (s *DocumentStore) GetChunk(_ context.Context, id string) (*domain.Chunk, error)
- func (s *DocumentStore) GetChunks(_ context.Context, documentID string) ([]domain.Chunk, error)
- func (s *DocumentStore) GetDocument(_ context.Context, id string) (*domain.Document, error)
- func (s *DocumentStore) ListDocuments(_ context.Context, sourceID string) ([]domain.Document, error)
- func (s *DocumentStore) SaveChunks(_ context.Context, chunks []domain.Chunk) error
- func (s *DocumentStore) SaveDocument(_ context.Context, doc *domain.Document) error
- type ExclusionStore
- func (s *ExclusionStore) Add(_ context.Context, exclusion *domain.Exclusion) error
- func (s *ExclusionStore) GetBySourceID(_ context.Context, sourceID string) ([]domain.Exclusion, error)
- func (s *ExclusionStore) IsExcluded(_ context.Context, sourceID, uri string) (bool, error)
- func (s *ExclusionStore) List(_ context.Context) ([]domain.Exclusion, error)
- func (s *ExclusionStore) Remove(_ context.Context, id string) error
- type SourceStore
- type SyncStateStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigStore ¶
type ConfigStore struct {
// contains filtered or unexported fields
}
ConfigStore is an in-memory implementation of driven.ConfigStore for testing.
func NewConfigStore ¶
func NewConfigStore() *ConfigStore
NewConfigStore creates a new in-memory config store.
func (*ConfigStore) Get ¶
func (s *ConfigStore) Get(key string) (any, bool)
Get retrieves a configuration value by key.
func (*ConfigStore) GetBool ¶
func (s *ConfigStore) GetBool(key string) bool
GetBool retrieves a boolean configuration value.
func (*ConfigStore) GetInt ¶
func (s *ConfigStore) GetInt(key string) int
GetInt retrieves an integer configuration value.
func (*ConfigStore) GetString ¶
func (s *ConfigStore) GetString(key string) string
GetString retrieves a string configuration value.
func (*ConfigStore) GetStringSlice ¶
func (s *ConfigStore) GetStringSlice(key string) []string
GetStringSlice retrieves a string slice configuration value.
func (*ConfigStore) Load ¶
func (s *ConfigStore) Load() error
Load reads configuration from storage (no-op for memory store).
func (*ConfigStore) Path ¶
func (s *ConfigStore) Path() string
Path returns the configuration file path.
func (*ConfigStore) Save ¶
func (s *ConfigStore) Save() error
Save persists the current configuration (no-op for memory store).
type DocumentStore ¶
type DocumentStore struct {
// contains filtered or unexported fields
}
DocumentStore is an in-memory implementation of driven.DocumentStore.
func NewDocumentStore ¶
func NewDocumentStore() *DocumentStore
NewDocumentStore creates a new in-memory document store.
func (*DocumentStore) DeleteDocument ¶
func (s *DocumentStore) DeleteDocument(_ context.Context, id string) error
DeleteDocument removes a document and its chunks.
func (*DocumentStore) GetDocument ¶
GetDocument retrieves a document by ID.
func (*DocumentStore) ListDocuments ¶
func (s *DocumentStore) ListDocuments(_ context.Context, sourceID string) ([]domain.Document, error)
ListDocuments returns documents for a source.
func (*DocumentStore) SaveChunks ¶
SaveChunks stores chunks for a document.
func (*DocumentStore) SaveDocument ¶
SaveDocument stores or updates a document.
type ExclusionStore ¶
type ExclusionStore struct {
// contains filtered or unexported fields
}
ExclusionStore is an in-memory implementation of driven.ExclusionStore.
func NewExclusionStore ¶
func NewExclusionStore() *ExclusionStore
NewExclusionStore creates a new in-memory exclusion store.
func (*ExclusionStore) GetBySourceID ¶
func (s *ExclusionStore) GetBySourceID(_ context.Context, sourceID string) ([]domain.Exclusion, error)
GetBySourceID returns all exclusions for a source.
func (*ExclusionStore) IsExcluded ¶
IsExcluded checks if a URI is excluded for a source.
type SourceStore ¶
type SourceStore struct {
// contains filtered or unexported fields
}
SourceStore is an in-memory implementation of driven.SourceStore.
func NewSourceStore ¶
func NewSourceStore() *SourceStore
NewSourceStore creates a new in-memory source store.
func (*SourceStore) Delete ¶
func (s *SourceStore) Delete(_ context.Context, id string) error
Delete removes a source.
type SyncStateStore ¶
type SyncStateStore struct {
// contains filtered or unexported fields
}
SyncStateStore is an in-memory implementation of driven.SyncStateStore.
func NewSyncStateStore ¶
func NewSyncStateStore() *SyncStateStore
NewSyncStateStore creates a new in-memory sync state store.
func (*SyncStateStore) Delete ¶
func (s *SyncStateStore) Delete(_ context.Context, sourceID string) error
Delete removes sync state for a source.