Documentation
¶
Index ¶
- type ActivitiesContext
- type ActivityArgs
- type CalendarArgs
- type CalendarContext
- type FetchArgs
- type FetchResult
- type IntervalsClient
- type NutritionContext
- type RecentActivitiesArgs
- type RecoveryArgs
- type RecoveryContext
- type SearchArgs
- type SearchRecord
- type SearchResult
- type Service
- func (s *Service) Activity(ctx context.Context, args ActivityArgs) (*intervals.Activity, error)
- func (s *Service) Calendar(ctx context.Context, args CalendarArgs) (CalendarContext, error)
- func (s *Service) Fetch(ctx context.Context, args FetchArgs) (FetchResult, error)
- func (s *Service) RecentActivities(ctx context.Context, args RecentActivitiesArgs) (ActivitiesContext, error)
- func (s *Service) Recovery(ctx context.Context, args RecoveryArgs) (RecoveryContext, error)
- func (s *Service) Search(ctx context.Context, args SearchArgs) (SearchResult, error)
- func (s *Service) TodayContext(ctx context.Context, args TodayArgs) (TodayContext, error)
- type TodayArgs
- type TodayContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivitiesContext ¶
type ActivityArgs ¶
type CalendarArgs ¶
type CalendarArgs struct {
Oldest string `json:"oldest,omitempty" jsonschema:"Optional local start date. Defaults to today."`
Newest string `json:"newest,omitempty" jsonschema:"Optional local end date. Defaults to seven days from oldest."`
Categories []string `json:"categories,omitempty" jsonschema:"Optional Intervals event categories, for example WORKOUT or NOTES."`
}
type CalendarContext ¶
type FetchArgs ¶
type FetchArgs struct {
ID string `json:"id" jsonschema:"A record id returned by search, such as activity:abc, recovery:2026-06-01, or event:123."`
}
type FetchResult ¶
type IntervalsClient ¶
type IntervalsClient interface {
GetAthlete(context.Context) (*intervals.Athlete, error)
ListActivities(context.Context, string, string, int) ([]intervals.Activity, error)
GetActivity(context.Context, string, bool) (*intervals.Activity, error)
GetWellness(context.Context, string) (*intervals.Wellness, error)
GetAthleteSummary(context.Context, string, string) ([]intervals.Summary, error)
ListEvents(context.Context, string, string, []string, int) ([]intervals.Event, error)
GetEvent(context.Context, int) (*intervals.Event, error)
}
type NutritionContext ¶
type NutritionContext struct {
TotalCaloriesBurned int `json:"total_calories_burned,omitempty"`
TotalCarbsUsedGrams int `json:"total_carbs_used_grams,omitempty"`
TotalCarbsIngestedGrams int `json:"total_carbs_ingested_grams,omitempty"`
NetCarbsUsedEstimateGrams int `json:"net_carbs_used_estimate_grams,omitempty"`
TotalTrainingLoad int `json:"total_training_load,omitempty"`
Context string `json:"context"`
}
type RecentActivitiesArgs ¶
type RecentActivitiesArgs struct {
Oldest string `json:"oldest,omitempty" jsonschema:"Optional local start date or datetime. Defaults to 14 days ago."`
Newest string `json:"newest,omitempty" jsonschema:"Optional local end date or datetime. Defaults to today."`
Limit int `json:"limit,omitempty" jsonschema:"Maximum number of activities to return. Defaults to 10, max 50."`
}
type RecoveryArgs ¶
type RecoveryArgs struct {
Date string `json:"date,omitempty" jsonschema:"Optional local date in YYYY-MM-DD format. Defaults to today in the athlete timezone."`
}
type RecoveryContext ¶
type SearchArgs ¶
type SearchArgs struct {
Query string `` /* 129-byte string literal not displayed */
}
type SearchRecord ¶
type SearchResult ¶
type SearchResult struct {
Query string `json:"query,omitempty"`
Results []SearchRecord `json:"results"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(client IntervalsClient) *Service
func (*Service) Calendar ¶
func (s *Service) Calendar(ctx context.Context, args CalendarArgs) (CalendarContext, error)
func (*Service) RecentActivities ¶
func (s *Service) RecentActivities(ctx context.Context, args RecentActivitiesArgs) (ActivitiesContext, error)
func (*Service) Recovery ¶
func (s *Service) Recovery(ctx context.Context, args RecoveryArgs) (RecoveryContext, error)
func (*Service) Search ¶
func (s *Service) Search(ctx context.Context, args SearchArgs) (SearchResult, error)
func (*Service) TodayContext ¶
type TodayArgs ¶
type TodayArgs struct {
Date string `json:"date,omitempty" jsonschema:"Optional local date in YYYY-MM-DD format. Defaults to today in the athlete timezone."`
}
type TodayContext ¶
type TodayContext struct {
Date string `json:"date"`
Timezone string `json:"timezone,omitempty"`
Athlete *intervals.Athlete `json:"athlete,omitempty"`
Recovery *intervals.Wellness `json:"recovery,omitempty"`
Summary *intervals.Summary `json:"summary,omitempty"`
Activities []intervals.Activity `json:"activities"`
LastActivity *intervals.Activity `json:"last_activity,omitempty"`
PlannedEvents []intervals.Event `json:"planned_events"`
Nutrition NutritionContext `json:"nutrition_context"`
Notes []string `json:"notes,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.