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.

25 lines
550 B

  1. package services
  2. import (
  3. "git.aiterp.net/rpdata/api/repositories"
  4. "git.aiterp.net/rpdata/api/services/loaders"
  5. )
  6. // A Bundle contains all services.
  7. type Bundle struct {
  8. Tags *TagService
  9. Characters *CharacterService
  10. }
  11. // NewBundle creates a new bundle.
  12. func NewBundle(repos *repositories.Bundle) *Bundle {
  13. bundle := &Bundle{}
  14. bundle.Tags = &TagService{tags: repos.Tags}
  15. bundle.Characters = &CharacterService{
  16. characters: repos.Characters,
  17. loader: loaders.CharacterLoaderFromRepository(repos.Characters),
  18. }
  19. return bundle
  20. }