Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultScopes is describes all available Health Mate scopes. // Needs to be comma separated for the Health Mate endpoint and slice of string // for Oauth2 package. DefaultScopes = []string{"user.info,user.metrics,user.activity,user.sleepevents"} // HealthMateState is a random state for generating auth code url to mitigate CSRF attacks. HealthMateState string )
View Source
var HealthMateEndpoint = oauth2.Endpoint{
AuthURL: "https://account.withings.com/oauth2_user/authorize2",
TokenURL: "https://account.withings.com/oauth2/token",
}
HealthMateEndpoint is the endpoints for Withings Health Mate
Functions ¶
Types ¶
type Client ¶
func (*Client) GetAccessToken ¶
GetAccessToken obtains the access token for the authenticated user
func (*Client) GetAuthCodeURL ¶
GetAuthCodeURL obtains the user authentication URL
type Measure ¶
type MeasureResult ¶
type MeasureResult struct { Status int64 `json:"status"` Body struct { Updatetime Timestamp `json:"updatetime"` Timezone string `json:"timezone"` Measuregrps []struct { Grpid int64 `json:"grpid"` Attrib int64 `json:"attrib"` Date Timestamp `json:"date"` Created Timestamp `json:"created"` Category int64 `json:"category"` Deviceid string `json:"deviceid"` HashDeviceid string `json:"hash_deviceid"` Measures []Measure `json:"measures"` Comment string `json:"comment"` } `json:"measuregrps"` } `json:"body"` }
type Series ¶
type Series struct { ID int64 `json:"id"` Category int64 `json:"category"` Timezone string `json:"timezone"` Model int64 `json:"model"` Attrib int64 `json:"attrib"` Startdate Timestamp `json:"startdate"` Enddate Timestamp `json:"enddate"` Date string `json:"date"` Deviceid string `json:"deviceid"` Workout struct { Calories float64 `json:"calories"` Effduration float64 `json:"effduration"` Intensity int64 `json:"intensity"` ManualDistance float64 `json:"manual_distance"` ManualCalories float64 `json:"manual_calories"` Steps int64 `json:"steps"` Distance float64 `json:"distance"` Elevation float64 `json:"elevation"` HRAverage int64 `json:"hr_average"` HRMin int64 `json:"hr_min"` HRMax int64 `json:"hr_max"` } `json:"data"` Modified int64 `json:"modified"` }
type Timestamp ¶
func (Timestamp) MarshalJSON ¶
func (Timestamp) Unix ¶
Unix returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC. The result does not depend on the location associated with t.
func (*Timestamp) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.