This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "github.com/brianfromlife/golang-ecs/server" | |
| func main() { | |
| svr := server.New() | |
| svr.Start() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "net/http" | |
| "github.com/labstack/echo/v4" | |
| ) | |
| func main() { | |
| e := echo.New() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package server | |
| import "github.com/labstack/echo/v4" | |
| type app struct { | |
| server *echo.Echo | |
| } | |
| func New() app { | |
| server := echo.New() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package handlers | |
| import ( | |
| "net/http" | |
| "github.com/labstack/echo/v4" | |
| ) | |
| type HealthHandler struct{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package server | |
| import "github.com/brianfromlife/golang-ecs/server/handlers" | |
| func (a app) RouterSetup() { | |
| healthHandler := handlers.NewHealthHandler() | |
| a.server.GET("/public/healthy", healthHandler.Healthy) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package server | |
| import "github.com/labstack/echo/v4" | |
| type app struct { | |
| server *echo.Echo | |
| } | |
| func New() app { | |
| server := echo.New() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package handlers | |
| import ( | |
| "net/http" | |
| "net/http/httptest" | |
| "testing" | |
| "github.com/labstack/echo/v4" | |
| "github.com/stretchr/testify/assert" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.7" | |
| services: | |
| golang_ecs_mongo: | |
| image: mongo:3.6 | |
| environment: | |
| MONGO_INITDB_ROOT_USERNAME: root | |
| MONGO_INITDB_ROOT_PASSWORD: password | |
| MONGO_INITDB_DATABASE: golang_ecs | |
| ports: | |
| - 27017:27017 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package db | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "time" | |
| "go.mongodb.org/mongo-driver/mongo" | |
| "go.mongodb.org/mongo-driver/mongo/options" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "github.com/brianfromlife/golang-ecs/server" | |
| "github.com/brianfromlife/golang-ecs/server/db" | |
| ) | |
| func main() { | |
| db := db.New() |
OlderNewer