MCPcopy Create free account
hub / github.com/Cawlumm/lyftr / Get

Method Get

backend/stores/program.go:70–83  ·  view source on GitHub ↗

Get returns a user-owned program with its exercises/sets, or sql.ErrNoRows.

(uid, id int64)

Source from the content-addressed store, hash-verified

68 return nil, err
69 }
70 programs[i].Days = days
71 }
72 idxByID, err := s.currentDayIndex(uid, programs)
73 if err != nil {
74 return nil, err
75 }
76 for i := range programs {
77 programs[i].CurrentDayIndex = idxByID[programs[i].ID]
78 }
79 return programs, nil
80}
81
82// Get returns a user-owned program with its days/exercises/sets, or sql.ErrNoRows.
83func (s *ProgramStore) Get(uid, id int64) (models.Program, error) {
84 var p models.Program
85 if err := scanProgram(
86 s.db.QueryRow(`SELECT `+programCols+` FROM programs WHERE id = ? AND user_id = ?`, id, uid), &p,

Callers

nothing calls this directly

Calls 2

loadExercisesMethod · 0.95
scanProgramFunction · 0.85

Tested by

no test coverage detected