()
| 33 | ) |
| 34 | |
| 35 | func ExampleBucket_NewReader() { |
| 36 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. |
| 37 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. |
| 38 | ctx := context.Background() |
| 39 | var bucket *blob.Bucket |
| 40 | |
| 41 | // Open the key "foo.txt" for reading with the default options. |
| 42 | r, err := bucket.NewReader(ctx, "foo.txt", nil) |
| 43 | if err != nil { |
| 44 | log.Fatal(err) |
| 45 | } |
| 46 | defer r.Close() |
| 47 | // Readers also have a limited view of the blob's metadata. |
| 48 | fmt.Println("Content-Type:", r.ContentType()) |
| 49 | fmt.Println() |
| 50 | // Copy from the reader to stdout. |
| 51 | if _, err := io.Copy(os.Stdout, r); err != nil { |
| 52 | log.Fatal(err) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func ExampleBucket_NewRangeReader() { |
| 57 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. |
nothing calls this directly
no test coverage detected