Showing 3 of 5 files from the diff.
Newly tracked file
api/health_check.go created.
Other files ignored by Codecov
Dockerfile has changed.

@@ -19,7 +19,7 @@
Loading
19 19
type Config struct {
20 20
    ApplicationKey string `json:"application_key"`
21 21
    DatastoreHost string `json:"datastore_host"`
22 -
    DatastorePort string `json:"datastore_port"`
22 +
    DatastorePort int `json:"datastore_port"`
23 23
    DatastoreNamePrefix string `json:"datastore_name_prefix"`
24 24
    DatastorePassword string `json:"datastore_password"`
25 25
    DatastoreSslMode string `json:"datastore_ssl_mode"`

@@ -0,0 +1,30 @@
Loading
1 +
package api
2 +
3 +
import (
4 +
    "net/http"
5 +
6 +
    "github.com/gin-gonic/gin"
7 +
8 +
    "github.com/earaujoassis/space/datastore"
9 +
)
10 +
11 +
func exposeHealthCheck(router *gin.RouterGroup) {
12 +
    healthCheckRoutes := router.Group("/")
13 +
    {
14 +
        healthCheckRoutes.GET("/health-check", func(c *gin.Context) {
15 +
            var count struct{
16 +
                Count int64
17 +
            }
18 +
19 +
            dataStoreSession := datastore.GetDataStoreConnection()
20 +
            dataStoreSession.
21 +
                Raw("SELECT count(*) AS count FROM clients;").
22 +
                Scan(&count)
23 +
            if count.Count >= 0 {
24 +
                c.String(http.StatusOK, "healthy")
25 +
            } else {
26 +
                c.String(http.StatusOK, "unhealthy")
27 +
            }
28 +
        })
29 +
    }
30 +
}

@@ -10,4 +10,5 @@
Loading
10 10
    exposeUsersRoutes(router)
11 11
    exposeSessionsRoutes(router)
12 12
    exposeClientsRoutes(router)
13 +
    exposeHealthCheck(router)
13 14
}
Files Coverage
api 5.34%
config 16.67%
models 24.67%
security 75.61%
acceptance/acceptance_utils.go 0.00%
feature/feature_gate.go 100.00%
utils/http.go 100.00%
Project Totals (18 files) 15.19%
222.1
TRAVIS_OS_NAME=linux
1.12.12=.12.12
221.1
TRAVIS_OS_NAME=linux
1.12.12=.12.12

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading