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"
|
||||||
@ -17,7 +18,8 @@ type Storager interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type storage struct {
|
type storage struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
mux sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
type DBConfig struct {
|
type DBConfig struct {
|
||||||
@ -88,6 +90,7 @@ 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