diff --git a/weed/messaging/client/client.go b/weed/messaging/client/client.go new file mode 100644 index 000000000..9bf9bc71e --- /dev/null +++ b/weed/messaging/client/client.go @@ -0,0 +1,11 @@ +package client + +type MessagingClient struct { + bootstrapBrokers []string +} + +func NewMessagingClient(bootstrapBrokers []string) *MessagingClient { + return &MessagingClient{ + bootstrapBrokers: bootstrapBrokers, + } +} diff --git a/weed/messaging/client/publisher.go b/weed/messaging/client/publisher.go new file mode 100644 index 000000000..3e21cc557 --- /dev/null +++ b/weed/messaging/client/publisher.go @@ -0,0 +1,14 @@ +package client + +import "github.com/chrislusf/seaweedfs/weed/pb/messaging_pb" + +type Publisher struct { +} + +func (c *MessagingClient) NewPublisher(namespace, topic string) *Publisher { + return &Publisher{} +} + +func (p *Publisher) Publish(m *messaging_pb.RawData) error{ + return nil +} diff --git a/weed/messaging/client/subscriber.go b/weed/messaging/client/subscriber.go new file mode 100644 index 000000000..55101a283 --- /dev/null +++ b/weed/messaging/client/subscriber.go @@ -0,0 +1,14 @@ +package client + +import "github.com/chrislusf/seaweedfs/weed/pb/messaging_pb" + +type Subscriber struct { +} + +func (c *MessagingClient) NewSubscriber(namespace, topic string) *Subscriber { + return &Subscriber{} +} + +func (p *Subscriber) Subscribe(processFn func(m *messaging_pb.Message)) error{ + return nil +}