LoadAllCollections loads and returns all collections from the root.
(ctx context.Context, root objinterface.RootValue)
| 394 | |
| 395 | // LoadAllCollections loads and returns all collections from the root. |
| 396 | func LoadAllCollections(ctx context.Context, root objinterface.RootValue) ([]objinterface.Collection, error) { |
| 397 | colls := make([]objinterface.Collection, 0, len(globalCollections)) |
| 398 | for i, emptyColl := range globalCollections { |
| 399 | if emptyColl == nil || i == int(objinterface.RootObjectID_Conflicts) { |
| 400 | continue |
| 401 | } |
| 402 | coll, err := emptyColl.LoadCollection(ctx, root) |
| 403 | if err != nil { |
| 404 | return nil, err |
| 405 | } |
| 406 | colls = append(colls, coll) |
| 407 | } |
| 408 | return colls, nil |
| 409 | } |
| 410 | |
| 411 | // LoadCollection loads the collection matching the given ID from the root. |
| 412 | func LoadCollection(ctx context.Context, root objinterface.RootValue, collectionID objinterface.RootObjectID) (objinterface.Collection, error) { |
no test coverage detected