Documentation
¶
Index ¶
- func CSRFMiddleware(store sessions.Store) func(http.Handler) http.Handler
- func MinifyCSS(src string) string
- func MinifyHTML(src string) string
- func MinifyJS(src string) string
- func NewStaticServer(staticFS fs.FS) (http.Handler, error)
- func RateLimitMiddleware(valkeyClient *redis.Client, max int, duration time.Duration) func(http.Handler) http.Handler
- func RequestIDMiddleware(next http.Handler) http.Handler
- func RequestLoggerMiddleware(next http.Handler) http.Handler
- func RequireAuth(store sessions.Store) func(http.Handler) http.Handler
- func SecurityHeadersMiddleware(env string) func(http.Handler) http.Handler
- type AdminHandlers
- type ContextKey
- type EarlyRateLimiter
- type Handlers
- func (h *Handlers) DeleteAccount(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) GetPlatforms(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) GoogleCallback(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) GoogleLogin(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) Logout(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) ManualSync(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) Me(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) SavePreferences(w http.ResponseWriter, r *http.Request)
- type MemoryFS
- type StaticFile
- type ValkeyStore
- type VelocityCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MinifyHTML ¶ added in v1.3.0
func RateLimitMiddleware ¶
Types ¶
type AdminHandlers ¶
type AdminHandlers struct {
Scheduler *scheduler.Scheduler
AdminPassword string
DB *pgxpool.Pool
ReadDB *pgxpool.Pool
Valkey *redis.Client
Queue *queue.Queue
}
func (*AdminHandlers) HealthCheck ¶
func (h *AdminHandlers) HealthCheck(w http.ResponseWriter, r *http.Request)
func (*AdminHandlers) SyncAll ¶
func (h *AdminHandlers) SyncAll(w http.ResponseWriter, r *http.Request)
func (*AdminHandlers) UpdateContests ¶
func (h *AdminHandlers) UpdateContests(w http.ResponseWriter, r *http.Request)
type ContextKey ¶
type ContextKey string
const ( ContextKeyUserID ContextKey = "user_id" ContextKeyRequestID ContextKey = "request_id" )
type EarlyRateLimiter ¶ added in v1.4.9
type EarlyRateLimiter struct {
// contains filtered or unexported fields
}
func NewEarlyRateLimiter ¶ added in v1.4.9
func NewEarlyRateLimiter() *EarlyRateLimiter
type Handlers ¶
type Handlers struct {
DB *pgxpool.Pool
ReadDB *pgxpool.Pool
SessionStore sessions.Store
AuthProvider *auth.Provider
EncryptionKey []byte
Queue *queue.Queue
Valkey *redis.Client
Env string
CleanupWG sync.WaitGroup
}
func (*Handlers) DeleteAccount ¶
func (h *Handlers) DeleteAccount(w http.ResponseWriter, r *http.Request)
func (*Handlers) GetPlatforms ¶
func (h *Handlers) GetPlatforms(w http.ResponseWriter, r *http.Request)
func (*Handlers) GoogleCallback ¶
func (h *Handlers) GoogleCallback(w http.ResponseWriter, r *http.Request)
func (*Handlers) GoogleLogin ¶
func (h *Handlers) GoogleLogin(w http.ResponseWriter, r *http.Request)
func (*Handlers) Logout ¶ added in v1.5.6
func (h *Handlers) Logout(w http.ResponseWriter, r *http.Request)
func (*Handlers) ManualSync ¶
func (h *Handlers) ManualSync(w http.ResponseWriter, r *http.Request)
func (*Handlers) SavePreferences ¶
func (h *Handlers) SavePreferences(w http.ResponseWriter, r *http.Request)
type StaticFile ¶ added in v1.3.0
type ValkeyStore ¶
type ValkeyStore struct {
// contains filtered or unexported fields
}
func NewValkeyStore ¶
func NewValkeyStore(client *redis.Client, env string, keyPairs ...[]byte) *ValkeyStore
func (*ValkeyStore) Save ¶
func (s *ValkeyStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
type VelocityCounter ¶ added in v1.4.9
type VelocityCounter struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.