()
| 58 | } |
| 59 | |
| 60 | func Example_openCollectionFromURL() { |
| 61 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. |
| 62 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/docstore/memdocstore" |
| 63 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. |
| 64 | ctx := context.Background() |
| 65 | |
| 66 | // docstore.OpenCollection creates a *docstore.Collection from a URL. |
| 67 | coll, err := docstore.OpenCollection(ctx, "mem://collection/keyField") |
| 68 | if err != nil { |
| 69 | log.Fatal(err) |
| 70 | } |
| 71 | defer coll.Close() |
| 72 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. |
| 73 | // Output: |
| 74 | } |
nothing calls this directly
no test coverage detected