Skip to content

sarahhodne/pusher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Go Lang Pusher Library

So much to write, so little information to tell you right now :)

Example

package main

import (
    "fmt"
    "github.com/timonv/pusher"
    "time"
)

func main() {
    client := pusher.NewClient("appId", "key", "secret", false)

    done := make(chan bool)

    go func() {
        err := client.Publish("test", "test", "test")
        if err != nil {
            fmt.Printf("Error %s\n", err)
        } else {
            fmt.Print("Message Published!")
        }
        done <- true
    }()

    // A basic timeout to make sure we don't wait forever
    select {
    case <-done:
        fmt.Println("\nDone")
    case <-time.After(1 * time.Minute):
        fmt.Println("\n:-( Timeout")
    }
}

License

MIT: Timon Vonk and Josh Kalderimis http://timon-josh.mit-license.org

About

Pusher server in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%