Skip to content

buraksecer/go-easy-pubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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