Documentation
¶
Index ¶
- func EncodeMetadata(meta *Metadata) ([]byte, error)
- type ChunkEntry
- func (e ChunkEntry) Between(start, end uint32) bool
- func (e ChunkEntry) BitmapAt() uint32
- func (e ChunkEntry) BitmapSize() uint32
- func (e ChunkEntry) DataAt() uint32
- func (e ChunkEntry) DataSize() uint32
- func (e ChunkEntry) From() uint32
- func (e ChunkEntry) Offset() uint64
- func (e ChunkEntry) Size() uint32
- func (e ChunkEntry) Until() uint32
- type Codec
- type CompressionError
- type IndexEntry
- type LogEntry
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeMetadata ¶
EncodeMetadata encodes metadata into JSON format.
Types ¶
type ChunkEntry ¶
type ChunkEntry struct {
Location [3]uint `json:"loc"`
Time [2]uint `json:"time"`
Actors map[uint32]IndexEntry `json:"act,omitempty"`
}
ChunkEntry represents a chunk entry stored in metadata.
func NewChunkEntry ¶
func NewChunkEntry(offset uint64, bitmapSize, logSize uint32, startTime, endTime uint32, actors map[uint32]IndexEntry) ChunkEntry
NewChunkEntry creates a new chunk entry.
func (ChunkEntry) Between ¶
func (e ChunkEntry) Between(start, end uint32) bool
Between checks if the chunk overlaps with the given time range.
func (ChunkEntry) BitmapAt ¶
func (e ChunkEntry) BitmapAt() uint32
BitmapAt calculates the offset to the bitmap section within the merged file.
func (ChunkEntry) BitmapSize ¶
func (e ChunkEntry) BitmapSize() uint32
BitmapSize returns the bitmap size.
func (ChunkEntry) DataAt ¶
func (e ChunkEntry) DataAt() uint32
DataAt calculates the offset to the log section within the merged file.
func (ChunkEntry) From ¶
func (e ChunkEntry) From() uint32
From returns the chunk start time in seconds.
func (ChunkEntry) Size ¶
func (e ChunkEntry) Size() uint32
Size calculates the total size of the merged file.
func (ChunkEntry) Until ¶
func (e ChunkEntry) Until() uint32
Until returns the chunk end time in seconds.
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
Codec handles ZSTD compression and decompression operations.
type CompressionError ¶
CompressionError represents a compression/decompression error.
func (*CompressionError) Error ¶
func (e *CompressionError) Error() string
func (*CompressionError) Unwrap ¶
func (e *CompressionError) Unwrap() error
type IndexEntry ¶
type IndexEntry [3]uint
IndexEntry represents metadata about an actor bitmap within a chunk.
func NewIndexEntry ¶
func NewIndexEntry(timestamp uint32, offset uint64, size uint32) IndexEntry
NewIndexEntry allocates a new index entry.
type LogEntry ¶
type LogEntry []byte
LogEntry represents a single log entry as raw bytes
func NewLogEntry ¶
NewLogEntry creates a new log entry from components
type Metadata ¶
type Metadata struct {
Date int64 `json:"date"`
Length uint32 `json:"length"`
Chunks []ChunkEntry `json:"chunks"`
}
Metadata represents the metadata structure for log files.
func DecodeMetadata ¶
DecodeMetadata decodes metadata from JSON format.
func NewMetadata ¶
NewMetadata creates a new metadata instance with default values.