|
%!s(int64=4) %!d(string=hai) anos | |
---|---|---|
.github | %!s(int64=4) %!d(string=hai) anos | |
LICENSE.md | %!s(int64=4) %!d(string=hai) anos | |
README.md | %!s(int64=4) %!d(string=hai) anos | |
bullet.go | %!s(int64=4) %!d(string=hai) anos | |
bullet_test.go | %!s(int64=4) %!d(string=hai) anos | |
devices.go | %!s(int64=4) %!d(string=hai) anos | |
error.go | %!s(int64=4) %!d(string=hai) anos | |
fileUpload.go | %!s(int64=4) %!d(string=hai) anos | |
push.go | %!s(int64=4) %!d(string=hai) anos | |
pushInterface.go | %!s(int64=4) %!d(string=hai) anos |
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)
}