Documentation
¶
Index ¶
- Constants
- Variables
- type APIResponse
- type App
- func (a *App) BackgroundWorker()
- func (a *App) Configure() error
- func (a *App) ConfigureDatabase() error
- func (a *App) ConfigureGeocoder() error
- func (a *App) ConfigureLocalizer() error
- func (a *App) ConfigureLogger()
- func (a *App) ConfigureWebserver() error
- func (a *App) ReadConfiguration() error
- func (a *App) ResetConfiguration() error
- func (a *App) Serve() error
- func (a *App) UpdateWorkout(i int) error
- func (a *App) ValidateAPIKeyMiddleware(key string, c echo.Context) (bool, error)
- func (a *App) ValidateAdminMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func (a *App) ValidateUserMiddleware(ctx echo.Context)
- type ManualWorkout
- type Template
- type Version
Constants ¶
View Source
const ( FileAddDelay = -1 * time.Minute WorkerDelay = 1 * time.Minute )
View Source
const ( BrowserLanguage = "browser" DefaultTotalsShow = database.WorkoutTypeRunning )
Variables ¶
View Source
var ( ErrWorker = errors.New("worker error") ErrNothingImported = errors.New("nothing imported") )
View Source
var ErrInvalidAPIKey = errors.New("invalid API key")
View Source
var ErrInvalidJWTToken = errors.New("invalid JWT token")
View Source
var ErrLoginFailed = errors.New("username or password incorrect")
View Source
var ErrUserNotFound = errors.New("user not found")
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶ added in v0.11.1
type APIResponse struct {
Errors []string `json:"errors"`
Results interface{} `json:"results"`
}
type App ¶
type App struct {
Version Version
Config database.Config
Assets fs.FS
Views fs.FS
Translations fs.FS
// contains filtered or unexported fields
}
func (*App) BackgroundWorker ¶
func (a *App) BackgroundWorker()
func (*App) ConfigureDatabase ¶
func (*App) ConfigureGeocoder ¶ added in v0.15.1
func (*App) ConfigureLocalizer ¶
func (*App) ConfigureLogger ¶
func (a *App) ConfigureLogger()
func (*App) ConfigureWebserver ¶
func (*App) ReadConfiguration ¶
func (*App) ResetConfiguration ¶ added in v0.13.4
func (*App) UpdateWorkout ¶
func (*App) ValidateAPIKeyMiddleware ¶ added in v0.11.1
func (*App) ValidateAdminMiddleware ¶
func (a *App) ValidateAdminMiddleware(next echo.HandlerFunc) echo.HandlerFunc
func (*App) ValidateUserMiddleware ¶
type ManualWorkout ¶ added in v1.16.0
type ManualWorkout struct {
Name *string `form:"name"`
Date *string `form:"date"`
Location *string `form:"location"`
DurationHours *int `form:"duration_hours"`
DurationMinutes *int `form:"duration_minutes"`
DurationSeconds *int `form:"duration_seconds"`
Distance *float64 `form:"distance"`
Repetitions *int `form:"repetitions"`
Weight *float64 `form:"weight"`
Notes *string `form:"notes"`
Type *database.WorkoutType `form:"type"`
// contains filtered or unexported fields
}
func (*ManualWorkout) ToDate ¶ added in v1.16.0
func (m *ManualWorkout) ToDate() *time.Time
func (*ManualWorkout) ToDistance ¶ added in v1.17.0
func (m *ManualWorkout) ToDistance() *float64
func (*ManualWorkout) ToDuration ¶ added in v1.16.0
func (m *ManualWorkout) ToDuration() *time.Duration
func (*ManualWorkout) Update ¶ added in v1.17.0
func (m *ManualWorkout) Update(w *database.Workout)
Click to show internal directories.
Click to hide internal directories.