interfaces.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package raven
  2. // https://docs.getsentry.com/hosted/clientdev/interfaces/#message-interface
  3. type Message struct {
  4. // Required
  5. Message string `json:"message"`
  6. // Optional
  7. Params []interface{} `json:"params,omitempty"`
  8. }
  9. func (m *Message) Class() string { return "logentry" }
  10. // https://docs.getsentry.com/hosted/clientdev/interfaces/#template-interface
  11. type Template struct {
  12. // Required
  13. Filename string `json:"filename"`
  14. Lineno int `json:"lineno"`
  15. ContextLine string `json:"context_line"`
  16. // Optional
  17. PreContext []string `json:"pre_context,omitempty"`
  18. PostContext []string `json:"post_context,omitempty"`
  19. AbsolutePath string `json:"abs_path,omitempty"`
  20. }
  21. func (t *Template) Class() string { return "template" }
  22. // https://docs.getsentry.com/hosted/clientdev/interfaces/#context-interfaces
  23. type User struct {
  24. // All fields are optional
  25. ID string `json:"id,omitempty"`
  26. Username string `json:"username,omitempty"`
  27. Email string `json:"email,omitempty"`
  28. IP string `json:"ip_address,omitempty"`
  29. }
  30. func (h *User) Class() string { return "user" }
  31. // https://docs.getsentry.com/hosted/clientdev/interfaces/#context-interfaces
  32. type Query struct {
  33. // Required
  34. Query string `json:"query"`
  35. // Optional
  36. Engine string `json:"engine,omitempty"`
  37. }
  38. func (q *Query) Class() string { return "query" }