()
| 139 | } |
| 140 | |
| 141 | func ExampleSubscription_As() { |
| 142 | // This example is specific to the gcppubsub implementation; it demonstrates |
| 143 | // access to the underlying SubscriberClient type. |
| 144 | // The types exposed for As by gcppubsub are documented in |
| 145 | // https://godoc.org/gocloud.dev/pubsub/gcppubsub#hdr-As |
| 146 | |
| 147 | ctx := context.Background() |
| 148 | sub, err := pubsub.OpenSubscription(ctx, "gcppubsub://project/topic") |
| 149 | if err != nil { |
| 150 | log.Fatal(err) |
| 151 | } |
| 152 | defer sub.Shutdown(ctx) |
| 153 | |
| 154 | var sc *pbraw.SubscriberClient |
| 155 | if sub.As(&sc) { |
| 156 | _ = sc.CallOptions |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func ExampleSubscription_ErrorAs() { |
| 161 | // This example is specific to the gcppubsub implementation; it demonstrates |
nothing calls this directly
no test coverage detected