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.

32 lines
624 B

  1. package log
  2. // Filter for the List() function
  3. type Filter struct {
  4. Search *string
  5. Characters *[]string
  6. Channels *[]string
  7. Events *[]string
  8. Open *bool
  9. Limit *int32
  10. }
  11. // NewFilter makes a new filter
  12. func NewFilter() *Filter {
  13. return &Filter{}
  14. }
  15. // WithLimit adds a max amount of results to be returned.
  16. func (filter *Filter) WithLimit(limit int) *Filter {
  17. limitPtr := int32(limit)
  18. filter.Limit = &limitPtr
  19. return filter
  20. }
  21. // WithOpen filters on whether a log is open.
  22. func (filter *Filter) WithOpen(limit int) *Filter {
  23. limitPtr := int32(limit)
  24. filter.Limit = &limitPtr
  25. return filter
  26. }