Documentation ¶
Index ¶
- func DeleteDir(dirName string) error
- func ErrorJsonResponse(w http.ResponseWriter, status int, err error)
- func ExistUserID(userID string) (bool, error)
- func GenerateRandomScore() float32
- func GenerateRoomID(digits int, id string) (string, error)
- func GenerateToken(id ulid.ULID) (string, error)
- func GenerateUserUniqueID() ulid.ULID
- func GetEnv(keys ...string) map[string]string
- func GetEnvVar(name string) string
- func GetPhotoDescription(photoUrl string) (descriptionJa []string, descriptionEn []string, err error)
- func GetPhotoScore(gameMasterPhotoUrl string, playerPhotoUrl1 string, playerPhotoUrl2 string) (string, error)
- func GetSubmitUnixSeconds() int
- func Init()
- func LoadImage(data []byte, fileType string) (image.Image, error)
- func MakeDir(dirName string) error
- func ParseAndValidateUser(r *http.Request, validateFuncs ...func(user model.User) error) (model.User, 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 SetUpRedisClient() (context.Context, *redis.Client)
- func SetUserTtl(id ulid.ULID, ttl int) (string, error)
- func SuccessJsonResponse(w http.ResponseWriter, status int, k string, v interface{})
- func ValidateFileType(r *http.Request) (string, error)
- func ValidateIDRequired(user model.User) error
- func ValidateLangRequired(user model.User) error
- func ValidateMaxFileSize(r *http.Request) error
- func ValidateNameRequired(user model.User) error
- func ValidateRounds(rounds string) bool
- func ValidateStatusRequired(user model.User) error
- func ValidateToken(tokenString string) (model.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorJsonResponse ¶
func ErrorJsonResponse(w http.ResponseWriter, status int, err error)
func ExistUserID ¶
func GenerateRandomScore ¶
func GenerateRandomScore() float32
GenerateRandomScore generates a random score between 10.0000 ~ 99.9999
func GenerateToken ¶
func GenerateUserUniqueID ¶
func GenerateUserUniqueID() ulid.ULID
func GetPhotoDescription ¶
func GetPhotoScore ¶
func GetSubmitUnixSeconds ¶
func GetSubmitUnixSeconds() int
func ParseAndValidateUser ¶
func SanitizeString ¶
func SetUpRedisClient ¶
func SetUserTtl ¶
func SuccessJsonResponse ¶
func SuccessJsonResponse(w http.ResponseWriter, status int, k string, v interface{})
func ValidateIDRequired ¶
func ValidateIDRequired(user model.User) error
Individual validation functions
func ValidateLangRequired ¶
func ValidateLangRequired(user model.User) error
func ValidateMaxFileSize ¶
func ValidateNameRequired ¶
func ValidateNameRequired(user model.User) error
func ValidateRounds ¶
func ValidateStatusRequired ¶
func ValidateStatusRequired(user model.User) error
func ValidateToken ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.