reqtraps

package
v0.0.0-...-8ea42c6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2016 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package reqtraps implements the traps that handle each relevant HTTP method. --

  • Copyright (C) 2015 by Rafael Santiago *
  • This is a free software. You can redistribute it and/or modify under
  • the terms of the GNU General Public License version 2. *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadAssErrorHandle

func BadAssErrorHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

BadAssErrorHandle implements the handle for the any unexpected HTTP request (GET/POST/Whatever).

func GetBannerHandle

func GetBannerHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

GetBannerHandle implements the handle for the banner document (GET).

func GetBodyHandle

func GetBodyHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

GetBodyHandle implements the handle for the body document (GET).

func GetBriefHandle

func GetBriefHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

GetBriefHandle implements the handle for the brief document (GET).

func GetExitHandle

func GetExitHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

GetExitHandle implements the handle for the exit document (GET).

func GetFindHandle

func GetFindHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

GetFindHandle implements the handle for the find document (GET).

func GetJoinHandle

func GetJoinHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

GetJoinHandle implements the handle for the join document (GET).

func GetTopHandle

func GetTopHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

GetTopHandle implements the handle for the top document (GET).

func PostBannerHandle

func PostBannerHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

PostBannerHandle implements the handle for the banner document (POST).

func PostFindHandle

func PostFindHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

PostFindHandle implements the handle for the find document (POST).

func PostJoinHandle

func PostJoinHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

PostJoinHandle implements the handle for the join document (POST).

func PubHandle

func PubHandle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

PubHandle implements the handle for the room's public directory (GET).

Types

type RequestTrap

type RequestTrap func() RequestTrapInterface

RequestTrap idem.

func BuildRequestTrap

func BuildRequestTrap(handle RequestTrapHandleFunc) RequestTrap

BuildRequestTrap creates a trap based on a user request.

func GetRequestTrap

func GetRequestTrap(httpPayload string) RequestTrap

GetRequestTrap returns the correct trap that should be used to handle the user request.

type RequestTrapHandleFunc

type RequestTrapHandleFunc func(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

RequestTrapHandleFunc idem.

func (RequestTrapHandleFunc) Handle

func (h RequestTrapHandleFunc) Handle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)

Handle idem.

type RequestTrapInterface

type RequestTrapInterface interface {
	Handle(newConn net.Conn, roomName, httpPayload string, rooms *config.CherryRooms, preprocessor *html.Preprocessor)
}

RequestTrapInterface is used for what it suggests [Hi lint! you are so stupid!].

Jump to

Keyboard shortcuts

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