weddingseats

package module
v0.0.0-...-1a1dba8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2014 License: MIT Imports: 16 Imported by: 0

README

weddingseats

A golang based experiment in automatic wedding seating

Documentation

Overview

keys for global request context

Index

Constants

View Source
const KeyCurrentUser int = 0
View Source
const KeySessionCookieName string = "session"

Variables

View Source
var (
	FACEBOOK_CFG = new(oauth.Config)
	SessionStore *sessions.CookieStore
)

global vars

Functions

func HandleFacebookAuthorized

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

func HandleFacebookStart

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

func HandleGender

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

func HandleIndex

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

func HandleLogout

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

func PostRequest

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

func PreRequest

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

func ReadConfig

func ReadConfig(path string) (err error)

func Render

func Render(w http.ResponseWriter, name string, context interface{})

func WrapHandler

func WrapHandler(wrapped http.HandlerFunc) http.HandlerFunc

Types

type Configuration

type Configuration struct {
	CookieSecret string
	Facebook     struct {
		ClientId     string
		ClientSecret string
		AuthURL      string
		TokenURL     string
		RedirectURL  string
		Scope        string
	}
}

type User

type User struct {
	FacebookID                string `json:"id"`
	FirstName                 string `json:"first_name"`
	LastName                  string `json:"last_name"`
	Gender                    string `json:"gender"`
	FacebookAccessToken       string
	FacebookAccessTokenExpiry time.Time
	TokenExpiry               time.Time
	DateCreated               time.Time
}
var ANONYMOUS *User

func GetUserFromSession

func GetUserFromSession(r *http.Request) (user *User)

func LocateUser

func LocateUser(ctx *appengine.Context, facebookID string) (u *User, err error)

func (*User) Key

func (u *User) Key(ctx *appengine.Context) *datastore.Key

func (*User) Login

func (u *User) Login(w http.ResponseWriter, r *http.Request)

func (*User) Save

func (u *User) Save(ctx *appengine.Context) error

func (*User) Token

func (u *User) Token() *oauth.Token

Jump to

Keyboard shortcuts

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