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.

50 lines
1.2 KiB

  1. package models
  2. import "time"
  3. // Log is the header/session for a log file.
  4. type Log struct {
  5. ID string `bson:"_id"`
  6. ShortID string `bson:"shortId"`
  7. Date time.Time `bson:"date"`
  8. ChannelName string `bson:"channel"`
  9. EventName string `bson:"event,omitempty"`
  10. Title string `bson:"title,omitempty"`
  11. Description string `bson:"description,omitempty"`
  12. Open bool `bson:"open"`
  13. CharacterIDs []string `bson:"characterIds"`
  14. }
  15. // A LogSuggestion is a suggestion for a log.
  16. type LogSuggestion struct {
  17. Log *Log
  18. Characters []*Character
  19. HasChannel bool
  20. HasEvent bool
  21. }
  22. // IsChangeObject is an interface implementation to identify it as a valid
  23. // ChangeObject in GQL.
  24. func (*Log) IsChangeObject() {
  25. panic("this method is a dummy, and so is its caller")
  26. }
  27. // A LogFilter is a filter that can be used to list logs.
  28. type LogFilter struct {
  29. Search *string
  30. Open *bool
  31. Characters []string
  32. Channels []string
  33. Events []string
  34. MinDate *time.Time
  35. MaxDate *time.Time
  36. Limit int
  37. }
  38. type LogUpdate struct {
  39. Title *string
  40. EventName *string
  41. Description *string
  42. Open *bool
  43. CharacterIDs []string
  44. }