tomahawk28 / pusher

The lightweight Pusher library for Go language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pusher

The lightweight Pusher library for Go language

Usage

package main

import (
	"fmt"

	"github.com/tomahawk28/pusher"
)

type SampleMsg struct {
	Title   string `json:"title"`
	Message string `json:"message"`
}

func main() {
	pu := pusher.Pusher{
		Key:    "ef0affaffaffc3e8b5",
		Secret: "a99e8f18374691561d",
		App_id: 99999,
	}

	pu.SetHttps(true)
	
	if channel_names, err := pu.GetChannels(); err != nil {
		panic("Die!")
	} else {
		pu.Trigger(channel_names, "my_event", &SampleMsg{"Greeting", "Thank you for waiting"})
	}

}

About

The lightweight Pusher library for Go language

License:MIT License


Languages

Language:Go 100.0%