From 2de0fa330c88423e0705cece4e8698b1c92ce6ee Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Mon, 17 May 2021 20:54:54 +0800 Subject: [PATCH] remove event interface (#923) --- event/README.md | 3 --- event/event.go | 34 ---------------------------------- 2 files changed, 37 deletions(-) delete mode 100644 event/README.md delete mode 100644 event/event.go diff --git a/event/README.md b/event/README.md deleted file mode 100644 index 0cd0e59ed..000000000 --- a/event/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Events - -* [Kafka](https://github.com/go-kratos/kafka) diff --git a/event/event.go b/event/event.go deleted file mode 100644 index f3f3cb8e8..000000000 --- a/event/event.go +++ /dev/null @@ -1,34 +0,0 @@ -package event - -import ( - "context" -) - -// Event is an absctraction for all messages that -// are sent to quque or received from queue. -type Event struct { - // Key sets the key of the message for routing policy - Key string - // Payload for the message - Payload []byte - // Properties attach application defined properties on the message - Properties map[string]string -} - -// Handler is a callback function that processes messages delivered -// to asynchronous subscribers. -type Handler func(context.Context, Event) error - -// Publisher is absctraction for sending messages -// to queue. -type Publisher interface { - Publish(ctx context.Context, event Event) error - Close() error -} - -// Subscriber is an absctraction for receiving messages -// from queue. -type Subscriber interface { - Subscribe(ctx context.Context, h Handler) error - Close() error -}