mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
REFACTOR: Add Joined and Segmented accessors to TXT, and other cleanups (#2628)
This commit is contained in:
@@ -17,6 +17,11 @@ func SplitSingleLongTxt(records []*models.RecordConfig) {
|
||||
}
|
||||
}
|
||||
|
||||
// Segment returns the string as 255-octet segments, the last being the remainder.
|
||||
func Segment(s string) []string {
|
||||
return splitChunks(s, 255)
|
||||
}
|
||||
|
||||
func splitChunks(buf string, lim int) []string {
|
||||
var chunk string
|
||||
chunks := make([]string, 0, len(buf)/lim+1)
|
||||
|
Reference in New Issue
Block a user