Documentation ¶
Index ¶
- func Delete(session *Session, key string)
- func Get(session *Session, key string)
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter() *mux.Router
- func Save(session *Session, key string, create bool, data []byte)
- func Start()
- func Subscribe(session *Session, key string)
- func Unsubscribe(session *Session, key string)
- type Route
- type Routes
- type Session
- func (m *Session) Create(name string) error
- func (m *Session) CreateInNamespace(namespace *datastore.Key, name string) error
- func (m *Session) CreateWithID() error
- func (m *Session) Deactivate()
- func (m *Session) Save() error
- func (m *Session) Subscribe(subKey string)
- func (m *Session) Unsubscribe(subKey string)
- func (m *Session) Writer()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unsubscribe ¶
Types ¶
type Session ¶
type Session struct { database.Base ID string Expires int64 Subscriptions []string // contains filtered or unexported fields }
Session holds data for an api session.
func GetSession ¶
GetSession fetches Session with the provided name from the default namespace.
func GetSessionFromNamespace ¶
GetSessionFromNamespace fetches Session with the provided name from the provided namespace.
func NewSession ¶
NewSession creates a new session.
func ResumeSession ¶
ResumeSession an existing session.
func (*Session) CreateInNamespace ¶
CreateInNamespace saves Session with the provided name in the provided namespace.
func (*Session) CreateWithID ¶
CreateWithID saves Session with the its ID in the default namespace.
func (*Session) Deactivate ¶
func (m *Session) Deactivate()
Deactivate closes down a session, making it ready to be resumed.
func (*Session) Subscribe ¶
Subscribe subscribes to a database key and saves the new subscription table if the session was already persisted.
func (*Session) Unsubscribe ¶
Unsubscribe unsubscribes from a database key and saves the new subscription table if the session was already persisted.