Version: v0.0.0-...-0627f11 Latest Latest

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

Go to latest
Published: Apr 27, 2017 License: BSD-2-Clause Imports: 9 Imported by: 0



Package igc implements an IGC parser.



This section is empty.


View Source
var (
	// ErrInvalidCharacter is returned when an invalid character is encountered.
	ErrInvalidCharacter = errors.New("invalid character")
	// ErrInvalidCharactersBeforeARecord is returned when invalid characters are encountered before the A record.
	ErrInvalidCharactersBeforeARecord = errors.New("invalid characters before A record")
	// ErrInvalidBRecord is returned when an invalid B record is encountered.
	ErrInvalidBRecord = errors.New("invalid B record")
	// ErrInvalidHRecord is returned when an invalid H record is encountered.
	ErrInvalidHRecord = errors.New("invalid H record")
	// ErrInvalidIRecord is returned when an invalid I record is encountered.
	ErrInvalidIRecord = errors.New("invalid I record")
	// ErrEmptyLine is returned when an empty line is encountered.
	ErrEmptyLine = errors.New("empty line")
	// ErrMissingARecord is returned when no A record is found.
	ErrMissingARecord = errors.New("missing A record")
	// ErrOutOfRange is returned when a value is out of range.
	ErrOutOfRange = errors.New("out of range")


This section is empty.


type Encoder

type Encoder struct {
	// contains filtered or unexported fields

An Encoder is an IGC encoder.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new Encoder that writes to w.

func (*Encoder) Encode

func (enc *Encoder) Encode(ls *geom.LineString) error

Encode encodes a LineString.

type Errors

type Errors map[int]error

An Errors is a map of errors encountered at each line.

func (Errors) Error

func (es Errors) Error() string
type Header struct {
	Source   string
	Key      string
	KeyExtra string
	Value    string

A Header is an IGC header.

type T

type T struct {
	Headers    []Header
	LineString *geom.LineString

A T represents a parsed IGC file.

func Read

func Read(r io.Reader) (*T, error)

Read reads a igc.T from r, which should contain IGC records.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL