From 30d34b0c45ca9a2103ab30e8d62890e911539f68 Mon Sep 17 00:00:00 2001 From: Sean Murphy Date: Sat, 18 May 2019 20:02:25 +0200 Subject: [PATCH] Added support for posting multiple records to UDR service at once --- udr/udr.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/udr/udr.go b/udr/udr.go index fcd02eb..a79460a 100644 --- a/udr/udr.go +++ b/udr/udr.go @@ -36,6 +36,18 @@ type UDRService struct { Endpoint string } +// PostRecords takes a set of UDRRecords and posts them to the UDR endpoint +func (u *UDRService) PostRecords(records []UDRRecord) (success bool, err error) { + success = true + for _, r := range records { + success, err = u.PostRecord(r) + if !success { + return + } + } + return +} + // PostRecord takes a UDRRecord and posts it to the UDR endpoint func (u *UDRService) PostRecord(r UDRRecord) (success bool, err error) { val, _ := json.Marshal(r)