From 9e304b53de368b8ab42dba98605bf483a3c14fb2 Mon Sep 17 00:00:00 2001 From: "Anand Babu (AB) Periasamy" Date: Wed, 18 Feb 2015 15:52:12 -0800 Subject: [PATCH] donut spec v1 prototype --- pkg/storage/donut/donut.go | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/pkg/storage/donut/donut.go b/pkg/storage/donut/donut.go index 1d6414eb5..1cb0657e1 100644 --- a/pkg/storage/donut/donut.go +++ b/pkg/storage/donut/donut.go @@ -23,7 +23,43 @@ import ( "io" ) -type Header struct{} +/* + ** DONUT v1 Spec ** + + BlockStart uint32 // Magic="MINI" + VersionMajor uint16 + VersionMinor uint16 + VersionPatch uint16 + VersionReserved uint16 + Reserved uint64 + GobHeaderLen uint32 + GobHeader Sizeof(GobHeader) + BlockData uint32 // Magic="DATA" + Data []byte + BlockLen uint64 + BlockEnd uint32 // Magic="INIM" + +*/ + +type DonutHeader struct { + BlockStart uint32 // Magic="MINI" + VersionMajor uint16 + VersionMinor uint16 + VersionPatch uint16 + VersionReserved uint16 + Reserved uint64 + GobHeaderLen uint32 +} + +type DonutGobHeader struct { + DataLen uint64 +} + +type DonutFooter struct { + BlockLen uint64 + BlockEnd uint32 // Magic="INIM" +} + type Donut struct { file io.Writer }