models

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableComponent     = ComponentType("table")
	PieChartComponent  = ComponentType("pie_chart")
	BarChartComponent  = ComponentType("bar_chart")
	LineChartComponent = ComponentType("line_chart")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Id                   int64          `json:"id" gorm:"primaryKey;autoIncrement:false"`
	ExternalId           string         `json:"external_id"`
	UploadId             int64          `json:"upload_id"`
	Name                 string         `json:"name"`
	Distance             float64        `json:"distance"`
	MovingTime           int            `json:"moving_time"`
	ElapsedTime          int            `json:"elapsed_time"`
	TotalElevationGain   float64        `json:"total_elevation_gain"`
	Type                 string         `json:"type"`
	StartDate            time.Time      `json:"start_date"`
	StartDateLocal       time.Time      `json:"start_date_local"`
	TimeZone             string         `json:"time_zone"`
	StartLocation        string         `json:"start_lat_lng"`
	EndLocation          string         `json:"end_lat_lng"`
	City                 string         `json:"location_city"`
	State                string         `json:"location_state"`
	Country              string         `json:"location_country"`
	AchievementCount     int            `json:"achievement_count"`
	KudosCount           int            `json:"kudos_count"`
	CommentCount         int            `json:"comment_count"`
	AthleteCount         int            `json:"athlete_count"`
	PhotoCount           int            `json:"photo_count"`
	Map                  datatypes.JSON `json:"map"`
	Trainer              bool           `json:"trainer"`
	Commute              bool           `json:"commute"`
	Manual               bool           `json:"manual"`
	Private              bool           `json:"private"`
	Flagged              bool           `json:"flagged"`
	AverageSpeed         float64        `json:"average_speed"`
	MaximumSpeed         float64        `json:"max_speed"`
	AverageCadence       float64        `json:"average_cadence"`
	AverageTemperature   float64        `json:"average_temp"`
	AveragePower         float64        `json:"average_watts"`
	WeightedAveragePower int            `json:"weighted_average_watts"`
	Kilojoules           float64        `json:"kilojoules"`
	DeviceWatts          bool           `json:"device_watts"`
	AverageHeartRate     float64        `json:"average_heart_rate"`
	MaximumHeartRate     float64        `json:"max_heart_rate"`
	Truncated            int            `json:"truncated"` // only present if activity is owned by authenticated athlete, returns 0 if not truncated by privacy zones
	HasKudos             bool           `json:"has_kudos"`
	AthleteID            uint           `json:"athlete_id"`
	Athlete              Athlete        `gorm:"foreignkey:AthleteID" json:"athlete"`
	GearID               string         `json:"gear_id"`
	Gear                 Gear           `gorm:"foreignkey:GearID" json:"gear"`
}

type Athlete

type Athlete struct {
	Id               int64          `json:"id" gorm:"primaryKey;autoIncrement:false"`
	FirstName        string         `json:"firstname"`
	LastName         string         `json:"lastname"`
	ProfileMedium    string         `json:"profile_medium"` // URL to a 62x62 pixel profile picture
	Profile          string         `json:"profile"`        // URL to a 124x124 pixel profile picture
	City             string         `json:"city"`
	State            string         `json:"state"`
	Country          string         `json:"country"`
	Gender           string         `json:"sex"`
	Friend           string         `json:"friend"`   // ‘pending’, ‘accepted’, ‘blocked’ or ‘null’, the authenticated athlete’s following status of this athlete
	Follower         string         `json:"follower"` // this athlete’s following status of the authenticated athlete
	Premium          bool           `json:"premium"`
	CreatedAt        time.Time      `json:"created_at"`
	UpdatedAt        time.Time      `json:"updated_at"`
	ApproveFollowers bool           `json:"approve_followers"` // if has enhanced privacy enabled
	BadgeTypeId      int            `json:"badge_type_id"`
	Stats            datatypes.JSON `json:"tx"`
}

type Component

type Component struct {
	ID        uint      `json:"id" gorm:"primarykey"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	DashboardID uint
	Dashboard   Dashboard `gorm:"foreignkey:DashboardID" json:"dashboard"`

	Name    string         `json:"name"`
	Query   string         `json:"query"`
	Type    ComponentType  `json:"type"`
	Configs datatypes.JSON `json:"configs"`
}

type ComponentType

type ComponentType string

type Config

type Config struct {
	ID        uint      `json:"-" gorm:"primarykey"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`

	ClientId     int    `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

type Dashboard

type Dashboard struct {
	ID        uint      `json:"id" gorm:"primarykey"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	Name string `json:"name"`
}

type Gear

type Gear struct {
	Id          string  `json:"id" gorm:"primaryKey;autoIncrement:false"`
	Name        string  `json:"name"`
	Primary     bool    `json:"primary"`
	Distance    float64 `json:"distance"`
	BrandName   string  `json:"brand_name"`
	ModelName   string  `json:"model_name"`
	FrameType   string  `json:"frame_type"`
	Description string  `json:"description"`
	AthleteID   int64
	Athlete     Athlete `gorm:"foreignkey:AthleteID" json:"athlete"`
}

Jump to

Keyboard shortcuts

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