chore: Add string method to dbrp mapper filter

pull/10616/head
Nathaniel Cook 2018-08-08 13:48:46 -06:00
parent 6bf2820e81
commit e17518d57e
1 changed files with 35 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"bytes"
"context"
"errors"
"strconv"
"strings"
"unicode"
)
@ -93,3 +94,37 @@ type DBRPMappingFilter struct {
RetentionPolicy *string
Default *bool
}
func (f DBRPMappingFilter) String() string {
var s strings.Builder
s.WriteString("{")
s.WriteString("cluster:")
if f.Cluster != nil {
s.WriteString(*f.Cluster)
} else {
s.WriteString("<nil>")
}
s.WriteString(" db:")
if f.Database != nil {
s.WriteString(*f.Database)
} else {
s.WriteString("<nil>")
}
s.WriteString(" rp:")
if f.RetentionPolicy != nil {
s.WriteString(*f.RetentionPolicy)
} else {
s.WriteString("<nil>")
}
s.WriteString(" default:")
if f.Default != nil {
s.WriteString(strconv.FormatBool(*f.Default))
} else {
s.WriteString("<nil>")
}
s.WriteString("}")
return s.String()
}