Documentation ¶
Index ¶
- func GetSessionCookie(req *http.Request) *http.Cookie
- func GetSessionUser(databaseConnection db.DatabaseConnection, req *http.Request) (db.User, error)
- func StoreFile(databaseConnection db.DatabaseConnection, uploadLocation string, ...) (int, error)
- type LoggableResponseWriter
- type RouteHandler
- type Webserver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSessionCookie ¶
GetSessionCookie gets the cookie named "session" from http.Cookies()
func GetSessionUser ¶
GetSessionUser gets the user associated with a session within a *http.Request.
Types ¶
type LoggableResponseWriter ¶
type LoggableResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
LoggableResponseWriter allows access to otherwise hidden information within ResponseWriter
func NewLoggableResponseWriter ¶
func NewLoggableResponseWriter(writer http.ResponseWriter) LoggableResponseWriter
NewLoggableResponseWriter creats a LoggableResponseWriter with the given http.ResponseWriter
func (*LoggableResponseWriter) Write ¶
func (writer *LoggableResponseWriter) Write(bytes []byte) (int, error)
Write is identical to http.ResponseWriter.Write, but stores the bytes sent and accounts for the 200 special case that Write normally handles by the interface's definition.
func (*LoggableResponseWriter) WriteHeader ¶
func (writer *LoggableResponseWriter) WriteHeader(statusCode int)
WriteHeader is identical to http.Responsewriter.WriteHeader, but stores the status code.
type RouteHandler ¶
type RouteHandler struct {
// contains filtered or unexported fields
}
RouteHandler holds all routes and allows them to share common variables
type Webserver ¶
Webserver hosts a webserver for sms-pusher
func NewWebserver ¶
func NewWebserver(listenAddr string, databaseConnection db.DatabaseConnection, sendChannel chan<- firebasexmpp.DownstreamPayload, logger *logrus.Logger) (Webserver, error)
NewWebserver creats a new Webserver with httpServer being set to a new http.Server