main_model

package
v0.0.0-...-076d96f Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2012 License: BSD-2-Clause-Views Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

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