MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / parseUint64

Function parseUint64

dgraph/cmd/alpha/http.go:91–103  ·  view source on GitHub ↗

parseUint64 reads the value for given URL parameter from request and parses it into uint64, empty string is converted into zero value

(r *http.Request, name string)

Source from the content-addressed store, hash-verified

89// parseUint64 reads the value for given URL parameter from request and
90// parses it into uint64, empty string is converted into zero value
91func parseUint64(r *http.Request, name string) (uint64, error) {
92 value := r.URL.Query().Get(name)
93 if value == "" {
94 return 0, nil
95 }
96
97 uintVal, err := strconv.ParseUint(value, 0, 64)
98 if err != nil {
99 return 0, errors.Wrapf(err, "while parsing %s as uint64", name)
100 }
101
102 return uintVal, nil
103}
104
105// parseBool reads the value for given URL parameter from request and
106// parses it into bool, empty string is converted into zero value

Callers 3

queryHandlerFunction · 0.85
mutationHandlerFunction · 0.85
commitHandlerFunction · 0.85

Calls 2

GetMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…