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.

20 lines
948 B

  1. package repositories
  2. import (
  3. "context"
  4. "git.aiterp.net/rpdata/api/models"
  5. )
  6. // CharacterRepository is an interface for a database using characters.
  7. type CharacterRepository interface {
  8. Find(ctx context.Context, id string) (*models.Character, error)
  9. FindNick(ctx context.Context, nick string) (*models.Character, error)
  10. FindName(ctx context.Context, name string) (*models.Character, error)
  11. List(ctx context.Context, filter models.CharacterFilter) ([]*models.Character, error)
  12. Insert(ctx context.Context, character models.Character) (*models.Character, error)
  13. Update(ctx context.Context, character models.Character, update models.CharacterUpdate) (*models.Character, error)
  14. AddNick(ctx context.Context, character models.Character, nick string) (*models.Character, error)
  15. RemoveNick(ctx context.Context, character models.Character, nick string) (*models.Character, error)
  16. Delete(ctx context.Context, character models.Character) error
  17. }