push.go 526 B

1234567891011121314151617181920212223242526
  1. package bullet
  2. import (
  3. "bytes"
  4. )
  5. type pushStruct struct {
  6. Type string `json:"type"`
  7. Title string `json:"title"`
  8. Body string `json:"body"`
  9. Url string `json:"url"`
  10. }
  11. func (p pushStruct) getReader() (*bytes.Buffer, error) {
  12. return getReader(p)
  13. }
  14. func newNotePush(title, text string) pushStruct {
  15. push := pushStruct{Type: "note", Title: title, Body: text}
  16. return push
  17. }
  18. func newLinkPush(title, text, link string) pushStruct {
  19. push := pushStruct{Type: "note", Title: title, Body: text, Url: link}
  20. return push
  21. }