You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
354 B
22 lines
354 B
3 years ago
|
package event
|
||
|
|
||
|
import "context"
|
||
|
|
||
|
type Message interface {
|
||
|
Key() string
|
||
|
Value() []byte
|
||
|
Header() map[string]string
|
||
|
}
|
||
|
|
||
|
type Handler func(context.Context, Message) error
|
||
|
|
||
|
type Sender interface {
|
||
|
Send(ctx context.Context, msg Message) error
|
||
|
Close() error
|
||
|
}
|
||
|
|
||
|
type Receiver interface {
|
||
|
Receive(ctx context.Context, handler Handler) error
|
||
|
Close() error
|
||
|
}
|