Documentation ¶
Index ¶
- func Clean(x interface{}) interface{}
- func ListToMap(i ...interface{}) map[string]interface{}
- func MapAdd(ma map[string]interface{}, key string, value interface{})
- func Mapify(a map[string][]string) map[string]interface{}
- func OrderKeys(d map[string]interface{}) []interface{}
- func Recurs(v interface{}, converter func(interface{}) (interface{}, bool)) interface{}
- func SchemeToFields(scheme interface{}, dat interface{}) ([]map[string]interface{}, error)
- func ToStringSlice(i ...interface{}) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clean ¶
func Clean(x interface{}) interface{}
Cleans all bson.M s to map[string]interface{} s. Usually called on db query results. Will become obsolete when the mgo driver will return map[string]interface{} maps instead of bson.M ones.
func OrderKeys ¶
func OrderKeys(d map[string]interface{}) []interface{}
A more generic version of abcKeys. Takes a map[string]interface{} and puts every element of that into an []interface{}, ordered by keys alphabetically. TODO: find the intersecting parts between the two functions and refactor.
func Recurs ¶
func Recurs(v interface{}, converter func(interface{}) (interface{}, bool)) interface{}
Converts all bson.ObjectId s to string. Usually called before displaying a database query result. Input is the result from the database.
func SchemeToFields ¶
Takes an extraction/validation scheme, a document and from that creates a slice which can be easily displayed by a templating engine as a html form. Takes interface{}s and not map[string]interface{}s to include type checking here, and avoid that boilerplate in caller.
func ToStringSlice ¶
func ToStringSlice(i ...interface{}) []string
Types ¶
This section is empty.