Documentation ¶
Index ¶
- func SendMail(config SMTPConfiguration, to []string, subject string, body string) error
- func SetUnique(ctx context.Context, collection *mongo.Collection, field string) (string, error)
- type App
- type Configuration
- type IOExample
- type LocalizedStrings
- type NotFoundFallbackRespWr
- type Problem
- type ProblemTag
- type SMTPConfiguration
- type Subtask
- type TestCase
- type User
- func (user *User) CheckPassword(password string) bool
- func (user *User) Create(ctx context.Context, collection *mongo.Collection) (*mongo.InsertOneResult, error)
- func (User) Get(ctx context.Context, collection *mongo.Collection, filter any) (user User, err error)
- func (user *User) Save(ctx context.Context, collection *mongo.Collection) (any, error)
- func (user *User) SetPassword(password string) (err error)
- func (user *User) Update(ctx context.Context, collection *mongo.Collection) (*mongo.UpdateResult, error)
- type UserWithPasswordAndVerification
- type UsernameAndPassword
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { Configuration ServeMux *http.ServeMux Database *mongo.Database Redis *redis.Client Root string Fallback string }
func (App) HandleProblems ¶
func (app App) HandleProblems()
func (App) HandleUsers ¶
func (app App) HandleUsers()
type Configuration ¶
type Configuration struct {
SMTP SMTPConfiguration
}
type LocalizedStrings ¶
type NotFoundFallbackRespWr ¶
type NotFoundFallbackRespWr struct { http.ResponseWriter // We embed http.ResponseWriter // contains filtered or unexported fields }
func (*NotFoundFallbackRespWr) Write ¶
func (w *NotFoundFallbackRespWr) Write(p []byte) (int, error)
func (*NotFoundFallbackRespWr) WriteHeader ¶
func (w *NotFoundFallbackRespWr) WriteHeader(status int)
type Problem ¶
type Problem struct { ObjectId primitive.ObjectID `json:"_id" bson:"_id"` ID int `json:"id"` Title LocalizedStrings `json:"title"` Difficulty int `json:"difficulty"` InputFile string `json:"input_file" bson:"inputFile"` OutputFile string `json:"output_file" bson:"outputFile"` TimeLimit int `json:"time_limit" bson:"timeLimit"` MemoryLimit int `json:"memory_limit" bson:"memoryLimit"` Background LocalizedStrings `json:"background"` Description LocalizedStrings `json:"description"` InputFormat LocalizedStrings `json:"input_format" bson:"inputFormat"` OutputFormat LocalizedStrings `json:"output_format" bson:"outputFormat"` Examples []IOExample `json:"examples"` Hints LocalizedStrings `json:"hints"` Tags []ProblemTag `json:"tags"` Subtasks []Subtask `json:"subtasks"` }
type ProblemTag ¶
type ProblemTag string
type SMTPConfiguration ¶
type User ¶
type User struct { ObjectId primitive.ObjectID `json:"_id" bson:"_id"` Username string `json:"username"` Password []byte `json:"-"` Email string `json:"email"` }
func (*User) CheckPassword ¶
func (*User) Create ¶
func (user *User) Create(ctx context.Context, collection *mongo.Collection) (*mongo.InsertOneResult, error)
func (*User) SetPassword ¶
func (*User) Update ¶
func (user *User) Update(ctx context.Context, collection *mongo.Collection) (*mongo.UpdateResult, error)
type UsernameAndPassword ¶
Click to show internal directories.
Click to hide internal directories.