-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdoc.go
55 lines (55 loc) · 1.08 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Package events implements a messaging library
//
// About
//
// goevents allows to dispatch events between applications.
//
// An application produces events based on actions.
// Another application consume these events and maybe create new events.
//
// Supported Transport
//
// AMQP
//
// How to use
//
// The consumer
//
// conn, err := NewConnection("amqp://guest:guest@127.0.0.1:5672/", "events-queue", "events-exchange")
//
// if err != nil {
// panic(err)
// }
//
// c, err := NewConsumer(conn, false)
//
// if err != nil {
// panic(err)
// }
//
// c.Subscribe("my_action", func(body []byte) bool {
// fmt.Println(body)
// return true
// })
//
// The producer
//
// conn, err := NewConnection("amqp://guest:guest@127.0.0.1:5672/", "events-queue", "events-exchange")
//
// if err != nil {
// panic(err)
// }
//
// p, err := NewProducer(conn)
//
// if err != nil {
// panic(err)
// }
//
// err = p.Publish("my_action", []byte("message"))
//
// if err != nil {
// panic(err)
// }
//
package events