Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
wild-workouts-go-ddd-example/internal/trainings/domain/training/repository.go
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
27 lines (21 sloc)
533 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package training | |
import ( | |
"context" | |
"fmt" | |
) | |
type NotFoundError struct { | |
TrainingUUID string | |
} | |
func (e NotFoundError) Error() string { | |
return fmt.Sprintf("training '%s' not found", e.TrainingUUID) | |
} | |
type Repository interface { | |
AddTraining(ctx context.Context, tr *Training) error | |
GetTraining(ctx context.Context, trainingUUID string, user User) (*Training, error) | |
UpdateTraining( | |
ctx context.Context, | |
trainingUUID string, | |
user User, | |
updateFn func(ctx context.Context, tr *Training) (*Training, error), | |
) error | |
} |