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.

19 lines
871 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 logs.
  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. List(ctx context.Context, filter models.CharacterFilter) ([]*models.Character, error)
  11. Insert(ctx context.Context, character models.Character) (*models.Character, error)
  12. Update(ctx context.Context, character models.Character, update models.CharacterUpdate) (*models.Character, error)
  13. AddNick(ctx context.Context, character models.Character, nick string) (*models.Character, error)
  14. RemoveNick(ctx context.Context, character models.Character, nick string) (*models.Character, error)
  15. Delete(ctx context.Context, character models.Character) error
  16. }