summaryrefslogtreecommitdiff
path: root/persistence/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'persistence/sqlite')
-rw-r--r--persistence/sqlite/sqliteRepository.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/persistence/sqlite/sqliteRepository.go b/persistence/sqlite/sqliteRepository.go
index 5950d51..dfeb23a 100644
--- a/persistence/sqlite/sqliteRepository.go
+++ b/persistence/sqlite/sqliteRepository.go
@@ -10,17 +10,17 @@ import (
"uvok.de/go/training_fellow/registration"
)
-type SqliteRepository struct {
- FileName string
+type sqliteRepository struct {
+ fileName string
context context.Context
}
-func NewRepository(fileName string, context context.Context) *SqliteRepository {
- repo := SqliteRepository{FileName: fileName, context: context}
+func NewRepository(fileName string, context context.Context) *sqliteRepository {
+ repo := sqliteRepository{fileName: fileName, context: context}
return &repo
}
-func (repo *SqliteRepository) SaveRegistration(registration *registration.Registration) error {
+func (repo *sqliteRepository) SaveRegistration(registration *registration.Registration) error {
db, err := repo.checkInit()
if err != nil {
return err
@@ -45,7 +45,8 @@ func (repo *SqliteRepository) SaveRegistration(registration *registration.Regist
return err
}
-func (repo *SqliteRepository) GetUnconfirmedRegistrations() ([]*registration.Registration, error) {
+
+func (repo *sqliteRepository) GetUnconfirmedRegistrations() ([]*registration.Registration, error) {
db, err := repo.checkInit()
if err != nil {
return nil, err
@@ -74,13 +75,13 @@ func (repo *SqliteRepository) GetUnconfirmedRegistrations() ([]*registration.Reg
return regArray, nil
}
-func (repo *SqliteRepository) ConfirmRegistration(registrationId string) (*registration.Registration, error) {
+func (repo *sqliteRepository) ConfirmRegistration(registrationId string) (*registration.Registration, error) {
repo.checkInit()
panic("not implemented") // TODO: Implement
}
-func (repo *SqliteRepository) checkInit() (*sql.DB, error) {
- db, err := sql.Open("sqlite", repo.FileName)
+func (repo *sqliteRepository) checkInit() (*sql.DB, error) {
+ db, err := sql.Open("sqlite", repo.fileName)
if err != nil {
return nil, err
}