Skip to content

Latest commit

 

History

History
67 lines (40 loc) · 1.3 KB

README.md

File metadata and controls

67 lines (40 loc) · 1.3 KB

easy pubsub Go Reference Go Report Card GitHub go.mod Go version GitHub release (latest SemVer)

Installation

go get github.com/buraksecer/go-easy-pubsub v0.0.3

Example

Firstly, you must Init new topic operation.

topic.Init(clientId)

You can create basicly a client

topic.Create(topicName)

You can list the topic of the client

topics := topic.Topics()

for _, v := range topics.Topics {
	fmt.Println(v)
}

After, you can create a new subscription

topic.CreateSubscription(topicName, subName)

You can list the subscription of the client

topic.Subscriptions(topicName)

After finally, let's go Publish first message :)

topic.Publish(topicName, "Fly me to the moon..")

And exactly, you must pull the message -_-

topic.Receive(subName)

Google pub/sub service easy way to use