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 ¶ added in v0.4.4
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 { Path string // Path specifies the URL pattern for which the handler is responsible. Handler func(http.ResponseWriter, *http.Request) // Handler is the function that will be called to handle HTTP requests. Method string // Method specifies the HTTP method associated with the handler. PathType PathType // PathType is the type of the path (admin, user, public). // contains filtered or unexported fields }
HandlerInfo represents a struct containing information about an HTTP handler.
type RunConfig ¶
type RunConfig struct { Port string // Port on which the server will run. DbURL string // Path to the SQLite database file. DbBackend DatabaseBackend // Database backend type. LogLevel LogLevel // Log level. UsersDBPath string // Path to the users BOLT database file. SMTPEnvPath string // Path to the .env file containing SMTP cfguration. PasswordResetWebsiteURL string // URL to the password reset website page. AllowedOrigins []string // List of allowed origins for CORS. AllowedMailDomains []string // List of allowed mail domains for registering with the service. UseSMTP bool // Whether to use SMTP (false for SMTPS). UseHTTP bool // Whether to use HTTP (false for HTTPS). 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. HandlerCfg string // Handler config json file. }
RunConfig defines the server's confiuration.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.