probo/store/store.go

61 lines
1.9 KiB
Go
Raw Normal View History

2022-06-23 11:25:35 +02:00
package store
import (
2022-06-24 18:56:06 +02:00
"git.andreafazzi.eu/andrea/probo/client"
"git.andreafazzi.eu/andrea/probo/models"
2022-06-23 11:25:35 +02:00
)
2023-10-28 20:50:06 +02:00
type QuizReader interface {
2022-06-23 11:25:35 +02:00
ReadAllQuizzes() ([]*models.Quiz, error)
2023-10-28 20:50:06 +02:00
ReadQuizByID(id string) (*models.Quiz, error)
2023-07-10 13:23:46 +02:00
ReadQuizByHash(hash string) (*models.Quiz, error)
2023-10-28 20:50:06 +02:00
}
type QuizWriter interface {
2022-06-29 16:08:55 +02:00
CreateQuiz(r *client.CreateUpdateQuizRequest) (*models.Quiz, error)
2023-10-28 20:50:06 +02:00
UpdateQuiz(r *client.CreateUpdateQuizRequest, id string) (*models.Quiz, bool, error)
2023-09-01 11:48:09 +02:00
DeleteQuiz(r *client.DeleteQuizRequest) (*models.Quiz, error)
2023-10-28 20:50:06 +02:00
}
2023-10-07 11:43:12 +02:00
2023-10-28 20:50:06 +02:00
type CollectionReader interface {
2023-10-07 11:43:12 +02:00
ReadAllCollections() ([]*models.Collection, error)
ReadCollectionByID(id string) (*models.Collection, error)
2023-10-28 20:50:06 +02:00
}
type CollectionWriter interface {
2023-10-07 11:43:12 +02:00
CreateCollection(r *client.CreateUpdateCollectionRequest) (*models.Collection, error)
2023-10-28 20:50:06 +02:00
UpdateCollection(r *client.CreateUpdateCollectionRequest, id string) (*models.Collection, bool, error)
2023-10-07 11:43:12 +02:00
DeleteCollection(r *client.DeleteCollectionRequest) (*models.Collection, error)
2022-06-23 11:25:35 +02:00
}
2023-10-28 20:50:06 +02:00
type ParticipantReader interface {
ReadAllParticipants() ([]*models.Participant, error)
ReadParticipantByID(id string) (*models.Participant, error)
}
type ParticipantWriter interface {
CreateParticipant(r *client.CreateUpdateParticipantRequest) (*models.Participant, error)
UpdateParticipant(r *client.CreateUpdateParticipantRequest, id string) (*models.Participant, bool, error)
DeleteParticipant(r *client.DeleteParticipantRequest) (*models.Participant, error)
}
type ExamReader interface {
ReadAllExams() ([]*models.Exam, error)
ReadExamByID(id string) (*models.Exam, error)
}
type ExamWriter interface {
CreateExam(r *client.CreateUpdateExamRequest) (*models.Exam, error)
UpdateExam(r *client.CreateUpdateExamRequest, id string) (*models.Exam, bool, error)
DeleteExam(r *client.DeleteExamRequest) (*models.Exam, error)
}
type ProboCollectorStore interface {
QuizReader
QuizWriter
CollectionReader
CollectionWriter
ParticipantReader
ParticipantWriter
}