Documentation
¶
Overview ¶
Package filesystem provides a Connector implementation for local filesystem directories. It watches for file changes and syncs document content.
Index ¶
- func ResolveWebURL(uri string, _ map[string]any) string
- type Connector
- func (c *Connector) Capabilities() driven.ConnectorCapabilities
- func (c *Connector) Close() error
- func (c *Connector) FullSync(ctx context.Context) (docs <-chan domain.RawDocument, errs <-chan error)
- func (c *Connector) GetAccountIdentifier(_ context.Context, _ string) (string, error)
- func (c *Connector) IncrementalSync(ctx context.Context, state domain.SyncState) (changes <-chan domain.RawDocumentChange, errs <-chan error)
- func (c *Connector) SourceID() string
- func (c *Connector) Type() string
- func (c *Connector) Validate(ctx context.Context) error
- func (c *Connector) Watch(ctx context.Context) (<-chan domain.RawDocumentChange, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector reads documents from the local filesystem.
func (*Connector) Capabilities ¶
func (c *Connector) Capabilities() driven.ConnectorCapabilities
Capabilities returns the connector's capabilities.
func (*Connector) FullSync ¶
func (c *Connector) FullSync(ctx context.Context) (docs <-chan domain.RawDocument, errs <-chan error)
FullSync performs a full synchronisation of all documents. It walks the entire directory tree and emits RawDocuments for each file.
func (*Connector) GetAccountIdentifier ¶
GetAccountIdentifier returns an empty string for filesystem connector. Filesystem is a local, no-auth connector so there is no account to identify.
func (*Connector) IncrementalSync ¶
func (c *Connector) IncrementalSync( ctx context.Context, state domain.SyncState, ) (changes <-chan domain.RawDocumentChange, errs <-chan error)
IncrementalSync syncs changes since the last sync state. The cursor is a Unix timestamp in nanoseconds representing the last sync time. Only files modified after this time are included.