| 24 | ) |
| 25 | |
| 26 | func ExampleOpenTopic() { |
| 27 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. |
| 28 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. |
| 29 | ctx := context.Background() |
| 30 | |
| 31 | rabbitConn, err := amqp.Dial("amqp://guest:guest@localhost:5672/") |
| 32 | if err != nil { |
| 33 | log.Fatal(err) |
| 34 | } |
| 35 | defer rabbitConn.Close() |
| 36 | topic := rabbitpubsub.OpenTopic(rabbitConn, "myexchange", nil) |
| 37 | defer topic.Shutdown(ctx) |
| 38 | } |
| 39 | |
| 40 | func ExampleOpenSubscription() { |
| 41 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. |