Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kcfwpi/gofit
FIT file parser written in Go
https://github.com/kcfwpi/gofit
Last synced: 13 days ago
JSON representation
FIT file parser written in Go
- Host: GitHub
- URL: https://github.com/kcfwpi/gofit
- Owner: kcfwpi
- Created: 2015-07-30T09:24:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-10-19T20:53:48.000Z (about 5 years ago)
- Last Synced: 2024-08-01T19:45:52.264Z (3 months ago)
- Language: Go
- Size: 593 KB
- Stars: 15
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
}