This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/internal/context/context.go

22 lines
375 B
Go
Raw Normal View History

2021-01-12 04:48:32 +00:00
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()
2021-01-12 22:06:27 +00:00
db := query.NewDB(c)
2021-01-12 04:48:32 +00:00
return &ImaginiContext{
2021-01-12 22:06:27 +00:00
DB: db,
2021-01-12 04:48:32 +00:00
Config: c,
}
}