Merge branch 'main' into e2e
This commit is contained in:
commit
a66731641c
60 changed files with 4572 additions and 3400 deletions
|
@ -53,6 +53,7 @@ type Message struct { // TODO combine with server.message
|
|||
Priority int
|
||||
Tags []string
|
||||
Click string
|
||||
Icon string
|
||||
Attachment *Attachment
|
||||
|
||||
// Additional fields
|
||||
|
@ -222,11 +223,12 @@ func (c *Client) Poll(topic string, options ...SubscribeOption) ([]*Message, err
|
|||
// The method returns a unique subscriptionID that can be used in Unsubscribe.
|
||||
//
|
||||
// Example:
|
||||
// c := client.New(client.NewConfig())
|
||||
// subscriptionID := c.Subscribe("mytopic")
|
||||
// for m := range c.Messages {
|
||||
// fmt.Printf("New message: %s", m.Message)
|
||||
// }
|
||||
//
|
||||
// c := client.New(client.NewConfig())
|
||||
// subscriptionID := c.Subscribe("mytopic")
|
||||
// for m := range c.Messages {
|
||||
// fmt.Printf("New message: %s", m.Message)
|
||||
// }
|
||||
func (c *Client) Subscribe(topic string, options ...SubscribeOption) string {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue