context

package
v0.0.0-...-22804f9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2012 License: BSD-2-Clause-Views Imports: 4 Imported by: 0

Documentation

Overview

Context contains the type Uni. An instance of this type is passed to the modules when routing the control to them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Uni

type Uni struct {
	Modifiers map[string]interface{}
	Session   *mgo.Session
	Db        *mgo.Database
	W         http.ResponseWriter
	Req       *http.Request

	Path string // Path string

	Opt           map[string]interface{} // Freshest options from database.
	Dat           map[string]interface{} // General communication channel.
	Put           func(...interface{})   // Just a convenience function to allow fast output to http response.
	Root          string                 // Absolute path of the application.
	Ev            iface.Event
	Route         *lang.Route
	Sentence      *lang.Sentence
	FilterCreator func(string, map[string]interface{}) iface.Filter
	NewModule     func(string) iface.Module
	// contains filtered or unexported fields
}

General context for the application.

func (*Uni) OriginalOpt

func (u *Uni) OriginalOpt() string

func (*Uni) Secret

func (u *Uni) Secret() string

Maybe we should not even return the secret, because a badly written module can make it public. Or, we could serve different values to different packages. That makes the encrypted values noncompatible across packages though.

func (*Uni) SetOriginalOpt

func (u *Uni) SetOriginalOpt(s string)

Set only once.

func (*Uni) SetSecret

func (u *Uni) SetSecret(s string)

Set only once.

Jump to

Keyboard shortcuts

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