Steve Coffman 2019-08-11 19:11:33 -04:00
parent ccf2b7b321
commit 083e2b588e

View file

@ -98,6 +98,16 @@ func NewIngester(host string, port int, password string) (Ingestable, error) {
}
func (i ingesterChannel) Push(collection, bucket, object, text string) (err error) {
//
patterns := []struct {
Pattern string
Replacement string
}{{"\\", "\\\\"},
{"\n", "\\n"},
{"\"", "\\\""}}
for _, v := range patterns {
text = strings.Replace(text, v.Pattern, v.Replacement, -1)
}
chunks := splitText(text, i.cmdMaxBytes/2)
// split chunks with partial success will yield single error