Documentation ¶
Index ¶
- func ContextGetUserID(r *http.Request) *string
- func ContextSetUserID(r *http.Request, uid *string) *http.Request
- func ValidateUserPreferences(v *validator.Validator, pref *UsersPreferences)
- type Service
- type UsersPreferences
- type UsersPreferencesModel
- func (m UsersPreferencesModel) DeleteUsersPreferencesByUID(uid string) error
- func (m UsersPreferencesModel) GetUsersPreferencesByUID(uid string) (*UsersPreferences, error)
- func (m UsersPreferencesModel) InsertUsersPreferences(userPreferences *UsersPreferences) error
- func (m UsersPreferencesModel) UpdateUsersPreferences(userPreferences *UsersPreferences) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextGetUserID ¶
func ValidateUserPreferences ¶
func ValidateUserPreferences(v *validator.Validator, pref *UsersPreferences)
Types ¶
type Service ¶
type Service struct { Models UsersPreferencesModel Logger *slog.Logger FirebaseApp *firebase.App }
func NewService ¶
func (*Service) DeleteUsersPreferencesHandler ¶
func (as *Service) DeleteUsersPreferencesHandler(w http.ResponseWriter, r *http.Request)
func (*Service) GetUsersPreferencesHandler ¶
func (us *Service) GetUsersPreferencesHandler(w http.ResponseWriter, r *http.Request)
func (*Service) UpdateUsersPreferencesHandler ¶
func (us *Service) UpdateUsersPreferencesHandler(w http.ResponseWriter, r *http.Request)
type UsersPreferences ¶
type UsersPreferences struct { UID string `json:"uid"` ShowScores bool `json:"showScores"` FavoriteTeams []int64 `json:"favoriteTeams"` FavoriteCompetitions []int64 `json:"favoriteCompetitions"` Timezone string `json:"timezone"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Version int `json:"version"` }
type UsersPreferencesModel ¶
func (UsersPreferencesModel) DeleteUsersPreferencesByUID ¶
func (m UsersPreferencesModel) DeleteUsersPreferencesByUID(uid string) error
func (UsersPreferencesModel) GetUsersPreferencesByUID ¶
func (m UsersPreferencesModel) GetUsersPreferencesByUID(uid string) (*UsersPreferences, error)
func (UsersPreferencesModel) InsertUsersPreferences ¶
func (m UsersPreferencesModel) InsertUsersPreferences(userPreferences *UsersPreferences) error
func (UsersPreferencesModel) UpdateUsersPreferences ¶
func (m UsersPreferencesModel) UpdateUsersPreferences(userPreferences *UsersPreferences) error
Click to show internal directories.
Click to hide internal directories.