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.

23 lines
568 B

  1. package services
  2. import (
  3. "context"
  4. "git.aiterp.net/rpdata/api/models"
  5. "git.aiterp.net/rpdata/api/repositories"
  6. )
  7. // TagService is a service for tag-related functions.
  8. type TagService struct {
  9. tags repositories.TagRepository
  10. }
  11. // FindTag finds one tag.
  12. func (s *TagService) FindTag(ctx context.Context, source models.TagKind, id string) (*models.Tag, error) {
  13. return s.tags.Find(ctx, source, id)
  14. }
  15. // ListTags lists tags.
  16. func (s *TagService) ListTags(ctx context.Context, filter models.TagFilter) ([]*models.Tag, error) {
  17. return s.tags.List(ctx, filter)
  18. }