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

Function Example_openCollectionFromURL

docstore/awsdynamodb/v2/example_test.go:41–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39}
40
41func Example_openCollectionFromURL() {
42 // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
43 // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/docstore/awsdynamodb"
44 // PRAGMA: On gocloud.dev, hide lines until the next blank line.
45 ctx := context.Background()
46
47 // docstore.OpenCollection creates a *docstore.Collection from a URL.
48 coll, err := docstore.OpenCollection(ctx, "dynamodb://my-table?partition_key=name")
49 if err != nil {
50 log.Fatal(err)
51 }
52 defer coll.Close()
53}

Callers

nothing calls this directly

Calls 2

OpenCollectionFunction · 0.92
CloseMethod · 0.65

Tested by

no test coverage detected