Skip to content

kcfwpi/gofit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

FIT file parser written in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages