structs

package
v0.0.0-...-f47b430 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserSuccessfulRegistrationResponse = struct {
		Message string `json:"message"`
	}{
		Message: "Account registered successfully. Please verify your email to add the email to your profile.",
	}

	EmailSuccessfulVerificationResponse = struct {
		Message string `json:"message"`
	}{
		Message: "Email verified successfully.",
	}
)

Functions

This section is empty.

Types

type AddTagOption

type AddTagOption struct {
	TagName string `json:"tagName"`
}

type CreateProblemOption

type CreateProblemOption struct {
	Title string `json:"title" validate:"required"`
}

type DatasetOption

type DatasetOption struct {
	Title    string `json:"title"`
	Weight   int64  `json:"weight"`
	IsSample bool   `json:"isSample"`
}

func (*DatasetOption) NewModelDatasetFormat

func (d *DatasetOption) NewModelDatasetFormat(inputFile, outputFile *multipart.FileHeader, pid, userid uint) (*models.Dataset, error)

type DiscussionOption

type DiscussionOption struct {
	Message string `json:"message"`
}

type ProblemUserRelation

type ProblemUserRelation struct {
	Username  string            `json:"username"`
	Role      models.PermitType `json:"role"`
	ProblemID uint              `json:"problemID"`
}

func NewProblemUserRelation

func NewProblemUserRelation(problemShare *models.ProblemShare) *ProblemUserRelation

type RenewTokenResponse

type RenewTokenResponse struct {
	User                 *UserResponse `json:"user"`
	AccessToken          string        `json:"accessToken"`
	AccessTokenExpiresAt time.Time     `json:"accessTokenExpiresAt"`
}

func NewRenewTokenResponse

func NewRenewTokenResponse(u *models.User, accessTokenInfo *token.TokenInfo) *RenewTokenResponse

type RequestedUser

type RequestedUser struct {
	Username string `json:"username"`
	Email    string `json:"email"`
}

type ShareProblemOption

type ShareProblemOption struct {
	ShareWith  string            `json:"shareWith"`
	PermitType models.PermitType `json:"permitType"`
}

type SolutionOption

type SolutionOption struct {
	Code     string `json:"code"`
	Language string `json:"language"`
}

type SolutionResponse

type SolutionResponse struct {
	ID                  uint                 `json:"ID"`
	Code                string               `json:"code"`
	Language            string               `json:"language"`
	LastExecuted        *time.Time           `json:"lastExecuted,omitempty"`
	TimeTaken           *float64             `json:"timeTaken,omitempty"`
	MemoryTaken         *float64             `json:"memoryTaken,omitempty"`
	ProblemUserRelation *ProblemUserRelation `json:"problemUserRelation"`
}

func NewSolutionResponse

func NewSolutionResponse(solution *models.ProblemSolution, problemShare *models.ProblemShare) *SolutionResponse

type UpdateProblemOption

type UpdateProblemOption struct {
	TimeLimit                         float64            `json:"timeLimit"`
	MemoryLimit                       float64            `json:"memoryLimit"`
	Statement                         string             `json:"statement"`
	InputStatement                    string             `json:"inputStatement"`
	OutputStatement                   string             `json:"outputStatement"`
	NoteStatement                     string             `json:"noteStatement"`
	StatementsVisibilityDuringContest bool               `json:"statementsVisibilityDuringContest"`
	CheckerType                       models.CheckerType `json:"checkerType"`
}

func (*UpdateProblemOption) UpdateProblemModelFormat

func (p *UpdateProblemOption) UpdateProblemModelFormat(user *models.User, ID uint) *models.Problem

type UserLoginRequest

type UserLoginRequest struct {
	Username string `json:"username"`
	Email    string `json:"email" validate:"email"`
	Password string `json:"password" validate:"required,min=6"`
}

type UserLoginResponse

type UserLoginResponse struct {
	User                  *UserResponse `json:"User"`
	AccessToken           string        `json:"AccessToken"`
	AccessTokenExpiresAt  time.Time     `json:"AccessTokenExpiresAt"`
	RefreshToken          string        `json:"RefreshToken"`
	RefreshTokenExpiresAt time.Time     `json:"RefreshTokenExpiresAt"`
}

func NewLoginResponse

func NewLoginResponse(u *models.User, accessTokenInfo, refreshTokenInfo *token.TokenInfo) *UserLoginResponse

type UserRegisterRequest

type UserRegisterRequest struct {
	Username string `json:"username" validate:"required"`
	Email    string `json:"email" validate:"email"`
	Password string `json:"password" validate:"required,min=6"`
}

type UserResponse

type UserResponse struct {
	ID           uint   `json:"id"`
	Username     string `json:"username"`
	Email        string `json:"email"`
	DisplayName  string `json:"displayName"`
	Organization string `json:"organization"`
	Country      string `json:"country"`
	City         string `json:"city"`
	Image        string `json:"image"`
}

func NewUserResponse

func NewUserResponse(u *models.User) *UserResponse

type UserUpdatePasswordRequest

type UserUpdatePasswordRequest struct {
	OldPassword string `json:"old_password" validate:"required,min=6"`
	NewPassword string `json:"new_password" validate:"required,min=6"`
}

type UserUpdateRequest

type UserUpdateRequest struct {
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	Organization string `json:"organization"`
	Country      string `json:"country"`
	City         string `json:"city"`
	Image        string `json:"image"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL