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.

39 lines
751 B

  1. package types
  2. import "git.aiterp.net/rpdata/api/model/channel"
  3. // ChannelResolver for the Channel graphql type
  4. type ChannelResolver struct{ C channel.Channel }
  5. // Name resolves channel.name
  6. func (r *ChannelResolver) Name() string {
  7. return r.C.Name
  8. }
  9. // Logged resolves channel.logged
  10. func (r *ChannelResolver) Logged() bool {
  11. return r.C.Logged
  12. }
  13. // Hub resolves channel.hub
  14. func (r *ChannelResolver) Hub() bool {
  15. return r.C.Hub
  16. }
  17. // EventName resolves channel.eventName
  18. func (r *ChannelResolver) EventName() *string {
  19. if r.C.Event == "" {
  20. return nil
  21. }
  22. return &r.C.Event
  23. }
  24. // LocationName resolves channel.locationName
  25. func (r *ChannelResolver) LocationName() *string {
  26. if r.C.Location == "" {
  27. return nil
  28. }
  29. return &r.C.Location
  30. }