Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DummyMiddleware ¶
func DummyMiddleware(next http.HandlerFunc) http.HandlerFunc
DummyMiddleware is middleware that does nothing. It is used to wrap the go-chi/httprate limiter around a handler.
Types ¶
type Credentials ¶
Credentials represents the user credentials.
type CredentialsChange ¶
CredentialsChange represents the user credentials for changing passwords.
type CredentialsReset ¶
type CredentialsReset struct {
Code string `json:"code"`
Email string `json:"email"`
Password string `json:"password"`
}
CredentialsReset represents the user credentials for resetting password.
type DatabaseBackend ¶
type DatabaseBackend string
DatabaseBackend is the type of database backend to use.
type GradeData ¶
type GradeData struct {
CourseCode string `json:"code"`
ProfUUID string `json:"uuid"`
GradeTeaching float32 `json:"teaching"`
GradeCoursework float32 `json:"coursework"`
GradeLearning float32 `json:"learning"`
}
GradeData contains data needed to grade a course.
type Handler ¶
type Handler struct {
Handlers []struct {
Path string `json:"path"`
PathType string `json:"pathType"`
Handler string `json:"handler"`
Limiter string `json:"limiter"`
Method string `json:"method"`
} `json:"handlers"`
}
Handler holds data for a handler.
type HandlerInfo ¶
type HandlerInfo struct {
// contains filtered or unexported fields
}
HandlerInfo represents a struct containing information about an HTTP handler.
type RunCfg ¶ added in v0.6.0
type RunCfg struct {
Port string // Port on which the server will run.
DbUrl string // Path to the SQLite database file.
DbBackend DatabaseBackend // Database backend type.
CacheDbUrl string // URL to the redis cache database.
CacheTtl int // Time-to-live of the cache in seconds.
UsersDbPath string // Path to the users BOLT database file.
AllowedOrigins []string // List of allowed origins for CORS.
AllowedMailDomains []string // List of allowed mail domains for registering with the service.
PasswordResetUrl string // URL to the password reset website page.
NoMail bool // Whether to enable mail services.
SmtpEnvPath string // Path to the .env file containing SMTP configuration.
UseSmtp bool // Whether to use SMTP (false for SMTPS).
UseHttp bool // Whether to use HTTP (false for HTTPS).
HandlersFilePath string // Handler config json file.
CertFilePath string // Path to the certificate file (required for HTTPS).
KeyFilePath string // Path to the key file (required for HTTPS).
CookieTimeout int // Duration in minute after which a session cookie expires.
CodeValidityMinute int // Duration in minute after which a code is invalid.
CodeLength int // Length of generated codes.
MinPasswordScore int // Minimum acceptable score of a password scores computed by zxcvbn.
LogLevel LogLevel // Log level.
}
RunCfg defines the server's configuration.
Click to show internal directories.
Click to hide internal directories.