Documentation ¶
Index ¶
- Variables
- func AddUserPhoto(roomID string, userID string, photoURL string) error
- func ChangeGameMaster(roomID string, userID string) error
- func CreateRoom(roomID string, user model.User) error
- func DeleteDir(dirName string) error
- func DeleteRoom(roomID string, userID string) error
- func ErrorJsonResponse(w http.ResponseWriter, status int, err error)
- func ExitRoom(roomID string, userID string) error
- func GeneratePhotoDescription(photoUrl string) (description model.PhotoDescription, err error)
- func GenerateRandomScore() float32
- func GenerateRoomID(digits int, id string) (string, error)
- func GenerateToken(id string) (string, error)
- func GetEnv(keys ...string) map[string]string
- func GetEnvVar(name string) string
- func GetGameMaster(roomID string, userID string) (string, error)
- func GetGameMasterPhotoUrl(roomID string, gameMasterID string) (string, error)
- func GetGameRounds(roomID string) (int, error)
- func GetGameStatus(roomID string) (*model.GameStatus, error)
- func GetNoGameMasterID(roomID string, gameMasterID string) (string, error)
- func GetPhotoDescription(roomID string) ([]model.PhotoDescription, error)
- func GetPlayerPhotoUrls(roomID string, userID string) ([]string, error)
- func GetRoomUsers(roomID string) (*model.RoomUsers, error)
- func GetScore(gameMasterPhotoUrl string, playerPhotoUrl1 string, playerPhotoUrl2 string) (float32, error)
- func GetScoreIndex(roomID string, userID string) (int, error)
- func GetSubmitUnixSeconds() int
- func GetTotalPlayers(roomID string) (int, error)
- func GetUserIDs(roomID string) ([]string, error)
- func GetUserValue(userID string) (string, error)
- func IncrementCurrentRound(roomID string) error
- func Init()
- func IsRoomExist(roomID string) (bool, error)
- func IsUserInRoom(userID string, roomID string) (bool, error)
- func JoinRoom(user model.User) error
- func LoadImage(data []byte, fileType string) (image.Image, error)
- func MakeDir(dirName string) error
- func ReadFormFile(r *http.Request) ([]byte, error)
- func Resize(data []byte, maxHeight int) []byte
- func SanitizeString(input string) string
- func SaveFile(data []byte, path string, extension string) (string, error)
- func SetPhotoDescription(roomID string, description model.PhotoDescription) error
- func SetScore(roomID string, userID string, score float32) error
- func SetUserID(userID string) error
- func SetUserScore(roomID string, userID string) error
- func SetUserValue(userID string, value string) error
- func SuccessJsonResponse(w http.ResponseWriter, res interface{})
- func UpdateGameStatus(roomID string, status string) error
- func UpdateRounds(roomID string, rounds string) error
- func UpdateUsername(roomID string, userID string, newUserName string) error
- func Validate(r *http.Request, validateFuncs ...func(user model.User) error) (model.User, error)
- func ValidateFileType(r *http.Request) (string, error)
- func ValidateLang(user model.User) error
- func ValidateMaxFileSize(r *http.Request) error
- func ValidateName(user model.User) error
- func ValidateNewGameMaster(user model.User) error
- func ValidateRoom(user model.User) error
- func ValidateRounds(user model.User) error
- func ValidateToken(ctx context.Context, tokenString string) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TokenKey = &tokenContextKey{}
)
Functions ¶
func ChangeGameMaster ¶
func CreateRoom ¶
func DeleteRoom ¶
func ErrorJsonResponse ¶
func ErrorJsonResponse(w http.ResponseWriter, status int, err error)
func GenerateRandomScore ¶
func GenerateRandomScore() float32
GenerateRandomScore generates a random score between 10.0000 ~ 99.9999
func GenerateToken ¶
func GetGameMasterPhotoUrl ¶
func GetGameRounds ¶
func GetGameStatus ¶
func GetPhotoDescription ¶
func GetRoomUsers ¶
func GetSubmitUnixSeconds ¶
func GetSubmitUnixSeconds() int
func GetTotalPlayers ¶
func GetUserIDs ¶
func GetUserValue ¶
func IncrementCurrentRound ¶
func IsRoomExist ¶
func SanitizeString ¶
func SetPhotoDescription ¶
func SetUserScore ¶
func SetUserValue ¶
func SuccessJsonResponse ¶
func SuccessJsonResponse(w http.ResponseWriter, res interface{})
func UpdateGameStatus ¶
func UpdateRounds ¶
func ValidateLang ¶
func ValidateLang(user model.User) error
func ValidateMaxFileSize ¶
func ValidateName ¶
func ValidateName(user model.User) error
func ValidateNewGameMaster ¶
func ValidateNewGameMaster(user model.User) error
func ValidateRoom ¶
func ValidateRoom(user model.User) error
func ValidateRounds ¶
func ValidateRounds(user model.User) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.