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

Method GetAllNodeInfo

consistent/persistence.go:58–76  ·  view source on GitHub ↗

GetAllNodeInfo implements Persistence interface.

()

Source from the content-addressed store, hash-verified

56
57// GetAllNodeInfo implements Persistence interface.
58func (s *KMSStorage) GetAllNodeInfo() (nodes []proto.Node, err error) {
59 IDs, err := kms.GetAllNodeID()
60 if err != nil {
61 log.WithError(err).Error("get all node id failed")
62 return
63 }
64 nodes = make([]proto.Node, 0, len(IDs))
65
66 for _, id := range IDs {
67 node, err := kms.GetNodeInfo(id)
68 if err != nil {
69 // this may happen, just continue
70 log.WithField("node", node).WithError(err).Error("get node info failed")
71 continue
72 }
73 nodes = append(nodes, *node)
74 }
75 return
76}

Callers

nothing calls this directly

Calls 6

GetAllNodeIDFunction · 0.92
WithErrorFunction · 0.92
GetNodeInfoFunction · 0.92
WithFieldFunction · 0.92
ErrorMethod · 0.80
WithErrorMethod · 0.80

Tested by

no test coverage detected