Skip to content

janekolszak/go-pebble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-pebble Build Status

Interacting with the Pebble's timeline in Go.

Setup

go get -u github.com/janekolszak/go-pebble

Test

go test github.com/janekolszak/go-pebble

Example

package main

import (
    "fmt"
    "github.com/janekolszak/go-pebble"
    "net/http"
)

func main() {
    layout := pebble.Layout{
        Type:     "genericPin",
        Title:    "Title",
        TinyIcon: "system://images/NOTIFICATION_FLAG",
        Body:     "Body",
    }

    creationLayout := pebble.Layout{
        Type:     "genericPin",
        Title:    "Creation Title",
        TinyIcon: "system://images/NOTIFICATION_FLAG",
        Body:     "Creation Body",
    }

    creationNotification := pebble.Notification{
        Layout: &creationLayout,
    }

    updateLayout := pebble.Layout{
        Type:     "genericPin",
        Title:    "Update Title",
        TinyIcon: "system://images/NOTIFICATION_FLAG",
        Body:     "Update Body",
    }

    updateNotification := pebble.Notification{
        Layout: &updateLayout,
        Time:   time.Now().Format(time.RFC3339),
    }

    reminderLayout := pebble.Layout{
        Type:     "genericReminder",
        Title:    "Reminder Title",
        TinyIcon: "system://images/NOTIFICATION_FLAG",
    }

    reminder := pebble.Reminder{
        Time:   time.Now().Format(time.RFC3339),
        Layout: &reminderLayout,
    }

    pin := pebble.Pin{
        Id:                 "UNIQUE ID",
        Time:               time.Now().Format(time.RFC3339),
        Layout:             &layout,
        CreateNotification: &creationNotification,
        UpdateNotification: &updateNotification,
        Reminders:          &pebble.Reminders{reminder},
    }

    uPin.userPin = pebble.UserPin{
        Pin:   pin,
        Token: "TOKEN",
    }

    fmt.Println(pin.String())


    client := &http.Client{
        CheckRedirect: redirectPolicyFunc,
    }
    uPin.Put(client)
    uPin.Delete(client)
}

About

Interacting with the Pebble's timeline in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages