oak

package
v0.0.0-...-0b10745 Latest Latest
Warning

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

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

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)

Jump to

Keyboard shortcuts

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