Initial commit.
This commit is contained in:
commit
63f43e568c
23 changed files with 1199 additions and 0 deletions
31
container/container.go
Normal file
31
container/container.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"goweb/config"
|
||||
)
|
||||
|
||||
type Container struct {
|
||||
Web *echo.Echo
|
||||
Config *config.Config
|
||||
// Cache
|
||||
// DB
|
||||
}
|
||||
|
||||
func NewContainer() *Container {
|
||||
var c Container
|
||||
|
||||
// Web
|
||||
c.Web = echo.New()
|
||||
|
||||
// Configuration
|
||||
cfg, err := config.GetConfig()
|
||||
if err != nil {
|
||||
c.Web.Logger.Fatal("Failed to load configuration")
|
||||
panic(err)
|
||||
}
|
||||
c.Config = &cfg
|
||||
|
||||
return &c
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue