api

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2016 License: MIT Imports: 14 Imported by: 8

Documentation

Overview

Package api implements Runtastic API for downloading activity data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	ID        ActivityID
	StartTime time.Time
	EndTime   time.Time
	Trace     []DataPoint
}

Activity contains metadata and collection of data points for single activity.

func GetActivities

func GetActivities(ctx context.Context, session *Session) ([]Activity, error)

GetActivities retrieves GPS traces for all available activities.

func GetActivity

func GetActivity(ctx context.Context, session *Session, id ActivityID) (*Activity, error)

GetActivity downloads GPS trace of an activity with given ID.

type ActivityID

type ActivityID string

ActivityID is unique activity identifier.

func GetActivityIDs

func GetActivityIDs(ctx context.Context, session *Session) ([]ActivityID, error)

GetActivityIDs returns list of IDs of all activities that have GPS trace available.

type DataPoint

type DataPoint struct {
	Longitude     float32
	Latitude      float32
	Elevation     float32
	Time          time.Time
	SpeedKPH      float32
	Elapsed       time.Duration
	Distance      int32
	ElevationGain int16
	ElevationLoss int16
	HeartRate     *uint8
}

DataPoint represents single data point with GPS and heart rate data.

type Session

type Session struct {
	UserID      UserID `json:"userId"`
	AccessToken string `json:"accessToken"`
	Cookie      string
}

Session contains session data for single authenticated user.

func Login

func Login(ctx context.Context, email, password string) (*Session, error)

Login connects to Runtastic API server and authenticates user using given email and password.

type UserID

type UserID string

UserID is unique user identifier.

Jump to

Keyboard shortcuts

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