MCPcopy Create free account
hub / github.com/google/go-cloud / ExampleOpenCollection

Function ExampleOpenCollection

docstore/example_test.go:101–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99}
100
101func ExampleOpenCollection() {
102 ctx := context.Background()
103 // Open a collection using the gcpfirestore package.
104 // You will need to blank-import the package for this to work:
105 // import _ "gocloud.dev/docstore/gcpfirestore"
106 coll, err := docstore.OpenCollection(ctx, "firestore://my-collection")
107 if err != nil {
108 log.Fatal(err)
109 }
110 defer coll.Close()
111
112 _ = coll // Use the collection.
113}
114
115func ExampleCollection_As() {
116 // This example is specific to the gcpfirestore implementation; it demonstrates

Callers

nothing calls this directly

Calls 2

OpenCollectionFunction · 0.92
CloseMethod · 0.65

Tested by

no test coverage detected