web

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2015 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SESSION_USER_ID = "user_id"
)

Variables

This section is empty.

Functions

func AuthTest

func AuthTest(w http.ResponseWriter, r *http.Request)

This Handler is used only to check if the user is indeed authenticated

func DeleteNotification

func DeleteNotification(w http.ResponseWriter, r *http.Request)

Handler to delete a notification

func DeleteNovel

func DeleteNovel(w http.ResponseWriter, r *http.Request)

Handler to delete a novel

func GetUserId

func GetUserId(r *http.Request, c chan string)

Get the user ID from a given token. It will make a GET request to https://www.googleapis.com/oauth2/v1/userinfo?access_token=...

func NewOAuth

func NewOAuth() negroni.Handler

Returns a new Negroni middleware using Google OAuth2

func NewRouter

func NewRouter() *mux.Router

Returns the routers for novels, feeds and notifications

func NewSignInRouter

func NewSignInRouter() *mux.Router

Returns a router for signing in Google account

func Notification

func Notification(w http.ResponseWriter, r *http.Request)

Handler to fetch a notification

func Notifications

func Notifications(w http.ResponseWriter, r *http.Request)

Handler to fetch the list of notifications

func Novel

func Novel(w http.ResponseWriter, r *http.Request)

Handler to fetch a novel

func Novels

func Novels(w http.ResponseWriter, r *http.Request)

Handler to fetch the list of novels

func SaveNovel

func SaveNovel(w http.ResponseWriter, r *http.Request)

Handler to save a novel

func SearchNovels added in v0.0.3

func SearchNovels(w http.ResponseWriter, r *http.Request)

Handler to search novels

func SignIn

func SignIn(w http.ResponseWriter, r *http.Request)

Handler to sign in Google account

func UpdateNovel

func UpdateNovel(w http.ResponseWriter, r *http.Request)

Handler to update a novel

Types

type JsonErr

type JsonErr struct {
	Code int
	Text string
}

Error structure

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

type UserInfo

type UserInfo struct {
	Id string
}

The user info for Google account

Jump to

Keyboard shortcuts

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