github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/client/serviceregistration/nsd/statuses.go (about) 1 package nsd 2 3 import ( 4 "github.com/hashicorp/nomad/client/serviceregistration/checks/checkstore" 5 ) 6 7 func NewStatusGetter(shim checkstore.Shim) *StatusGetter { 8 return &StatusGetter{ 9 shim: shim, 10 } 11 } 12 13 // StatusGetter is the implementation of CheckStatusGetter for Nomad services. 14 type StatusGetter struct { 15 // Unlike consul we can simply query for check status information from our 16 // own Client state store. 17 shim checkstore.Shim 18 } 19 20 // Get returns current status of every live check in the Nomad service provider. 21 // 22 // returns checkID => checkStatus 23 func (s StatusGetter) Get() (map[string]string, error) { 24 return s.shim.Snapshot(), nil 25 }