MCPcopy Create free account
hub / github.com/ethereum/node-crawler / clientQuery

Function clientQuery

pkg/api/api.go:289–304  ·  view source on GitHub ↗
(db *sql.DB, query string, args ...interface{})

Source from the content-addressed store, hash-verified

287}
288
289func clientQuery(db *sql.DB, query string, args ...interface{}) ([]client, error) {
290 rows, err := db.Query(query, args...)
291 if err != nil {
292 return nil, err
293 }
294 var clients []client
295 for rows.Next() {
296 var cl client
297 err = rows.Scan(&cl.Name, &cl.Count)
298 if err != nil {
299 return nil, err
300 }
301 clients = append(clients, cl)
302 }
303 return clients, nil
304}
305
306func validateKey(key string) bool {
307 validKeys := map[string]struct{}{

Callers 1

cachedOrQueryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected