MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / GetAllBalanceMonitors

Method GetAllBalanceMonitors

api/balance.go:262–270  ·  view source on GitHub ↗

GetAllBalanceMonitors retrieves all balance monitor records in the system. It fetches the monitor records and responds with the list of monitors. If there's an error retrieving the monitors, it responds with an appropriate error message. Parameters: - c: The Gin context containing the request and r

(c *gin.Context)

Source from the content-addressed store, hash-verified

260// - 400 Bad Request: If there's an error retrieving the balance monitors.
261// - 200 OK: If the balance monitors are successfully retrieved.
262func (a Api) GetAllBalanceMonitors(c *gin.Context) {
263 monitors, err := a.ledgerforge.GetAllMonitors(c.Request.Context())
264 if err != nil {
265 c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
266 return
267 }
268
269 c.JSON(http.StatusOK, monitors)
270}
271
272// GetBalanceMonitorsByBalanceID retrieves all balance monitors associated with a specific balance ID.
273// It extracts the balance ID from the route parameters. If the balance ID is missing

Callers

nothing calls this directly

Calls 2

GetAllMonitorsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected