Piotr Czajkowski cec22df837 Updated instructions | 3 年之前 | |
---|---|---|
.github | 3 年之前 | |
LICENSE.md | 4 年之前 | |
README.md | 3 年之前 | |
bullet.go | 3 年之前 | |
bullet_test.go | 3 年之前 | |
devices.go | 3 年之前 | |
error.go | 4 年之前 | |
fileUpload.go | 3 年之前 | |
push.go | 3 年之前 | |
pushInterface.go | 4 年之前 |
Initialize client
b := bullet.NewBullet("YOUR_TOKEN")
Send note, use empty string in place of deviceID to send to all devices
err := b.SendNote("testTitle", "testText", "deviceID")
if err != nil {
log.Fatal(err)
}
Send link, use empty string in place of deviceID to send to all devices
err := b.SendLink("testTitle", "testText", "https://abc.com", "deviceID")
if err != nil {
log.Fatal(err)
}
Send file, use empty string in place of deviceID to send to all devices
err := b.SendFile("testFile", "Something", "./test.txt", "deviceID")
if err != nil {
log.Fatal(err)
}
List devices
devices, err := b.ListDevices()
if err != nil {
t.Error(err)
}