Documentation ¶
Overview ¶
This package contains helper functions which run at the top level of the system - at main.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleConfig ¶
func HandleConfig(db *mgo.Database, host string, cache_it bool) (map[string]interface{}, string, error)
Loads the freshest option document from the database, and caches it if cache_it is true. Returns both the map[string]interface{} which comes from the database directly, and a JSON encoded string version too. The string version is being returned to be able to serve a version of the option document which is 100% untampered. (Assuming that the string is stored as private and only a copy of it can be retrieved)
The data is also stored in the cache as a string to provide its immutability. (One pageload this way can't mess up the option document for the next.)
Types ¶
This section is empty.