Documentation ¶
Index ¶
Constants ¶
const FrameHeaderLength = 128
FrameHeaderLength total header length size for each frame
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
func CheckVersion(header *FrameHeader) bool
CheckVersion verifies that the binary format is compatible with the current release
func NewMultiReader ¶
NewFrameReader returns a channel of Frames. The channel is closed whenever there are no other frames or the FrameReader encounter an error reading a frame
Types ¶
type ByNumber ¶
type ByNumber []string
ByNumber helper struct to sort by last number all the log files
type Collection ¶
type Collection struct {
Data []*Frame
}
Collection represents the file that contains all the subsequent frames
func ReadAll ¶
func ReadAll(r io.Reader) *Collection
ReadAll reads all the Collection (Header, Frame*) and returns in a compound structure. NOTE: the NewFrameReader streaming implementation should be preferred
type Frame ¶
type Frame struct { Header *FrameHeader Data []byte }
Frame represents one of the frame of the Collection file. It contains:
- the Data slice that contains the data of the frame
func ReadFrame ¶
ReadFrame reads the next frame from the Reader or returns an error in case it cannot interpret the Frame
func (*Frame) NameString ¶
Header.URIString converts the backing URI to a string
type FrameHeader ¶
type FrameHeader struct { Magic [3]byte Version [3]byte Reserved [2]byte Size int64 Timestamp int64 Name [52]byte URI [52]byte }
FrameHeader represents the header of each Frame
- a Size that represents how big is the the Data section
- a Timestamp that represents when the Frame is snapshotted
- a Name that represents the service that has been snapshotted
- an URL that represents the service location
func ReadFrameHeader ¶
func ReadFrameHeader(r io.Reader) (*FrameHeader, error)
ReadFrameHeader reads the next FrameHeader from the reader