Init
This commit is contained in:
16
lib/pubsub/interface.go
Normal file
16
lib/pubsub/interface.go
Normal file
@ -0,0 +1,16 @@
|
||||
package pubsub
|
||||
|
||||
import "context"
|
||||
|
||||
type Message struct {
|
||||
Payload string
|
||||
}
|
||||
|
||||
type PubSubMessage interface {
|
||||
ReceiveMessage(ctx context.Context) (*Message, error)
|
||||
}
|
||||
|
||||
type PubSub interface {
|
||||
SubscribeToChannel(channel string) (PubSubMessage, error)
|
||||
PublishToChannel(channel string, message string) error
|
||||
}
|
Reference in New Issue
Block a user