Documentation ¶
Index ¶
- Constants
- func CreateDbIfNotExists() (err error)
- func CreateScraped(db *gorm.DB, scraped *models.RestaurantSnapshot) error
- func CreateUser(db *gorm.DB, username string, passwordHash string) error
- func GetUser(db *gorm.DB, username string) (models.User, error)
- func IsRecordNotFound(err error) bool
- func IsUniqueViolation(err error) bool
- func SelectSnapshotById(db *gorm.DB, id uint) (models.RestaurantSnapshot, error)
- func SelectSnapshotWith(db *gorm.DB, id uint) (models.RestaurantSnapshot, error)
- func SelectTodaysSnapshots(db *gorm.DB) ([]models.RestaurantSnapshot, error)
- func Setup() (db *gorm.DB, err error)
- func UpdateVote(db *gorm.DB, restaurantId uint, userId uint, shouldCast bool) error
- func UpdateVotedOn(db *gorm.DB, formResult *data.NewPollFormDataToServer) error
- type DayAlreadyPopulatedError
Constants ¶
View Source
const DatabaseAlreadyExistsErrorCode = "42P04"
View Source
const UniqueViolationErrorCode = "23505"
Variables ¶
This section is empty.
Functions ¶
func CreateDbIfNotExists ¶
func CreateDbIfNotExists() (err error)
func CreateScraped ¶
func CreateScraped(db *gorm.DB, scraped *models.RestaurantSnapshot) error
func IsRecordNotFound ¶
func IsUniqueViolation ¶
func SelectSnapshotById ¶
func SelectSnapshotWith ¶
func SelectTodaysSnapshots ¶
func SelectTodaysSnapshots(db *gorm.DB) ([]models.RestaurantSnapshot, error)
func UpdateVote ¶
func UpdateVotedOn ¶
func UpdateVotedOn(db *gorm.DB, formResult *data.NewPollFormDataToServer) error
Types ¶
type DayAlreadyPopulatedError ¶
type DayAlreadyPopulatedError struct {
// contains filtered or unexported fields
}
func (*DayAlreadyPopulatedError) Error ¶
func (e *DayAlreadyPopulatedError) Error() string
Click to show internal directories.
Click to hide internal directories.