oak

package module
v0.0.0-...-91c5425 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2016 License: MIT Imports: 7 Imported by: 6

README

oak

A simple pkg providing http request handling for open active entities.

Test Coverage

Docs

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Route

func Route(router *mux.Router, sessionStore sessions.Store, sessionName string, entity Entity, entityStoreFactory EntityStoreFactory, getJoinResp GetJoinResp, getEntityChangeResp GetEntityChangeResp, performAct PerformAct)

Types

type Entity

type Entity interface {
	GetVersion() int
	IsActive() bool
	CreatedBy() (userId string)
	RegisterNewUser() (userId string, err error)
	UnregisterUser(userId string) error
	Kick() (updated bool)
}

type EntityStore

type EntityStore interface {
	Create() (entityId string, entity Entity, err error)
	Read(entityId string) (entity Entity, err error)
	Update(entityId string, entity Entity) (err error)
}

type EntityStoreFactory

type EntityStoreFactory func(r *http.Request) EntityStore

type GetEntityChangeResp

type GetEntityChangeResp func(userId string, e Entity) Json

type GetJoinResp

type GetJoinResp func(userId string, e Entity) Json

type Json

type Json map[string]interface{}

type PerformAct

type PerformAct func(json Json, userId string, e Entity) (err error)

Directories

Path Synopsis
Godeps
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
_workspace/src/github.com/gorilla/securecookie
Package gorilla/securecookie encodes and decodes authenticated and optionally encrypted cookie values.
Package gorilla/securecookie encodes and decodes authenticated and optionally encrypted cookie values.
_workspace/src/github.com/gorilla/sessions
Package gorilla/sessions provides cookie and filesystem sessions and infrastructure for custom session backends.
Package gorilla/sessions provides cookie and filesystem sessions and infrastructure for custom session backends.
_workspace/src/github.com/stretchr/testify/assert
A set of comprehensive testing tools for use with the normal Go testing system.
A set of comprehensive testing tools for use with the normal Go testing system.

Jump to

Keyboard shortcuts

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