storage

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMarkdown

func IsMarkdown(path string) bool

IsMarkdown is the strict, extension-only routing decision between the two backends: true -> CouchDB note path, false -> S3. This is deliberately narrower than couchdb.MimeTypeForPath's "text/*" bucket (which also covers .txt/.csv/.yaml/.json/etc) — only .md/.markdown stay in CouchDB; everything else routes to S3.

Types

type BinaryStore

type BinaryStore interface {
	Put(ctx context.Context, path string, content []byte, mimeType string) error
	Get(ctx context.Context, path string) (Object, error)
	Stat(ctx context.Context, path string) (ObjectEntry, error)
	Delete(ctx context.Context, path string) error
	Move(ctx context.Context, oldPath, newPath string) error
	List(ctx context.Context) ([]ObjectEntry, error)
}

BinaryStore is a CRUD-over-object-keys abstraction backing the non-markdown half of a vault's content, implemented by both s3.Client and couchdb.BinaryStoreAdapter so a vault can route binary MCP file operations to either backend.

type Object

type Object struct {
	Path     string
	RawBytes []byte
	MimeType string
	Size     int64
}

type ObjectEntry

type ObjectEntry struct {
	Path     string
	Size     int64
	MimeType string
	Mtime    int64 // unix ms
}

Jump to

Keyboard shortcuts

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