Modified PostRecords function to return number of records posted

master
Sean Murphy 6 years ago
parent 30d34b0c45
commit 3f1abb30ac
  1. 4
      udr/udr.go

@ -37,13 +37,15 @@ type UDRService struct {
} }
// PostRecords takes a set of UDRRecords and posts them to the UDR endpoint // PostRecords takes a set of UDRRecords and posts them to the UDR endpoint
func (u *UDRService) PostRecords(records []UDRRecord) (success bool, err error) { func (u *UDRService) PostRecords(records []UDRRecord) (success bool, recordsWritten int, err error) {
success = true success = true
recordsWritten = 0
for _, r := range records { for _, r := range records {
success, err = u.PostRecord(r) success, err = u.PostRecord(r)
if !success { if !success {
return return
} }
recordsWritten++
} }
return return
} }

Loading…
Cancel
Save