file

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	GetType() string
	SetType(string) error
	SetRecord(lib.Record) error
	AddDataRecord(lib.Record) error
	GetRecord(string) (lib.Record, error)
	GetDataRecords() []lib.Record
	GeneratorTrailer() (lib.Record, error)

	Parse(record []byte) error
	Bytes() []byte
	String(newline bool) string
	Validate() error
}

General file interface

func CreateFile

func CreateFile(buf []byte) (File, error)

CreateFile attempts to parse raw metro2 or json

func NewFile

func NewFile(format string) (File, error)

NewFile constructs a file template.

func NewFileFromReader added in v0.5.0

func NewFileFromReader(r io.Reader) (File, error)

NewFileFromReader attempts to parse raw metro2 file or json file

type Reader added in v0.5.0

type Reader struct {

	// file is metro2 file model being built as r is parsed.
	File File
	// contains filtered or unexported fields
}

Reader reads records from a metro2 encoded file.

func NewReader added in v0.5.0

func NewReader(r io.Reader) *Reader

NewReader returns a new metro reader that reads from io reader.

func (*Reader) Read added in v0.5.0

func (r *Reader) Read() (File, error)

Read reads each record of the metro file

Jump to

Keyboard shortcuts

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