MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / formatAck

Method formatAck

sqlchain/observer/api.go:620–643  ·  view source on GitHub ↗
(ack *types.SignedAckHeader)

Source from the content-addressed store, hash-verified

618}
619
620func (a *explorerAPI) formatAck(ack *types.SignedAckHeader) map[string]interface{} {
621 return map[string]interface{}{
622 "ack": map[string]interface{}{
623 "request": map[string]interface{}{
624 "hash": ack.GetRequestHash().String(),
625 "timestamp": a.formatTime(ack.GetRequestTimestamp()),
626 "node": ack.Response.Request.NodeID,
627 "type": ack.Response.Request.QueryType.String(),
628 "count": ack.Response.Request.BatchCount,
629 },
630 "response": map[string]interface{}{
631 "hash": ack.GetResponseHash().String(),
632 "timestamp": a.formatTime(ack.GetResponseTimestamp()),
633 "node": ack.Response.NodeID,
634 "log_id": ack.Response.LogOffset, // savepoint id in eventual consistency mode
635 "last_insert_id": ack.Response.LastInsertID,
636 "affected_rows": ack.Response.AffectedRows,
637 },
638 "hash": ack.Hash().String(),
639 "timestamp": a.formatTime(ack.Timestamp),
640 "node": ack.NodeID,
641 },
642 }
643}
644
645func (a *explorerAPI) formatTime(t time.Time) float64 {
646 return float64(t.UnixNano()) / 1e6

Callers 1

GetAckMethod · 0.95

Calls 7

formatTimeMethod · 0.95
GetResponseHashMethod · 0.80
GetResponseTimestampMethod · 0.80
HashMethod · 0.65
StringMethod · 0.45
GetRequestHashMethod · 0.45
GetRequestTimestampMethod · 0.45

Tested by

no test coverage detected