refactor: move shared variables to repository.go file
This commit is contained in:
16
repository/repository.go
Normal file
16
repository/repository.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
)
|
||||
var (
|
||||
ErrDatabaseConn = errors.New("failed to begin transaction/connection with database")
|
||||
ErrExecuteQuery = errors.New("failed to execute query")
|
||||
ErrCommitQuery = errors.New("failed to commit transaction")
|
||||
ErrInvalidData = errors.New("data sent to save is invalid")
|
||||
ErrNotFound = sql.ErrNoRows
|
||||
)
|
||||
|
||||
var dateFormat = time.RFC3339
|
||||
@@ -171,10 +171,3 @@ func (r *UserRepository) Delete(u model.User) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
ErrNotFound = sql.ErrNoRows
|
||||
ErrInvalidData = errors.New("model was saved with invalid data")
|
||||
|
||||
repositoryDateFormat = time.RFC3339
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user