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

Function Load

shock-server/node/db.go:110–122  ·  view source on GitHub ↗
(id string)

Source from the content-addressed store, hash-verified

108}
109
110func Load(id string) (n *Node, err error) {
111 session := db.Connection.Session.Copy()
112 defer session.Close()
113 c := session.DB(conf.MONGODB_DATABASE).C("Nodes")
114 n = new(Node)
115 err = c.Find(bson.M{"id": id}).One(&n)
116 if err != nil {
117 n = nil
118 return
119 }
120 n.DBInit()
121 return
122}
123
124func LoadNodes(ids []string) (n Nodes, err error) {
125 if _, err = dbFind(bson.M{"id": bson.M{"$in": ids}}, &n, "", nil); err == nil {

Callers 6

AsyncIndexerFunction · 0.70
CreateNodeUploadFunction · 0.70
CreateNodesFromArchiveFunction · 0.70
UpdateMethod · 0.70
SetFileFromSubsetMethod · 0.70
SetFileFromPartsFunction · 0.70

Calls 2

CloseMethod · 0.65
DBInitMethod · 0.45

Tested by

no test coverage detected