22 lines
383 B
Go
22 lines
383 B
Go
|
package context
|
||
|
|
||
|
import (
|
||
|
"gorm.io/gorm"
|
||
|
"reichard.io/imagini/internal/query"
|
||
|
"reichard.io/imagini/internal/config"
|
||
|
)
|
||
|
|
||
|
type ImaginiContext struct {
|
||
|
DB *gorm.DB
|
||
|
Config *config.Config
|
||
|
}
|
||
|
|
||
|
func NewImaginiContext() *ImaginiContext {
|
||
|
c := config.NewConfig()
|
||
|
gormDB := query.NewDB(c)
|
||
|
return &ImaginiContext{
|
||
|
DB: gormDB,
|
||
|
Config: c,
|
||
|
}
|
||
|
}
|