GraphQL API and utilities for the rpdata project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
770 B

  1. package models
  2. import "time"
  3. // A Post is a part of a log file.
  4. type Post struct {
  5. ID string `bson:"_id"`
  6. LogID string `bson:"logId"`
  7. Time time.Time `bson:"time"`
  8. Kind string `bson:"kind"`
  9. Nick string `bson:"nick"`
  10. Text string `bson:"text"`
  11. Position int `bson:"position"`
  12. }
  13. // IsChangeObject is an interface implementation to identify it as a valid
  14. // ChangeObject in GQL.
  15. func (*Post) IsChangeObject() {
  16. panic("this method is a dummy, and so is its caller")
  17. }
  18. // PostFilter is used to generate a query to the database.
  19. type PostFilter struct {
  20. IDs []string
  21. Kinds []string
  22. LogID *string
  23. Search *string
  24. Limit int
  25. }
  26. type PostUpdate struct {
  27. Time *time.Time
  28. Kind *string
  29. Nick *string
  30. Text *string
  31. }