Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CompressionNone corresponds to no compression. CompressionNone CompressionKind = iota // CompressionZLIB corresponds to zlib compression: balanced compression/decompression performance, moderate compression ratio. CompressionZLIB CompressionKind = iota // CompressionBZIP2 corresponds to bzip2 compression: slow compression/decompression, good compression ratio. CompressionBZIP2 CompressionKind = iota // CompressionLZ4 corresponds to lz4 compression: very fast compression/decompression, poor compression ratio for complex data, moderate/good for ordered. CompressionLZ4 CompressionKind = iota // FlagStreamed denotes a streamed block. Not used anywhere yet. FlagStreamed uint32 = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { // Data is the block's payload. Data []byte // Flags is the block's flags. The 1.x standard does not define any flags except `FlagStreamed`. Flags uint32 // Compression is the block's compression type: none, zlib, bzip2 or lz4. Compression CompressionKind // contains filtered or unexported fields }
Block corresponds to an ASDF block.
func ReadBlock ¶
ReadBlock loads another block from the specified reader. That block may be compressed, call `Uncompress()` to obtain the original Data.
func (*Block) Uncompress ¶
Uncompress switches the block's compression to "none", uncompressing `Data` in-place as needed and checking the checksum.
type CompressionKind ¶
type CompressionKind int
CompressionKind indicates the block compression type: none, zlib, bzip2 or lz4.
type File ¶
type File struct { core.Document // FormatVersion corresponds to the contents of #ASDF header comment. FormatVersion semver.Version // FormatVersion corresponds to the contents of #ASDF_STANDARD header comment. StandardVersion semver.Version }
File is the top level, ASDF file type.
func Open ¶
func Open(reader io.ReadSeeker, progress ProgressCallback) (*File, error)
Open reads ASDF from a seekable reader.
type ProgressCallback ¶
type ProgressCallback func(done, total int)
ProgressCallback allows tracking the file loading progress. Both done *and* total will grow dynamically.
Click to show internal directories.
Click to hide internal directories.