MCPcopy Create free account
hub / github.com/MG-RAST/Shock / Initialize

Function Initialize

shock-server/versions/versions.go:27–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25var VersionMap = make(map[string]int)
26
27func Initialize() (err error) {
28 session := db.Connection.Session.Copy()
29 defer session.Close()
30 c := session.DB(conf.MONGODB_DATABASE).C("Versions")
31 c.EnsureIndex(mgo.Index{Key: []string{"name"}, Unique: true})
32 var versions = new(Versions)
33 err = c.Find(bson.M{}).All(versions)
34 for _, v := range *versions {
35 VersionMap[v.Name] = v.Version
36 }
37 return
38}
39
40func Print() (err error) {
41 fmt.Printf("##### Versions ####\n")

Callers

nothing calls this directly

Calls 2

AllMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected