repository

package
Version: v0.0.0-...-3051362 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CharacterRepository

type CharacterRepository interface {
	// Get a Character by id. Returns the character, whether it's found and an error
	Get(c *gin.Context, id int64) (model.Character, bool, error)

	// GetAll retrieves all character in the repository
	GetAll(c *gin.Context) ([]model.Character, error)

	// Save stores a new character
	Save(c *gin.Context, chCmd model.CharacterCommand) (model.Character, error)

	// Update a character. Returns the updated character, whether it's found and an error
	Update(c *gin.Context, id int64, chCmd model.CharacterCommand) (model.Character, bool, error)

	// Delete a character. If the character has phrases this will fail. Remove all phrases before
	Delete(c *gin.Context, id int64) error
}

type PhraseRepository

type PhraseRepository interface {
	// Get a phrase for a character
	Get(c *gin.Context, characterId int64, id int64) (model.Phrase, bool, error)

	// GetAllForCharacter retrieves all phrases from a character
	GetAllForCharacter(c *gin.Context, characterId int64) ([]model.Phrase, bool, error)

	// Save stores a new phrase for a character
	Save(c *gin.Context, phCmd model.PhraseCommand) (model.Phrase, error)

	// Delete a phrase for a character
	Delete(c *gin.Context, characterId int64, id int64) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL