Added GET /health-check and related files

This commit is contained in:
Tarcisio Gruppi
2019-01-17 14:09:13 -02:00
parent 27f15e3436
commit 471afa4e0e
6 changed files with 55 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ type Datastore interface {
PriceInterface
SessionInterface
ApiKeyInterface
SystemHealthInteface
}
func NewDB(dataSourceName string) (*DB, error) {

View File

@@ -0,0 +1,5 @@
package db
type SystemHealthInteface interface {
Ping() error
}

View File

@@ -22,6 +22,7 @@ type Interface interface {
PriceInterface
SessionInterface
ApiKeyInterface
SystemHealthInteface
}
func NewModel(db db.Datastore, bcrypt util.Bcrypt, config types.Config) *Model {

9
core/model/syshealth.go Normal file
View File

@@ -0,0 +1,9 @@
package model
type SystemHealthInteface interface {
PingDatabase() error
}
func (model *Model) PingDatabase() error {
return model.db.Ping()
}