wip
This commit is contained in:
parent
130dfb682a
commit
ca9dbcd1f2
@ -3,6 +3,7 @@ package storage
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"git.espin.casa/albert/cml04-falcon-system/internal/types"
|
"git.espin.casa/albert/cml04-falcon-system/internal/types"
|
||||||
"gorm.io/driver/postgres"
|
"gorm.io/driver/postgres"
|
||||||
@ -18,6 +19,7 @@ type Storager interface {
|
|||||||
|
|
||||||
type storage struct {
|
type storage struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
mux sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
type DBConfig struct {
|
type DBConfig struct {
|
||||||
@ -89,5 +91,6 @@ func New(conf *DBConfig) (Storager, error) {
|
|||||||
// done
|
// done
|
||||||
return &storage{
|
return &storage{
|
||||||
db: db,
|
db: db,
|
||||||
|
mux: sync.RWMutex{},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user