server

package
v0.0.0-...-6bfafd3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2017 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func App

func App() http.Handler

App returns a handler that encapsulates the entire application

func ContactListing

func ContactListing(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ContactListing reads the listing from the params and sends notification and confirmation emails to the listing owner and current user

func ContactSeek

func ContactSeek(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ContactSeek reads the seek from the params and sends notification and confirmation emails to the seek owner and current user

func CreateListing

func CreateListing(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

CreateListing creates a new listing based on the contents of r, owned by the current user, and then writes it to w with its keyId set

func CreatePhoto

func CreatePhoto(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

CreatePhoto uploads the photo in r to Amazon S3 and writes its location to w

func CreateSavedSearch

func CreateSavedSearch(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

CreateSavedSearch creates a new saved search based on the contents of r, owned by the current user, and then writes it to w with its keyId set

func CreateSeek

func CreateSeek(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

CreateSeek creates a new seek based on the contents of r, owned by the current user, and then writes it to w with its keyId set

func DeleteListing

func DeleteListing(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

DeleteListing deletes the requested listing if it is owned by the current user

func DeleteSavedSearch

func DeleteSavedSearch(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

DeleteSavedSearch delete the requested saved search if it is owned by the current user

func DeleteSeek

func DeleteSeek(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

DeleteSeek deletes the requested seek if it is owned by the current user

func Error

func Error(w http.ResponseWriter, code int)

Error writes an HTTP error with default status text. It does not end the stream

func GetCurrentUser

func GetCurrentUser(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

GetCurrentUser returns the current user, or an empty JSON object if not logged in

func LogoutUser

func LogoutUser(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

LogoutUser logs the user out from CAS, if they are logged in, and redirects to app root

func OriginValid

func OriginValid(r *http.Request) bool

OriginValid returns true iff the request has valid origin or referrer headers https://goo.gl/nGnXwq

func ParseJSONFromBody

func ParseJSONFromBody(r *http.Request, v interface{}) error

ParseJSONFromBody reads r as a JSON string and writes its attributes to v

func ReadListing

func ReadListing(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ReadListing writes a listing identified in r to w

func ReadListings

func ReadListings(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ReadListings performs a customizable request defined by r for a collection of listings, and writes them to w

func ReadSavedSearch

func ReadSavedSearch(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ReadSavedSearch writes a saved search identified in r to w

func ReadSavedSearches

func ReadSavedSearches(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ReadSavedSearches performs a request for the current user's saved searches, and writes them to w

func ReadSeek

func ReadSeek(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ReadSeek writes the seek identified in r to w

func ReadSeeks

func ReadSeeks(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ReadSeeks performs a customizable request defined by r for a collection of seeks, and writes them to w

func RedirectUser

func RedirectUser(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

RedirectUser redirects the user to CAS authentication if they are not logged in, and back to the "return" parameter otherwise

func Router

func Router() http.Handler

Router returns the router http handler for the package

func SameOrigin

func SameOrigin(u1, u2 *url.URL) bool

SameOrigin returns true iff two URLs have the same origin https://github.com/cbonello/revel-csrf/blob/master/csrf.go#L100

func Serve

func Serve(w http.ResponseWriter, v interface{})

Serve converts v to a JSON string and writes to w. Writes an InternalServerError on error

func UpdateListing

func UpdateListing(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

UpdateListing updates the requested listing if it is owned by the current user

func UpdateListingStar

func UpdateListingStar(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

UpdateListingStar adds or removes a star to a listing for the current user

func UpdateSavedSearch

func UpdateSavedSearch(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

UpdateSavedSearch updates the requested saved search if it is owned by the current user

func UpdateSeek

func UpdateSeek(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

UpdateSeek updates the requested seek if it is owned by the current user

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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