From 35628cbc7d5f858e9b21168352cd651962c58ea5 Mon Sep 17 00:00:00 2001 From: Don Cote Date: Mon, 30 Sep 2019 14:23:16 -0400 Subject: [PATCH] change arg to interface --- record.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/record.go b/record.go index 001d902..2815d9f 100644 --- a/record.go +++ b/record.go @@ -95,12 +95,13 @@ func (c Client) GetNextRecord(consumerID string) (*Record, error) { return &record, nil } -// PublishRecord allows for the publishing of a record on the client's topic -func (c Client) PublishRecord(d Data) error { +// Publish allows for the publishing of a record on the client's topic +func (c Client) Publish(d interface{}) error { url := fmt.Sprintf("%s/topics/%s/records?api_key=%s", c.BaseURL, c.TopicSlug, c.APIKey) // marshal body to byte array - body, err := json.Marshal(d) + data := Data{Data: d} + body, err := json.Marshal(data) if err != nil { return errors.Wrap(err, fmt.Sprintf("error marshaling json for data %v", d)) }