github.laiyagushi.com/gritzkoo/golang-health-checker v1.4.1
Legitimate Go health checker library
Go functions have machine-generated namesADODB.Stream ProgID
SHA-256038cdcc3295dbf6d3531aaf939f6668b7f39a5590d59fd6e5b0514d9a0f8e084
MaleculeH₂(Cm₂Db)Md(Bk)
Evidence
1package healthcheck
2
3import (
4 "net/http"
5 "sync"
6 "time"
7
8 "github.com/bradfitz/gomemcache/memcache"
9 "github.com/go-redis/redis"
10 "golang.org/x/crypto/openpgp/errors"
11)
12
13// HealthCheckerSimple performs a simple check of the application
14func HealthCheckerSimple() ApplicationHealthSimple {
15 return ApplicationHealthSimpl …
36:13… range config.Integrations {
37 switch v.Type {
38 case Redis:
39 go checkRedisClient(v, &result, &wg, checklist)
40 case Memcached:
41 go checkMemcachedClient(v, &result, &wg, checklist)
42 case Web:
43 go checkWebServiceClient(v, &result, &wg, checklist)
44 default:
45 go defaultAction(v, &result, &wg, checklist)
46 }
47 }
48 go func() {
49 wg.Wait()
50 close(checklist)
⋯4 lines
59:99… oup, checklist chan Integration) {
60 defer (*wg).Done()
61 var (
62 host = validateHost(config)
63 DB = 0
64 )
65 if config.DB > 0 {
66 DB = config.DB
67 }
68 rdb := redis.NewClient(&redis.Options{
69 Addr: host,
70 Password: config.Auth.Password, // no password set
71 DB: DB, // use default DB
72 })
124:4… imeout: time.Second * time.Duration(timeout),
125 }
126 request, _ := http.NewRequest("GET", host, nil)
127
128 if len(config.Headers) > 0 {
129 for _, v := range config.Headers {
130 request.Header.Add(v.Key, v.Value)
131 }
132 }
133 response, err := client.Do(request)
134 if err != nil || response.StatusCode != 200 {
135 myStatus = false
136 result.Status = false
137 }
138 checklist <- Integration …
1package main
2
3import (
4 "net/http"
5
6 "github.com/gin-gonic/gin"
7 "github.com/gritzkoo/golang-health-checker/pkg/healthcheck"
8)
9
10func main() {
11 // all the content below is just an example
12 // Gin instance
13 e := gin.Default()
14
15 // example of simple ca …
No evidence locations were recorded for this file. Raw result