garminconnect

package module
v0.0.0-...-5ce6299 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2016 License: MIT Imports: 15 Imported by: 0

README

garminconnect

Go client for Garmin Connect

Install with go get github.com/phacops/garminconnect

Full API https://godoc.org/github.com/phacops/garminconnect

Documentation

Index

Constants

View Source
const (
	GARMIN_CONNECT_URL = "https://connect.garmin.com"
)
View Source
const (
	WORKOUT_FILE_TYPE = "FIT_TYPE_5"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(httpClient ...*http.Client) (*Client, error)

func (*Client) Auth

func (gc *Client) Auth(username, password string) error

func (*Client) DeleteMessage

func (gc *Client) DeleteMessage(messageId int) error

func (*Client) HeartRateByDate

func (gc *Client) HeartRateByDate(date time.Time) (HeartRate, error)

func (*Client) MessageReceived

func (gc *Client) MessageReceived(messageId int) error

func (*Client) Messages

func (gc *Client) Messages() ([]Message, error)

func (*Client) SleepByDate

func (gc *Client) SleepByDate(date time.Time) (Sleep, error)

func (*Client) UploadActivity

func (gc *Client) UploadActivity(path string) (Upload, error)

func (*Client) UserProfile

func (gc *Client) UserProfile() (UserProfile, error)

func (*Client) WeightByDate

func (gc *Client) WeightByDate(date time.Time) ([]Weight, error)

type HeartRate

type HeartRate struct {
	Min    int              `json:"minHeartRate"`
	Max    int              `json:"maxHeartRate"`
	Values []HeartRateValue `json:"heartRateValues"`
}

type HeartRateValue

type HeartRateValue [2]int

type Message

type Message struct {
	Id                int      `json:"messageId"`
	Type              string   `json:"messageType"`
	Status            string   `json:"messageStatus"`
	DeviceId          int      `json:"deviceId"`
	DeviceName        string   `json:"deviceName"`
	ApplicationKey    string   `json:"applicationKey"`
	FirmwareVersion   string   `json:"FirmwareVersion"`
	WifiSetup         bool     `json:"wifiSetup"`
	DeviceXmlDataType string   `json:"deviceXmlDataType"`
	Metadata          Metadata `json:"metadata"`
}

type Metadata

type Metadata struct {
	Filetype    string `json:"fileType"`
	MessageUrl  string `json:"messageUrl"`
	Absolute    bool   `json:"absolute"`
	MessageName string `json:"messageName"`
	GroupName   string `json:"groupName"`
	Priority    int    `json:"priority"`
	Id          int    `json:"metaDataId"`
	AppDetails  string `json:"appDetails"`
}

type Queue

type Queue struct {
	Host             string    `json:"serviceHost"`
	NumberOfMessages int       `json:"numOfMessages"`
	Messages         []Message `json:"messages"`
}

type Result

type Result struct {
	InternalId int             `json:"internalId"`
	ExternalId string          `json:"externalId"`
	Messages   []ResultMessage `json:"messages"`
}

type ResultMessage

type ResultMessage struct {
	Code    int    `json:"code"`
	Content string `json:"content"`
}

type Sleep

type Sleep struct {
	Date       string `json:"calendarDate"`
	Duration   int64  `json:"sleepTimeSeconds"`
	BedTime    int64  `json:"sleepStartTimestampGMT"`
	WakeUpTime int64  `json:"sleepEndTimestampGMT"`
}

type Upload

type Upload struct {
	DetailedImportResult struct {
		UploadId       int    `json:"uploadId"`
		Owner          int    `json:"owner"`
		FileSize       int    `json;"fileSize"`
		ProcessingTime int    `json:"processingTime"`
		CreationDate   string `json:"creationDate"`
		IpAddress      string `json:"ipAddress"`
		FileName       string `json:"fileName"`
		Report         struct {
			Class         string        `json:"@class"`
			CreatedOn     string        `json:"createdOn"`
			UserProfileId int           `json:"userProfileId"`
			Children      []interface{} `json:"children"`
			Entries       []interface{} `json:"entries"`
		}
		Successes []Result `json:"successes"`
		Failures  []Result `json:"failures"`
	} `json:"detailedImportResult"`
}

type UserProfile

type UserProfile struct {
	DisplayName string `json:"displayName"`
}

type Weight

type Weight struct {
	Date  int64   `json:"date"`
	Value float64 `json:"weight"`
}

Jump to

Keyboard shortcuts

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