package decodemeta

Import Path
	internal/coverage/decodemeta (on go.dev)

Dependency Relation
	imports 9 packages, and imported by one package

Involved Source Files decode.go decodefile.go
Package-Level Type Names (total 2)
/* sort by: | */
(*CoverageMetaDataDecoder) ModulePath() string (*CoverageMetaDataDecoder) NumFuncs() uint32 (*CoverageMetaDataDecoder) PackageName() string (*CoverageMetaDataDecoder) PackagePath() string ReadFunc reads the coverage meta-data for the function with index 'findex', filling it into the FuncDesc pointed to by 'f'. func NewCoverageMetaDataDecoder(b []byte, readonly bool) (*CoverageMetaDataDecoder, error) func (*CoverageMetaFileReader).GetPackageDecoder(pkIdx uint32, payloadbuf []byte) (*CoverageMetaDataDecoder, []byte, error)
CoverageMetaFileReader provides state and methods for reading a meta-data file from a code coverage run. CounterGranularity returns the counter granularity (single counter per function, or counter per block) selected when building for coverage for the program that produce this meta-data file. CounterMode returns the counter mode (set, count, atomic) used when building for coverage for the program that produce this meta-data file. FileHash returns the hash computed for all of the package meta-data blobs. Coverage counter data files refer to this hash, and the hash will be encoded into the meta-data file name. GetPackageDecoder requests a decoder object for the package within the meta-data file whose index is 'pkIdx'. If the CoverageMetaFileReader was set up with a read-only file view, a pointer into that file view will be returned, otherwise the buffer 'payloadbuf' will be written to (or if it is not of sufficient size, a new buffer will be allocated). Return value is the decoder, a byte slice with the encoded meta-data, and an error. GetPackagePayload returns the raw (encoded) meta-data payload for the package with index 'pkIdx'. As with GetPackageDecoder, if the CoverageMetaFileReader was set up with a read-only file view, a pointer into that file view will be returned, otherwise the buffer 'payloadbuf' will be written to (or if it is not of sufficient size, a new buffer will be allocated). Return value is the decoder, a byte slice with the encoded meta-data, and an error. NumPackages returns the number of packages for which this file contains meta-data. func NewCoverageMetaFileReader(f *os.File, fileView []byte) (*CoverageMetaFileReader, error)
Package-Level Functions (total 2)
NewCoverageMetaFileReader returns a new helper object for reading the coverage meta-data output file 'f'. The param 'fileView' is a read-only slice containing the contents of 'f' obtained by mmap'ing the file read-only; 'fileView' may be nil, in which case the helper will read the contents of the file using regular file Read operations.