igc

package
Version: v0.0.0-...-f56468d Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package igc implements an IGC parser.

Index

Constants

This section is empty.

Variables

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")
)

Functions

This section is empty.

Types

type Encoder

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

An Encoder is an IGC encoder.

func NewEncoder

func NewEncoder(w io.Writer, options ...EncoderOption) *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 EncoderOption

type EncoderOption func(*Encoder)

An EncoderOption sets an option on an Encoder.

func A

func A(a string) EncoderOption

A sets the A-record text.

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.

Directories

Path Synopsis
cmd

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