models

package
v0.0.0-...-ff3b7a6 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArgumentNullOrEmptyError = "can't be null or empty"
	InvalidFormat            = "invalid format"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlreadyExistError

type AlreadyExistError struct {
	// contains filtered or unexported fields
}

func NewAlreadyExistError

func NewAlreadyExistError(entity, value string) *AlreadyExistError

func (*AlreadyExistError) Error

func (v *AlreadyExistError) Error() string

type Claims

type Claims struct {
	jwt.StandardClaims
	UserId   string
	Username string
}

type ConfirmVisit

type ConfirmVisit struct {
	WorkoutVisitId string
	Comment        *string
	WorkoutDate    *time.Time
}

type Exercise

type Exercise struct {
	Name             string
	ShortDescription *string
	Owner            string
	Complex          []*Exercise
	// contains filtered or unexported fields
}

func (*Exercise) FillForCreate

func (entity *Exercise) FillForCreate()

func (*Exercise) FillForUpdate

func (entity *Exercise) FillForUpdate()

type NoRightsOnEntityError

type NoRightsOnEntityError struct {
	// contains filtered or unexported fields
}

func NewNoRightsOnEntityError

func NewNoRightsOnEntityError(entity, value string) *NoRightsOnEntityError

func (*NoRightsOnEntityError) Error

func (v *NoRightsOnEntityError) Error() string

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func NewNotFoundByIdError

func NewNotFoundByIdError(entity, valueColumn string) *NotFoundError

func NewNotFoundError

func NewNotFoundError(entity, valueColumn, searchColumn string) *NotFoundError

func (*NotFoundError) Error

func (v *NotFoundError) Error() string

type ParamError

type ParamError struct {
	Name   string `json:"name"`
	Reason string `json:"reason"`
}

type User

type User struct {
	Username string
	Password string
	Name     *string
	Gender   *UserGender
	Height   *int
	// contains filtered or unexported fields
}

func (*User) FillForCreate

func (entity *User) FillForCreate()

func (*User) FillForUpdate

func (entity *User) FillForUpdate()

type UserGender

type UserGender int
const (
	UserGenderMale   UserGender = iota
	UserGenderFemale UserGender = iota
)

type UserStatistic

type UserStatistic struct {
	WorkoutsPerMonth int
	WorkoutsPerYear  int
	Weight           []*UserWeight
	// contains filtered or unexported fields
}

func (*UserStatistic) FillForCreate

func (entity *UserStatistic) FillForCreate()

func (*UserStatistic) FillForUpdate

func (entity *UserStatistic) FillForUpdate()

type UserWeight

type UserWeight struct {
	User   string
	Weight float32
	Date   time.Time
	// contains filtered or unexported fields
}

func (*UserWeight) FillForCreate

func (entity *UserWeight) FillForCreate()

func (*UserWeight) FillForUpdate

func (entity *UserWeight) FillForUpdate()

type UserWorkout

type UserWorkout struct {
	UserId      string
	WorkoutPlan *WorkoutPlan
	Active      bool
	Schedule    []time.Weekday
	// contains filtered or unexported fields
}

func (*UserWorkout) FillForCreate

func (entity *UserWorkout) FillForCreate()

func (*UserWorkout) FillForUpdate

func (entity *UserWorkout) FillForUpdate()

type ValidationError

type ValidationError struct {
	Errors []*ParamError
}

func (*ValidationError) AddError

func (v *ValidationError) AddError(fieldName string, validationErr error)

func (*ValidationError) Error

func (v *ValidationError) Error() string

func (*ValidationError) HasErrors

func (v *ValidationError) HasErrors() bool

type Workout

type Workout struct {
	CustomName        *string
	CustomDescription *string
	Owner             string
	Complex           []*Exercise
	// contains filtered or unexported fields
}

func (*Workout) FillForCreate

func (entity *Workout) FillForCreate()

func (*Workout) FillForUpdate

func (entity *Workout) FillForUpdate()

type WorkoutPlan

type WorkoutPlan struct {
	Name             string
	ShortDescription *string
	Owner            string
	Repeatable       bool
	Workouts         []*Workout
	// contains filtered or unexported fields
}

func (*WorkoutPlan) FillForCreate

func (entity *WorkoutPlan) FillForCreate()

func (*WorkoutPlan) FillForUpdate

func (entity *WorkoutPlan) FillForUpdate()

type WorkoutStatistic

type WorkoutStatistic struct {
	UserWorkout   *UserWorkout
	Workout       *Workout
	WorkoutDate   *time.Time
	ScheduledDate time.Time
	Comment       *string
	// contains filtered or unexported fields
}

func (*WorkoutStatistic) FillForCreate

func (entity *WorkoutStatistic) FillForCreate()

func (*WorkoutStatistic) FillForUpdate

func (entity *WorkoutStatistic) FillForUpdate()

type WorkoutsCalendar

type WorkoutsCalendar struct {
	// Short info about history (only ids, scheduled date and workout date)
	History []*WorkoutStatistic
	// Full info about current workout
	Current *WorkoutStatistic
	// Short info about upcoming workouts (only ids and scheduled date)
	Upcoming []*WorkoutStatistic
}

Jump to

Keyboard shortcuts

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