Documentation ¶
Index ¶
- Variables
- func BindAndValidate(req interface{}, c echo.Context) (err error, ok bool)
- func CleanUpExpiredTokens() error
- func Contain(obj interface{}, target interface{}) bool
- func CreateBucket(name string) error
- func CreateEmptyGrades(problemSet *models.ProblemSet) error
- func FindProblem(id string, user *models.User) (*models.Problem, error)
- func FindSubmission(id uint, includeProblemSet bool) (*models.Submission, error)
- func FindTestCase(problemId string, testCaseIdStr string, user *models.User) (*models.TestCase, *models.Problem, error)
- func FindUser(id string) (*models.User, error)
- func GenerateInviteCode() (code string)
- func GetPresignedURL(bucket string, path string, fileName string) (string, error)
- func GetTestMessages() []*mail.Message
- func GetToken(tokenString string) (token models.Token, err error)
- func HashPassword(password string) (hashed string)
- func InitOrigin()
- func IsTokenExpired(token models.Token) bool
- func MustGetObject(c echo.Context, bucket string, path string) *minio.Object
- func MustPutObject(object *multipart.FileHeader, ctx context.Context, bucket string, path string)
- func Paginator(query *gorm.DB, limit, offset int, requestURL *url.URL, output interface{}) (total int, prevUrl, nextUrl *string, err error)
- func PanicIfDBError(db *gorm.DB, message string)
- func RandStr(n int) string
- func RefreshGrades(problemSet *models.ProblemSet) error
- func SendMail(address string, subject string, message string) error
- func SetTest()
- func Sorter(query *gorm.DB, orderBy string, columns ...string) (*gorm.DB, error)
- func UpdateGrade(submission *models.Submission) error
- func VerifyPassword(password, hashed string) bool
- type DialSender
- type HttpError
Constants ¶
This section is empty.
Variables ¶
View Source
var Origins []string
View Source
var RememberMeTimeout time.Duration
View Source
var SessionCount int
View Source
var SessionTimeout time.Duration
Functions ¶
func BindAndValidate ¶
func CleanUpExpiredTokens ¶
func CleanUpExpiredTokens() error
TODO: Use this function in timed tasks
func CreateBucket ¶
func CreateEmptyGrades ¶
func CreateEmptyGrades(problemSet *models.ProblemSet) error
func FindProblem ¶
This function checks if the user has permission to get problems which are not public. nil user pointer is regarded as admin(skip the permission judgement).
func FindSubmission ¶
func FindSubmission(id uint, includeProblemSet bool) (*models.Submission, error)
func FindTestCase ¶
func FindTestCase(problemId string, testCaseIdStr string, user *models.User) (*models.TestCase, *models.Problem, error)
This function checks if the user has permission to get problems which are not public. nil user pointer is regarded as admin(skip the permission judgement).
func GenerateInviteCode ¶
func GenerateInviteCode() (code string)
func GetPresignedURL ¶
func GetTestMessages ¶
func HashPassword ¶
func InitOrigin ¶
func InitOrigin()
func IsTokenExpired ¶
func MustGetObject ¶
func MustPutObject ¶
func PanicIfDBError ¶
func RefreshGrades ¶
func RefreshGrades(problemSet *models.ProblemSet) error
func UpdateGrade ¶
func UpdateGrade(submission *models.Submission) error
func VerifyPassword ¶
Types ¶
type DialSender ¶
Click to show internal directories.
Click to hide internal directories.