Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                

handler

package
v0.0.0-...-9d307be Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	Manager game.Manager
	Session sessions.Store
	DB      gorm.DB
	Data    map[string]interface{}
}

Env is the shared game manager for each request.

type Error

type Error interface {
	error
	Status() int
}

Error represents a handler error. It provides methods for a HTTP status code and embeds the built-in error interface.

type HandleAdmin

type HandleAdmin struct {
	Env *Env
	H   func(e *Env, w http.ResponseWriter, r *http.Request) error
}

HandleAdmin takes both a game manager and http function.

func (HandleAdmin) ServeHTTP

func (h HandleAdmin) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HandlePublic

type HandlePublic struct {
	Env *Env
	H   func(e *Env, w http.ResponseWriter, r *http.Request) error
}

HandlePublic takes both a game manager and http function.

func (HandlePublic) ServeHTTP

func (h HandlePublic) ServeHTTP(w http.ResponseWriter, r *http.Request)

type StatusError

type StatusError struct {
	Code int
	Err  error
}

StatusError represents an error with an associated HTTP status code.

func (StatusError) Error

func (se StatusError) Error() string

Allows StatusError to satisfy the error interface.

func (StatusError) Status

func (se StatusError) Status() int

Status returns our HTTP status code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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