-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdoc.go
38 lines (37 loc) · 1.43 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package siva // import "gopkg.in/src-d/go-siva.v1"
// siva files are n number of blocks with the following format:
//
// - n number of raw content, without any restriction and without any divider
// - 3-byte index header, {'I', 'B,' A'}, the beginning of the index section
// - n number of index entries, the index entry looks like:
// 4-byte length of the filename
// n-byte filename
// 4-byte permission and mode bits
// 8-byte mod time in nanoseconds
// 8-byte offset to the start of the file content in the current block
// 8-byte size of the file
// 4-byte CRC32 of file content
// 4-byte flags
// - x-byte index footer
// 4-byte entries count
// 8-byte index size
// 8-byte block size
// 4-byte CRC32 of index header + index entries
//
// +------------------+
// | raw file content | ----------+
// +------------------+ |
// | ... | |
// +------------------+ |
// | raw file content | |
// +------------------+ |
// | index header | --+ |
// +------------------+ | | block
// | index entry | | |
// +------------------+ | |
// | ... | | index |
// +------------------+ | |
// | index entry | | |
// +------------------+ | |
// | index footer | --+-------+
// +------------------+