func mkPub(utc_hour int, root_topic string) func() {
  topic := root_topic + "-" + strconv.Itoa(utc_hour)
  return func() {

    c := fcm.NewFcmClient(serverKey)
    r := rand.New(rand.NewSource(99))
    random_num := r.Int31()
    data := map[string]string{
        "random_num": strconv.Itoa(int(random_num)),
    }
    c.NewFcmMsgTo(topic, data)

    status, err := c.Send()

    if err == nil {
        status.PrintResults()
    } else {
        fmt.Println(err)
    }
  }
}
// construct funcs for each interval
// publishes to root_topic//stream/hour
construct funcs for each interval
publishes to root_topic//stream/hour
// construct funcs for each interval // publishes to root_topic // stream / hour
func mkPub(utc_hour int, root_topic string) func() {
  topic := root_topic + "-" + strconv.Itoa(utc_hour)
  return func() {
    c := fcm.NewFcmClient(serverKey)
    r := rand.New(rand.NewSource(99))
    random_num := r.Int31()
    data := map[string]string{
        "random_num": strconv.Itoa(int(random_num)),
    }
    c.NewFcmMsgTo(topic, data)
    status, err := c.Send()
    if err == nil {
        status.PrintResults()
    } else {
        fmt.Println(err)
    }
  }
}
func mkPub ( utc_hour int , root_topic string ) func ( ) { topic := root_topic + " " + strconv . Itoa ( utc_hour ) return func ( ) { c := fcm . NewFcmClient ( serverKey ) r := rand . New ( rand . NewSource ( 99 ) ) random_num := r . Int31 ( ) data := map [ string ] string { " " : strconv . Itoa ( int ( random_num ) ) , } c . NewFcmMsgTo ( topic , data ) status , err := c . Send ( ) if err == nil { status . PrintResults ( ) } else { fmt . Println ( err ) } } }
construct funcs for each interval
publishes to root_topic//stream/hour
construct funcs for each interval publishes to root_topic // stream / hour