Documentation
¶
Index ¶
- type ArchAthleteResponse
- type ArchDataPayload
- type ArchDataResponse
- type ArchMeasurementResponse
- type ArchinisisStorage
- type Data
- type DataStore
- func (s *DataStore) DeleteMeasurementByMeasurementID(ctx context.Context, measurementID int32) (string, error)
- func (s *DataStore) GetAthleteByID(ctx context.Context, sporttiID string) (*ArchAthleteResponse, error)
- func (s *DataStore) GetDataBySporttiID(ctx context.Context, sporttiID string) (*ArchDataResponse, error)
- func (s *DataStore) GetMeasurementByMeasurementID(ctx context.Context, measurementID int32) (*ArchMeasurementResponse, error)
- func (s *DataStore) GetMeasurementsByID(ctx context.Context, sporttiID string) ([]ArchMeasurementResponse, error)
- func (s *DataStore) GetRaceReport(ctx context.Context, sporttiID string, sessionID int32) (string, error)
- func (s *DataStore) GetRaceReportSessions(ctx context.Context, sporttiID string) ([]int32, error)
- func (s *DataStore) UpsertAthleteOnly(ctx context.Context, athlete archsqlc.UpsertAthleteParams) error
- func (s *DataStore) UpsertData(ctx context.Context, payload ArchDataPayload) error
- func (s *DataStore) UpsertMeasurements(ctx context.Context, sporttiID string, ...) error
- func (s *DataStore) UpsertRaceReport(ctx context.Context, sporttiID string, sessionID int32, raceReport string) error
- type Users
- type UsersStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchAthleteResponse ¶ added in v1.3.6
type ArchAthleteResponse struct {
NationalID string `json:"national_id"`
FirstName *string `json:"first_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
Initials *string `json:"initials,omitempty"`
DateOfBirth *string `json:"date_of_birth,omitempty"`
Height *float64 `json:"height,omitempty"`
Weight *float64 `json:"weight,omitempty"`
}
type ArchDataPayload ¶
type ArchDataPayload struct {
Athlete archsqlc.UpsertAthleteParams
Measurements []archsqlc.UpsertMeasurementParams
}
type ArchDataResponse ¶
type ArchDataResponse struct {
ArchAthleteResponse
Measurements []ArchMeasurementResponse `json:"measurements"`
}
type ArchMeasurementResponse ¶
type ArchMeasurementResponse struct {
MeasurementGroupID *int32 `json:"measurement_group_id,omitempty"`
MeasurementID int32 `json:"measurement_id"`
Discipline *string `json:"discipline,omitempty"`
SessionName *string `json:"session_name,omitempty"`
Place *string `json:"place,omitempty"`
RaceID *int32 `json:"race_id,omitempty"`
StartTime *string `json:"start_time,omitempty"`
StopTime *string `json:"stop_time,omitempty"`
NbSegments *int32 `json:"nb_segments,omitempty"`
Comment *string `json:"comment,omitempty"`
}
type ArchinisisStorage ¶
type ArchinisisStorage struct {
// contains filtered or unexported fields
}
ArchinisisStorage
func NewArchinisisStorage ¶
func NewArchinisisStorage(db *sql.DB) *ArchinisisStorage
NewArchinisisStorage creates a new ArchinisisStorage instance
func (*ArchinisisStorage) Data ¶
func (s *ArchinisisStorage) Data() Data
func (*ArchinisisStorage) Ping ¶
func (s *ArchinisisStorage) Ping(ctx context.Context) error
Methods
func (*ArchinisisStorage) Users ¶
func (s *ArchinisisStorage) Users() Users
type Data ¶
type Data interface {
// Race reports
GetRaceReportSessions(ctx context.Context, sporttiID string) ([]int32, error)
GetRaceReport(ctx context.Context, sporttiID string, sessionID int32) (string, error)
UpsertRaceReport(ctx context.Context, sporttiID string, sessionID int32, raceReport string) error
// Combined athlete + measurements (POST/GET /archinisis/data)
UpsertData(ctx context.Context, payload ArchDataPayload) error
GetDataBySporttiID(ctx context.Context, sporttiID string) (*ArchDataResponse, error)
// Athlete
UpsertAthleteOnly(ctx context.Context, athlete archsqlc.UpsertAthleteParams) error
GetAthleteByID(ctx context.Context, sporttiID string) (*ArchAthleteResponse, error)
// Measurements
UpsertMeasurements(ctx context.Context, sporttiID string, measurements []archsqlc.UpsertMeasurementParams) error
GetMeasurementsByID(ctx context.Context, sporttiID string) ([]ArchMeasurementResponse, error)
GetMeasurementByMeasurementID(ctx context.Context, measurementID int32) (*ArchMeasurementResponse, error)
DeleteMeasurementByMeasurementID(ctx context.Context, measurementID int32) (string, error)
}
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
func (*DataStore) DeleteMeasurementByMeasurementID ¶ added in v1.3.6
func (*DataStore) GetAthleteByID ¶ added in v1.3.6
func (*DataStore) GetDataBySporttiID ¶
func (*DataStore) GetMeasurementByMeasurementID ¶ added in v1.3.6
func (*DataStore) GetMeasurementsByID ¶ added in v1.3.6
func (*DataStore) GetRaceReport ¶
func (*DataStore) GetRaceReportSessions ¶
func (*DataStore) UpsertAthleteOnly ¶ added in v1.3.6
func (*DataStore) UpsertData ¶
func (s *DataStore) UpsertData(ctx context.Context, payload ArchDataPayload) error
func (*DataStore) UpsertMeasurements ¶ added in v1.3.6
func (*DataStore) UpsertRaceReport ¶
func (s *DataStore) UpsertRaceReport(ctx context.Context, sporttiID string, sessionID int32, raceReport string) error
UpsertRaceReport stores one report row per (sportti_id, session_id). The report table has no unique constraint on that pair, so the upsert is an UPDATE followed by an INSERT when no row was updated, inside one transaction.
type Users ¶
type Users interface {
DeleteUserBySporttiID(ctx context.Context, sporttiID string) (string, error)
}
Interfaces
type UsersStore ¶
type UsersStore struct {
// contains filtered or unexported fields
}
func (*UsersStore) DeleteUserBySporttiID ¶
Click to show internal directories.
Click to hide internal directories.