Documentation
¶
Overview ¶
Package syncwire owns the on-wire types shared by the cloud sync stack: the encrypted envelope (pinax.cloud.envelope.v1) and the content manifest (pinax.cloud.manifest.v1/v2). remote and cloudsync previously declared parallel copies of these schemas with drifting field sets — this package is the single source of truth; the other packages alias these types so the wire format can no longer diverge silently.
Index ¶
Constants ¶
const ( // EnvelopeSchemaVersion is the encrypted-envelope wire schema. EnvelopeSchemaVersion = "pinax.cloud.envelope.v1" // ManifestSchemaVersionV1 is the path-keyed manifest wire schema. ManifestSchemaVersionV1 = "pinax.cloud.manifest.v1" // ManifestSchemaVersionV2 is the identity-first manifest wire schema. ManifestSchemaVersionV2 = "pinax.cloud.manifest.v2" // ManifestSchemaVersion is the schema written by new manifests. ManifestSchemaVersion = ManifestSchemaVersionV1 )
Variables ¶
This section is empty.
Functions ¶
func IsUnsafePlaintextToken ¶
IsUnsafePlaintextToken reports whether a value may carry plaintext paths or credentials that must never appear in wire metadata.
Types ¶
type Envelope ¶
type Envelope struct {
SchemaVersion string `json:"schema_version"`
Alg string `json:"alg"`
KeyID string `json:"key_id"`
Nonce string `json:"nonce"`
Ciphertext string `json:"ciphertext"`
PlainSHA256 string `json:"plain_sha256"`
Metadata map[string]string `json:"metadata,omitempty"`
}
Envelope is the encrypted payload wrapper for blobs and manifests.
type Manifest ¶
type Manifest struct {
SchemaVersion string `json:"schema_version"`
GeneratedAt string `json:"generated_at"`
EntryCount int `json:"entry_count"`
Entries []ManifestEntry `json:"entries"`
Deletes []ManifestDelete `json:"deletes,omitempty"`
}
Manifest is the content manifest serialized inside manifest envelopes.
func (Manifest) BlobIDs ¶
BlobIDs lists every blob referenced by the manifest entries, including trash backup blobs held by delete markers.
func (Manifest) ValidateV2 ¶
type ManifestDelete ¶
type ManifestDelete struct {
PathHash string `json:"path_hash"`
ObjectKind string `json:"object_kind"`
ObjectID string `json:"object_id,omitempty"`
TombstoneID string `json:"tombstone_id"`
DeletedAt string `json:"deleted_at,omitempty"`
TrashBlobID string `json:"trash_blob_id,omitempty"`
RevisionID string `json:"revision_id,omitempty"`
DeviceID string `json:"device_id,omitempty"`
}
ManifestDelete is one delete-marker tombstone in a manifest.
type ManifestEntry ¶
type ManifestEntry struct {
ObjectID string `json:"object_id,omitempty"`
RevisionID string `json:"revision_id,omitempty"`
DeviceID string `json:"device_id,omitempty"`
Path string `json:"path"`
PathHash string `json:"path_hash"`
BlobID string `json:"blob_id"`
Size int64 `json:"size"`
SHA256 string `json:"sha256"`
ObjectKind string `json:"object_kind,omitempty"`
Mode uint32 `json:"mode,omitempty"`
MediaType string `json:"media_type,omitempty"`
UpdatedAt string `json:"updated_at"`
}
ManifestEntry is one object in a manifest.