Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kcfwpi/gofit

FIT file parser written in Go
https://github.com/kcfwpi/gofit

Last synced: about 2 months ago
JSON representation

FIT file parser written in Go

Awesome Lists containing this project

README

        

gofit
=========

The gofit package provides a basic library for parsing FIT (Flexible and Interoperable Data Transfer) files.

#### To install

go get github.com/kcfwpi/gofit

#### To use

import "github.com/kcfwpi/gofit"

Examples
-------------------------------

Use the NewFIT function to create a new FIT. The only parameter is a type that implements the io.Reader interface. This is often a file type.

fit := NewFIT(f)

Call the Parse function on the returned FIT struct. This will start a goroutine that begins to stream through the io.Reader that contains the FIT data.

fit.Parse()

FIT data messages are sent to the FIT struct message channel as they are parsed. Range over this channel to begin reading the messages. When the end of reader is reached the MessageChan is closed.

for m := range fit.MessageChan {
// work on Message here
}