Documentation
¶
Index ¶
- Constants
- func FormatTime(ts time.Time) string
- func ParseTime(text string) (time.Time, error)
- func VerifyHash(expectedObj HashObj, dataArr []byte) error
- type ArtifactDigestObj
- type ArtifactKeyObj
- type ArtifactObj
- type DetectionObj
- type FeedEventObj
- type HashObj
- type IngestFailureObj
- type InputEntryObj
- type IntegrityReportObj
- type KeySourceObj
- type PublishObj
- type PublishResultObj
- type StagedBlobObj
- type StagedEntryObj
- type StagedPublishObj
- type TreeEntryObj
- type VersionObj
Constants ¶
const ( // HashSize is the truncated BLAKE3 digest length in bytes (24 = 192 bits); it defines HashObj and key size. HashSize = 24 // PebbleKeyFormat marks the storage key schema (tag + 24-byte hash) and is written to metadata. PebbleKeyFormat = "tag_hash24" // ModeFile is the tree entry mode for a regular file. ModeFile = "file" // ModeSymlink is the tree entry mode for a symbolic link. ModeSymlink = "symlink" // DefaultFormat is the default artifact format version. DefaultFormat = 1 )
const ( ListingModeUndecided = "" ListingModeReleases = "releases" ListingModeTags = "tags" )
Git listing mode is sticky: the first successful non-empty listing chooses it, and a later conflict freezes key updates instead of switching automatically.
const IngestFailurePolicy = 1
IngestFailurePolicy changes whenever the retry rules for deterministic ingest failures change.
const TimeFormat = "2006-01-02T15:04:05.000Z07:00"
TimeFormat is the canonical RFC3339 format with milliseconds for UTC timestamps.
Variables ¶
This section is empty.
Functions ¶
func FormatTime ¶
FormatTime serializes a timestamp in the canonical UTC TimeFormat.
func VerifyHash ¶
VerifyHash checks integrity by comparing the buffer digest with the expected hash.
Types ¶
type ArtifactDigestObj ¶
type ArtifactDigestObj struct {
BodyHash HashObj
BodySha256 []byte
BodySha1 []byte
SizeBytes uint64
ETag string
}
ArtifactDigestObj is the built artifact identity used by RegisterArtifact and computed by storage.
type ArtifactKeyObj ¶
type ArtifactKeyObj struct {
MaterializerID string
ArtifactKind string
ListenerID string
Key string
Version string
}
ArtifactKeyObj identifies an artifact for storage addressing by materializer, kind, listener, key, and version.
type ArtifactObj ¶
type ArtifactObj struct {
MaterializerID string
ArtifactKind string
ListenerID string
Key string
Version string
ETag string
BodyHash HashObj
BodySha256 []byte
BodySha1 []byte
SizeBytes uint64
FormatVersion uint32
FilePath string
DegradedReason string
}
ArtifactObj is a built edge artifact: body, validators, disk path, and stale/degraded flags for server output.
type DetectionObj ¶
type DetectionObj struct {
IsGo bool
IsComposer bool
Conflict bool
EvidenceJSON string
// GoZipBlocked means the version tree cannot become a valid Go module zip
// because of invalid paths, fold collisions, symlinks, or hard module-zip limits.
GoZipBlocked bool
// GoZipBlockReason is a short English reason; empty means not blocked.
GoZipBlockReason string
}
DetectionObj is the source-type detection result for Go modules and Composer packages, including evidence.
type FeedEventObj ¶
type FeedEventObj struct {
Key string
Version string
EventTS time.Time
TreeHash HashObj
BodyHash HashObj
ReleaseNotes string
FirstPublish bool
}
FeedEventObj is a publish history event for Atom feeds: version, time, hashes, current release notes, and whether this is the first publication.
type HashObj ¶
HashObj is a fixed-size truncated BLAKE3 digest; it is comparable and usable as a map key.
func HashFromBytes ¶
HashFromBytes restores HashObj from raw bytes and requires exactly HashSize bytes.
func HashFromHasher ¶
HashFromHasher extracts the truncated digest from an already-filled streaming hasher.
type IngestFailureObj ¶ added in v0.4.0
type IngestFailureObj struct {
Key string
Version string
RefSHA string
Code string
Message string
Policy uint
FirstTS time.Time
LastTS time.Time
Count uint64
}
IngestFailureObj stores a deterministic ingest failure until the ref or policy changes.
type InputEntryObj ¶
type InputEntryObj struct {
Path string
Mode string
Content []byte
BlobHash HashObj
SizeBytes uint64
}
InputEntryObj is an input publication tree entry with in-memory content for ingestion.
type IntegrityReportObj ¶
type IntegrityReportObj struct {
Errors []string
}
IntegrityReportObj is a storage integrity-check result: the errors found during the scan.
type KeySourceObj ¶
type KeySourceObj struct {
Key string
URL string
Class string
WebAddr string
YggAddr string
OriginURL string
ListingMode string
BoundTS time.Time
}
KeySourceObj is the durable binding between key and source: source URL/class, learned public brother addresses, and advertised upstream origin. It survives restarts; web/ygg/origin stay empty until first contact. ListingMode pins the git listing strategy (empty, "releases", or "tags"); it changes only via SetKeyListingMode.
type PublishObj ¶
type PublishObj struct {
Key string
Version string
SourceHash HashObj
SourceSizeBytes uint64
UpstreamSeq int64 // precomputed source position; 0 lets publish assign max+1
Entries []InputEntryObj
Detection DetectionObj
RewriteBlobs []HashObj
Artifacts []ArtifactObj
UpstreamDeleted bool
EventType string
EventMessage string
ReleaseNotes string
HealPending bool
UpstreamRef string // source commit SHA; empty means unknown
VerifiedTS time.Time // deep verification timestamp to publish; zero leaves it unset
}
PublishObj requests version publication with entry bodies in memory, including tree, detection, artifacts, and history event parameters.
type PublishResultObj ¶
type PublishResultObj struct {
Key string
Version string
TreeHash HashObj
Published bool
Skipped bool
Historical string
}
PublishResultObj reports whether a version was written or skipped and the final TreeHash.
type StagedBlobObj ¶
StagedBlobObj is a prepared publication blob whose body is stored in a temporary file on disk.
type StagedEntryObj ¶
StagedEntryObj is a prepared publication tree entry: path, mode, and blob hash reference.
type StagedPublishObj ¶
type StagedPublishObj struct {
Key string
Version string
SourceHash HashObj
SourceSizeBytes uint64
UpstreamSeq int64 // precomputed source position; 0 lets publish assign max+1
Entries []StagedEntryObj
Blobs []StagedBlobObj
Detection DetectionObj
RewriteBlobs []HashObj
Artifacts []ArtifactObj
UpstreamDeleted bool
EventType string
EventMessage string
ReleaseNotes string
HealPending bool
UpstreamRef string // source commit SHA; empty means unknown
VerifiedTS time.Time // deep verification timestamp to publish; zero leaves it unset
}
StagedPublishObj is a publication with bodies staged to disk, describing tree and blobs by file references so archive content does not stay in RAM.
type TreeEntryObj ¶
TreeEntryObj is a persisted version-tree entry: path, mode, and blob hash reference without body.
type VersionObj ¶
type VersionObj struct {
Key string
Version string
SourceHash HashObj
SourceSizeBytes uint64
TreeHash HashObj
IngestTS time.Time
UpstreamSeq int64 // source listing position: larger is newer; 0 means unset
UpstreamDeleted bool
ReplacedBy string
ReleaseNotes string
HealPending bool
UpstreamRef string // commit SHA from source refs advertisement; empty means unknown (brother/legacy)
VerifiedTS time.Time // last deep verification time; zero means never verified
}
VersionObj is a persisted mirror version: source/tree hashes, ingest timestamp, lifecycle flags, and neighbor links.