Documentation
¶
Index ¶
- Constants
- func AwardPoints(uuid string, points int) error
- func CreateUser(u *models.User, password string) (int, error)
- func GetActiveImagesWithAssociatedUsers(page, amount int) (int, []*models.ManifestEntry, *dbmdl.Pagination)
- func GetLeaderboard(a int) []*models.LeaderboardEntry
- func GetUUID(r *http.Request) (string, error)
- func GetUser(uuid string) *models.User
- func GetUserImages(uuid string, page, amount int) (int, []*models.Image, *dbmdl.Pagination)
- func GuessImage(uuidUser, uuidImage string, coords *models.Coordinates) bool
- func ParseImage(file []byte) (*image.Image, error)
- func VerifyFileType(f []byte, types ...string) bool
- func VerifyImageSize(img *image.Image, width int, height int) bool
- func WriteImage(w io.Writer, img *image.Image, encoding string) (string, error)
Constants ¶
View Source
const ( JPEG = "image/jpeg" PNG = "image/png" )
Define some macro constants
Variables ¶
This section is empty.
Functions ¶
func AwardPoints ¶
AwardPoints gives points to a user
func CreateUser ¶
CreateUser creates a new user in the database Returns a http status code and possibly an error
func GetActiveImagesWithAssociatedUsers ¶
func GetActiveImagesWithAssociatedUsers(page, amount int) (int, []*models.ManifestEntry, *dbmdl.Pagination)
GetActiveImagesWithAssociatedUsers returns a manifest of images
func GetLeaderboard ¶
func GetLeaderboard(a int) []*models.LeaderboardEntry
GetLeaderboard returns a leaderboard ordered by points desc
func GetUserImages ¶
GetUserImages returns a manifest of images uploaded by a single user, active or not
func GuessImage ¶
func GuessImage(uuidUser, uuidImage string, coords *models.Coordinates) bool
GuessImage checks whether the image was guessed correctrly
func ParseImage ¶
ParseImage treats a file as an image
func VerifyFileType ¶
VerifyFileType checks whether a file type is what we expect
func VerifyImageSize ¶
VerifyImageSize verified whether an image is of proper size (px)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.