fileblock

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner allows reading fileblocks from PBF files, one at a time.

func NewScanner

func NewScanner(file *os.File) Scanner

func (*Scanner) Blob

func (s *Scanner) Blob() *pbfproto.Blob

Blob returns the latest blob. May be nil if Scan has not been called or an unknown blob type has been encountered.

func (*Scanner) BlobHeader

func (s *Scanner) BlobHeader() *pbfproto.BlobHeader

func (*Scanner) BlobLocation

func (s *Scanner) BlobLocation() (start int64, size int32)

BlobLocation returns the start position and size of the latest blob in the PBF file.

func (*Scanner) Err

func (s *Scanner) Err() error

func (*Scanner) Scan

func (s *Scanner) Scan() bool

Scan reads the next fileblock, which can be retrieved with the BlobHeader and Blob functions. If it returns false, no new fileblock has been read. This is either because there are no more fileblocks or because there was an error. In the latter case, the Err method will return the encountered error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL