Documentation
¶
Overview ¶
Package v1 provides functionality to read and parse SEGB version 1 files.
Index ¶
Constants ¶
View Source
const (
// FileMagic is the expected magic number at the end of the header.
FileMagic = "SEGB"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
ID int32 // Entry ID.
Length int32 // Length of the data section in bytes.
State EntryState // State of the entry.
Timestamp1 float64 // First timestamp (Cocoa timestamp).
Timestamp2 float64 // Second timestamp (Cocoa timestamp).
CRCChecksum uint32 // CRC32 checksum of the data section.
Unknown int32 // Unknown field.
Data []byte // Entry data.
// Additional fields for convenience.
Offset int64 // Offset of the entry in the file.
}
Entry represents an entry in a SEGB version 1 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 {
EndOfDataOffset int32 // Offset where entry data ends.
Magic [4]byte // File magic number, should be "SEGB".
// contains filtered or unexported fields
}
Header represents the header of a SEGB version 1 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.
Click to show internal directories.
Click to hide internal directories.