Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RewriteLinks ¶
RewriteLinks converts absolute URLs pointing to the same domain into relative local paths. External links are preserved as-is.
Types ¶
type FilterFunc ¶
FilterFunc returns true if a path should be included in the sync.
func BuildFilter ¶
func BuildFilter(include, exclude []string) FilterFunc
BuildFilter creates a FilterFunc from include/exclude glob patterns. If include is empty, all paths match. Exclude takes precedence. Supports ** for recursive directory matching (e.g. "/docs/**/*.md").
type Mirror ¶
Mirror downloads discovered content and writes it to the store.
func (*Mirror) Sync ¶
func (m *Mirror) Sync(ctx context.Context, result *discovery.Result, filter FilterFunc) (*SyncResult, error)
Sync downloads all files from a discovery result and writes them to the store. If filter is non-nil, only paths that pass the filter are downloaded.
type SyncResult ¶
type SyncResult struct {
Domain string `json:"domain"`
Added []string `json:"added,omitempty"`
Updated []string `json:"updated,omitempty"`
Unchanged []string `json:"unchanged,omitempty"`
Skipped []string `json:"skipped,omitempty"`
Errors []string `json:"errors,omitempty"`
}
SyncResult tracks what happened during a sync.
type Syncer ¶
type Syncer interface {
Sync(ctx context.Context, result *discovery.Result, filter FilterFunc) (*SyncResult, error)
}
Syncer downloads discovered content and writes it to the local store. The default implementation fetches via HTTP, converts HTML to markdown, rewrites links, and compares content for change detection. Alternative implementations can add content cleaning, chunking, or custom pipelines.