igc

package
v0.0.0-...-1491eae Latest Latest
Warning

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

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

Documentation

Overview

Package igc 实现 an IGC 分析器.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidCharacter 将返回当遇到无效字符时.
	ErrInvalidCharacter = errors.New("invalid character")
	// ErrInvalidCharactersBeforeARecord 将返回在 A record之前遇到无效字符时。
	ErrInvalidCharactersBeforeARecord = errors.New("invalid characters before A record")
	// ErrInvalidBRecord 遇到无效的B记录时将返回.
	ErrInvalidBRecord = errors.New("invalid B record")
	// ErrInvalidHRecord 遇到无效的H记录时将返回.
	ErrInvalidHRecord = errors.New("invalid H record")
	// ErrInvalidIRecord 遇到无效的I记录时将返回.
	ErrInvalidIRecord = errors.New("invalid I record")
	// ErrEmptyLine 当遇到无效的空 line 时将返回.
	ErrEmptyLine = errors.New("empty line")
	// ErrMissingARecord 当找不到 A record 时将返回.
	ErrMissingARecord = errors.New("missing A record")
	// ErrOutOfRange 当值超过范围时将返回
	ErrOutOfRange = errors.New("out of range")
)

Functions

This section is empty.

Types

type Encoder

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

An Encoder 是 IGC 编码器.

func NewEncoder

func NewEncoder(w io.Writer, options ...EncoderOption) *Encoder

NewEncoder函数 返回一个新的编码器 that writes to w.

func (*Encoder) Encode

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

Encode方法 编码一个 LineString.

type EncoderOption

type EncoderOption func(*Encoder)

func A

func A(a string) EncoderOption

type Errors

type Errors map[int]error

An Errors is 当遍历每行出错时.

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 代表IGC文件解析.

func Read

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

Read 读取 a igc.T from r, 其中应包含IGC的记录.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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