docsync

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreRelPath      = ".raven/docs"
	ManifestFilename  = "manifest.json"
	DocsIndexFilename = "index.yaml"
	DefaultSourceBase = "https://codeload.github.com/aidanlsb/raven/tar.gz"
	DefaultSourceRef  = "main"
)

Variables

View Source
var ErrDocsNotFetched = errors.New("docs are not fetched for this vault")

Functions

func DocsPath

func DocsPath(vaultPath string) string

DocsPath returns the absolute docs cache path for a vault.

func OpenFS

func OpenFS(vaultPath string) (fs.FS, error)

OpenFS opens the vault-local docs cache for read operations.

Types

type FetchOptions

type FetchOptions struct {
	VaultPath     string
	SourceBaseURL string
	Ref           string
	CLIVersion    string
	HTTPClient    *http.Client
	Now           func() time.Time
}

FetchOptions controls docs sync behavior.

type FetchResult

type FetchResult struct {
	DocsPath  string
	FileCount int
	ByteCount int64
	Manifest  Manifest
}

FetchResult summarizes a docs sync.

func Fetch

func Fetch(opts FetchOptions) (*FetchResult, error)

Fetch downloads and installs docs into .raven/docs for the given vault.

type Manifest

type Manifest struct {
	SchemaVersion int    `json:"schema_version"`
	SourceBaseURL string `json:"source_base_url"`
	Ref           string `json:"ref"`
	ArchiveURL    string `json:"archive_url"`
	FetchedAt     string `json:"fetched_at"`
	CLIVersion    string `json:"cli_version,omitempty"`
}

Manifest records the source and timing of the last docs sync.

func ReadManifest

func ReadManifest(vaultPath string) (*Manifest, error)

ReadManifest returns the docs manifest if present.

Jump to

Keyboard shortcuts

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