fitbit2gcal

package
v0.0.0-...-4eeaa7b Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fitbit2gcal is a generated GoMock package.

Package fitbit2gcal is a generated GoMock package.

Package fitbit2gcal is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Activities      []ActivityData  `json:"activities"`
	ActivityGoals   ActivityGoals   `json:"goals"`
	ActivitySummary ActivitySummary `json:"summary"`
}

type ActivityCalories

type ActivityCalories struct {
	BMR   int `json:"bmr"`
	Total int `json:"total"`
}

type ActivityData

type ActivityData struct {
	ActivityID        int             `json:"activityId"`
	ActiveDuration    int             `json:"activeDuration"`
	ActivityLevel     []ActivityLevel `json:"activityLevel"`
	ActivityName      string          `json:"activityName"`
	ActivityTypeID    int             `json:"activityTypeId"`
	Calories          int             `json:"calories"`
	Duration          int             `json:"duration"`
	ElevationGain     int             `json:"elevationGain"`
	HasGPS            bool            `json:"hasGps"`
	LastModified      string          `json:"lastModified"`
	LogID             int             `json:"logId"`
	LogType           string          `json:"logType"`
	OriginalDuration  int             `json:"originalDuration"`
	OriginalStartTime string          `json:"originakStartTime"`
	StartTime         string          `json:"startTime"`
	Steps             int             `json:"steps"`
}

type ActivityGoals

type ActivityGoals struct {
	ActiveMinutes int     `json:"activeMinutes"`
	Calories      int     `json:"calories"`
	Distance      float32 `json:"distance"`
	DistanceUnit  string  `json:"distanceUnit"`
	Floors        int     `json:"floors"`
	Steps         int     `json:"steps"`
}

type ActivityHeartRateZone

type ActivityHeartRateZone struct {
	CaloriesOut float32 `json:"caloriesOut"`
	Max         int     `json:"max"`
	Min         int     `json:"min"`
	Minutes     int     `json:"minutes"`
	Name        string  `json:"name"`
}

type ActivityLevel

type ActivityLevel struct {
	Distance float32 `json:"distance"`
	Minutes  int     `json:"minutes"`
	Name     string  `json:"name"`
}

type ActivitySummary

type ActivitySummary struct {
	ActivityLevels []ActivityLevel         `json:"activityLevels"`
	Calories       ActivityCalories        `json:"calories"`
	Distance       float32                 `json:"distance"`
	Elevation      float32                 `json:"elevation"`
	Floors         int                     `json:"floors"`
	HeartRateZones []ActivityHeartRateZone `json:"heartRateZones"`
	Steps          int                     `json:"steps"`
}

type FitbitClient

type FitbitClient interface {
	GetSleepData(dateStr string) (*Sleep, error)
	GetActivityData(dateStr string) (*Activity, error)
}

type FitbitConfig

type FitbitConfig struct {
	OauthConfig *oauth2.Config
}

type GCalClient

type GCalClient interface {
	InsertEvent(event *calendar.Event, dataType string) error
}

type GCalConfig

type GCalConfig struct {
	SleepCalendarID    string
	ActivityCalendarID string
	OauthConfig        *oauth2.Config
}

type MockFitbitClient

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

MockFitbitClient is a mock of FitbitClient interface

func NewMockFitbitClient

func NewMockFitbitClient(ctrl *gomock.Controller) *MockFitbitClient

NewMockFitbitClient creates a new mock instance

func (*MockFitbitClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockFitbitClient) GetActivityData

func (m *MockFitbitClient) GetActivityData(dateStr string) (*Activity, error)

GetActivityData mocks base method

func (*MockFitbitClient) GetSleepData

func (m *MockFitbitClient) GetSleepData(dateStr string) (*Sleep, error)

GetSleepData mocks base method

type MockFitbitClientMockRecorder

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

MockFitbitClientMockRecorder is the mock recorder for MockFitbitClient

func (*MockFitbitClientMockRecorder) GetActivityData

func (mr *MockFitbitClientMockRecorder) GetActivityData(dateStr interface{}) *gomock.Call

GetActivityData indicates an expected call of GetActivityData

func (*MockFitbitClientMockRecorder) GetSleepData

func (mr *MockFitbitClientMockRecorder) GetSleepData(dateStr interface{}) *gomock.Call

GetSleepData indicates an expected call of GetSleepData

type MockGCalClient

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

MockGCalClient is a mock of GCalClient interface

func NewMockGCalClient

func NewMockGCalClient(ctrl *gomock.Controller) *MockGCalClient

NewMockGCalClient creates a new mock instance

func (*MockGCalClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockGCalClient) InsertEvent

func (m *MockGCalClient) InsertEvent(event *v3.Event, dataType string) error

InsertEvent mocks base method

type MockGCalClientMockRecorder

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

MockGCalClientMockRecorder is the mock recorder for MockGCalClient

func (*MockGCalClientMockRecorder) InsertEvent

func (mr *MockGCalClientMockRecorder) InsertEvent(event, dataType interface{}) *gomock.Call

InsertEvent indicates an expected call of InsertEvent

type MockService

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

MockService is a mock of Service interface

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockService) Fitbit2GCal

func (m *MockService) Fitbit2GCal(fromDate, toDate time.Time) error

Fitbit2GCal mocks base method

func (*MockService) Fitbit2GCalToday

func (m *MockService) Fitbit2GCalToday() error

Fitbit2GCalToday mocks base method

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService

func (*MockServiceMockRecorder) Fitbit2GCal

func (mr *MockServiceMockRecorder) Fitbit2GCal(fromDate, toDate interface{}) *gomock.Call

Fitbit2GCal indicates an expected call of Fitbit2GCal

func (*MockServiceMockRecorder) Fitbit2GCalToday

func (mr *MockServiceMockRecorder) Fitbit2GCalToday() *gomock.Call

Fitbit2GCalToday indicates an expected call of Fitbit2GCalToday

type Schedule

type Schedule struct {
	Title    string
	Location string
	Year     string
	Month    string
	Day      string
	Start    string
	End      string
}

type Service

type Service interface {
	Fitbit2GCal(fromDate, toDate time.Time) error
	Fitbit2GCalToday() error
}

func NewService

func NewService(fbc FitbitClient, gc GCalClient) Service

type Sleep

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

Sleep : Sleep data

type SleepData

type SleepData struct {
	DateOfSleep         string      `json:"dateOfSleep"`
	Duration            int         `json:"duration"`
	Efficiency          int         `json:"efficiency"`
	IsMainSleep         bool        `json:"isMainSleep"`
	Levels              SleepLevels `json:"levels"`
	LogID               int         `json:"logId"`
	MinutesAfterWakeup  int         `json:"minutesAfterWakeup"`
	MinutesAsleep       int         `json:"minutesAsleep"`
	MinutesAwake        int         `json:"minutesAwake"`
	MinutesToFallAsleep int         `json:"minutesToFallAsleep"`
	StartTime           string      `json:"startTime"`
	TimeInBed           int         `json:"timeInBed"`
	Type                string      `json:"type"`
}

type SleepLevel

type SleepLevel struct {
	Count               int `json:"count"`
	Minutes             int `json:"minutes"`
	ThirtyDayAvgMinutes int `json:"thirtyDayAvgMinutes"`
}

type SleepLevels

type SleepLevels struct {
	Summary   SleepLevelsSummary     `json:"summary"`
	Data      []SleepLevelsDatapoint `json:"data"`
	ShortData []SleepLevelsDatapoint `json:"shortData"`
}

type SleepLevelsDatapoint

type SleepLevelsDatapoint struct {
	Datetime string `json:"datetime"`
	Level    string `json:"level"`
	Seconds  int    `json:"seconds"`
}

type SleepLevelsSummary

type SleepLevelsSummary struct {
	Deep  SleepLevel `json:"deep"`
	Light SleepLevel `json:"light"`
	Rem   SleepLevel `json:"rem"`
	Wake  SleepLevel `json:"wake"`
}

Jump to

Keyboard shortcuts

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