Refactor architecture into eight components and consolidate reliability work
Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts. Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation. Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
This commit is contained in:
1 parent
9dd425f765
commit
d5d21b7841
302 files changed
+20037
-3492
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"pageswiki/internal/geduldh"
|
||||
)
|
||||
|
||||
// MaterializeDocument supplies a verified node-local, read-only scratch copy
|
||||
// for tools needing a pathname. Callers must authorize the reference first and
|
||||
// close the lease after all subprocesses finish. DB-only legacy stores work too.
|
||||
// TMPDIR is the operator-controlled local scratch root, not DocumentRoot.
|
||||
func (s *Store) MaterializeDocument(ctx context.Context, hash string, maxBytes int64) (*geduldh.Lease, error) {
|
||||
s.documentMaterializerOnce.Do(func() {
|
||||
// These fixed safe defaults precede configurable deployment profiles.
|
||||
s.documentMaterializer, _ = geduldh.NewMaterializer(documentSource{s}, geduldh.MaterializeOptions{
|
||||
MaxBytes: 2 << 30, Concurrent: 2, Timeout: 2 * time.Minute,
|
||||
})
|
||||
})
|
||||
return s.documentMaterializer.Acquire(ctx, hash, maxBytes)
|
||||
}
|
||||
|
||||
type documentSource struct{ store *Store }
|
||||
|
||||
func (source documentSource) Stat(ctx context.Context, hash string) (geduldh.Info, error) {
|
||||
size, err := source.store.DocumentSizeContext(ctx, hash)
|
||||
return geduldh.Info{Hash: hash, Size: size}, err
|
||||
}
|
||||
|
||||
func (source documentSource) Open(ctx context.Context, hash string) (geduldh.Reader, error) {
|
||||
return source.store.OpenDocumentContext(ctx, hash)
|
||||
}
|
||||
Reference in new issue
Block a user