MCPcopy
hub / github.com/DNSControl/dnscontrol / parseHeaderAsInt

Function parseHeaderAsInt

providers/hetzner/api.go:36–45  ·  view source on GitHub ↗
(headers http.Header, headerName string, fallback int64)

Source from the content-addressed store, hash-verified

34}
35
36func parseHeaderAsInt(headers http.Header, headerName string, fallback int64) (int64, error) {
37 v := headers.Get(headerName)
38 if v == "" {
39 return fallback, nil
40 }
41 if i, err := strconv.ParseInt(v, 10, 64); err == nil {
42 return i, nil
43 }
44 return 0, fmt.Errorf("expected header %q to contain number, got %q", headerName, v)
45}
46
47func (api *hetznerProvider) bulkCreateRecords(records []record) error {
48 request := bulkCreateRecordsRequest{

Callers 2

parseHeaderAsSecondsFunction · 0.70
handleResponseMethod · 0.70

Calls 2

GetMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected