|
|
пре 4 година | |
|---|---|---|
| .github | пре 4 година | |
| LICENSE.md | пре 5 година | |
| README.md | пре 4 година | |
| bullet.go | пре 4 година | |
| bullet_test.go | пре 4 година | |
| devices.go | пре 4 година | |
| error.go | пре 5 година | |
| fileUpload.go | пре 4 година | |
| push.go | пре 4 година | |
| pushInterface.go | пре 5 година | |
| pushes.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)
}
List pushes, all pushes (modifiedAfter can be nil, limit <= 0 gives default of 500)
devices, err := b.ListPushes(true, nil, 0, "")
if err != nil {
t.Error(err)
}