summaryrefslogtreecommitdiff
path: root/persistence
diff options
context:
space:
mode:
authoruvok cheetah2023-12-09 17:43:29 +0000
committeruvok cheetah2023-12-09 17:55:24 +0000
commit5d1dcea0f50ebc9dbb4a5af787d12654abb6377b (patch)
tree04b712f59356b4993ee32b3c1e13039a5f9e03ca /persistence
parent47fbc9de11d1685c0dd2ed876ea6a2fa72b1abc1 (diff)
Hide struct details
Diffstat (limited to 'persistence')
-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
}