Documentation
¶
Overview ¶
Package v2 provides functionality to read and parse SEGB v2 files.
Index ¶
Constants ¶
View Source
const ( // FileMagic is the expected magic number at the beginning of the file. FileMagic = "SEGB" // TrailerRecordSize is the size in bytes of each trailer record. TrailerRecordSize = 16 )
Variables ¶
This section is empty.
Functions ¶
func PrettyHexdump ¶
func PrettyHexdump(data []byte)
Types ¶
type Entry ¶
type Entry struct { ID uint32 // Entry identifier State EntryState // State of the entry CreationTimestamp float64 // Creation timestamp (Cocoa timestamp) CRCChecksum uint32 // CRC32 checksum of the entry data Unknown [4]byte // Unknown 4 bytes Data []byte // Entry data (NB: due to some kinks with alignment, this might contain extra zero bytes. Trim as needed) RawData []byte // Raw data including CRCChecksum and Unknown fields }
Entry represents an entry in a SEGB file.
type EntryState ¶
type EntryState int32
EntryState represents the state of an entry.
const ( EntryStateWritten EntryState = 0x01 EntryStateDeleted EntryState = 0x03 EntryStateUnknown EntryState = 0x04 )
type Header ¶
type Header struct { Magic [4]byte // File magic number, should be "SEGB" EntryCount int32 // Number of entries in the file CreationTimestamp float64 // Creation timestamp (Cocoa timestamp) UnknownPadding [16]byte // Padding or reserved bytes, purpose unknown }
Header represents the header of a SEGB file.
func ReadHeader ¶
func ReadHeader(stream io.ReadSeeker) (*Header, error)
ReadHeader reads the header from the provided stream.
func (*Header) IsValidMagic ¶
IsValidMagic checks if the magic number matches the expected value.
func (*Header) MagicString ¶
MagicString returns the magic number as a string.
type Record ¶
type Record struct { Offset int32 // Offset of the entry data from the start of entries State EntryState // State of the entry CreationTimestamp float64 // Creation timestamp (Cocoa timestamp) }
Record represents a trailer record in a SEGB file.
func ReadRecord ¶
func ReadRecord(stream io.ReadSeeker) (*Record, error)
ReadRecord reads a trailer record from the provided stream.
Click to show internal directories.
Click to hide internal directories.