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.

35 lines
1012 B

  1. package models
  2. import "time"
  3. // A File is a record of a file stored in the Space.
  4. type File struct {
  5. ID string `bson:"_id" json:"id"`
  6. Time time.Time `bson:"time" json:"time"`
  7. Kind string `bson:"kind" json:"kind"`
  8. Public bool `bson:"public" json:"public"`
  9. Name string `bson:"name" json:"name"`
  10. MimeType string `bson:"mimeType" json:"mimeType"`
  11. Size int64 `bson:"size" json:"size"`
  12. Author string `bson:"author" json:"author"`
  13. URL string `bson:"url,omitempty" json:"url,omitempty"`
  14. }
  15. // IsChangeObject is an interface implementation to identify it as a valid
  16. // ChangeObject in GQL.
  17. func (*File) IsChangeObject() {
  18. panic("this method is a dummy, and so is its caller")
  19. }
  20. // A FileFilter is a filter that can be used to filter files.
  21. type FileFilter struct {
  22. Author *string
  23. Public *bool
  24. MimeTypes []string
  25. }
  26. // A FileUpdate is a set of changes possible to do on file metadata.
  27. type FileUpdate struct {
  28. Public *bool
  29. Name *string
  30. }