Piotr Czajkowski b113ea9395 Added DeepSource badge | há 3 anos atrás | |
---|---|---|
.github | há 4 anos atrás | |
.deepsource.toml | há 3 anos atrás | |
LICENSE.md | há 4 anos atrás | |
README.md | há 3 anos atrás | |
bullet.go | há 3 anos atrás | |
bullet_test.go | há 3 anos atrás | |
devices.go | há 3 anos atrás | |
error.go | há 4 anos atrás | |
fileUpload.go | há 3 anos atrás | |
push.go | há 3 anos atrás | |
pushInterface.go | há 4 anos atrás | |
pushes.go | há 3 anos atrás |
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 all active pushes (modifiedAfter can be nil, limit <= 0 gives default of 500). Cursor is returned with every call (in Devices struct) and is used for pagination, so if you want to see next page of results in your next call provide cursor received from the last call.
devices, err := b.ListPushes(true, nil, 0, "")
if err != nil {
t.Error(err)
}