Documentation ¶
Index ¶
- Constants
- func ServeStatic(name string, w http.ResponseWriter, req *http.Request, mimeType string) error
- func StreamWithTimeout(w io.Writer, r io.Reader) error
- func WriteWithTimeout(w io.Writer, b []byte) error
- type Handler
- func (h *Handler) CssHandler(w http.ResponseWriter, req *http.Request)
- func (h *Handler) HealthCheckHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) IconHandler(w http.ResponseWriter, req *http.Request)
- func (h *Handler) PageHandler(w http.ResponseWriter, req *http.Request)
- func (h *Handler) ScriptHandler(w http.ResponseWriter, req *http.Request)
- func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SocketHandler(s SocketHandlerInterface) func(w http.ResponseWriter, req *http.Request)
- type Pather
- type SocketHandlerInterface
Constants ¶
View Source
const ( UnknownPage pageType = iota PlayPage JsgoPage FrizzPage )
Variables ¶
This section is empty.
Functions ¶
func ServeStatic ¶
Types ¶
type Handler ¶
type Handler struct { Cache *cache.Cache Fileserver services.Fileserver Database services.Database Waitgroup *sync.WaitGroup Queue *queue.Queue // contains filtered or unexported fields }
func (*Handler) CssHandler ¶
func (h *Handler) CssHandler(w http.ResponseWriter, req *http.Request)
func (*Handler) HealthCheckHandler ¶
func (h *Handler) HealthCheckHandler(w http.ResponseWriter, r *http.Request)
func (*Handler) IconHandler ¶
func (h *Handler) IconHandler(w http.ResponseWriter, req *http.Request)
func (*Handler) PageHandler ¶
func (h *Handler) PageHandler(w http.ResponseWriter, req *http.Request)
func (*Handler) ScriptHandler ¶
func (h *Handler) ScriptHandler(w http.ResponseWriter, req *http.Request)
func (*Handler) SocketHandler ¶
func (h *Handler) SocketHandler(s SocketHandlerInterface) func(w http.ResponseWriter, req *http.Request)
type SocketHandlerInterface ¶
type SocketHandlerInterface interface { Handle(ctx context.Context, req *http.Request, send func(message services.Message), receive chan services.Message, tj *tracker.Job) error RequestTimeout() time.Duration WebsocketPingPeriod() time.Duration WebsocketTimeout() time.Duration WebsocketPongTimeout() time.Duration MarshalMessage(services.Message) (payload []byte, messageType int, err error) UnarshalMessage([]byte) (services.Message, error) StoreError(ctx context.Context, err error, req *http.Request) }
Click to show internal directories.
Click to hide internal directories.