ouraring

package
v0.0.0-...-73b3b6a Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

Types

type Client

type Client struct {
	BaseURL *url.URL

	// Services used for talking to different parts of the oura ring API.
	Sleep *SleepService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client, accessToken string) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)

func (*Client) NewRequest

func (c *Client) NewRequest(urlStr string, body interface{}) (*http.Request, error)

type ListOptions

type ListOptions struct {
	StartTime string `url:"start"`
	EndTime   string `url:"end"`
}

type Sleep

type Sleep struct {
	SummaryDate       string    `json:"summary_date"`
	PeriodID          int       `json:"period_id"`
	IsLongest         int       `json:"is_longest"`
	Timezone          int       `json:"timezone"`
	BedtimeStart      time.Time `json:"bedtime_start"`
	BedtimeEnd        time.Time `json:"bedtime_end"`
	Score             int       `json:"score"`
	ScoreTotal        int       `json:"score_total"`
	ScoreDisturbances int       `json:"score_disturbances"`
	ScoreEfficiency   int       `json:"score_efficiency"`
	ScoreLatency      int       `json:"score_latency"`
	ScoreRem          int       `json:"score_rem"`
	ScoreDeep         int       `json:"score_deep"`
	ScoreAlignment    int       `json:"score_alignment"`
	Total             int       `json:"total"`
	Duration          int       `json:"duration"`
	Awake             int       `json:"awake"`
	Light             int       `json:"light"`
	Rem               int       `json:"rem"`
	Deep              int       `json:"deep"`
	OnsetLatency      int       `json:"onset_latency"`
	Restless          int       `json:"restless"`
	Efficiency        int       `json:"efficiency"`
	MidpointTime      int       `json:"midpoint_time"`
	HrLowest          int       `json:"hr_lowest"`
	HrAverage         float64   `json:"hr_average"`
	Rmssd             int       `json:"rmssd"`
	BreathAverage     float64   `json:"breath_average"`
	TemperatureDelta  float64   `json:"temperature_delta"`
	Hypnogram5Min     string    `json:"hypnogram_5min"`
	Hr5Min            []int     `json:"hr_5min"`
	Rmssd5Min         []int     `json:"rmssd_5min"`
}

type SleepResponse

type SleepResponse struct {
	Sleep []Sleep `json:"sleep"`
}

type SleepService

type SleepService service

func (*SleepService) List

func (s *SleepService) List(ctx context.Context, opts ListOptions) ([]Sleep, *http.Response, error)

Jump to

Keyboard shortcuts

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