(ip string, options *ElementOptions, overwrite bool)
| 126 | } |
| 127 | |
| 128 | func (this *Set) AddIPElement(ip string, options *ElementOptions, overwrite bool) error { |
| 129 | var ipObj = net.ParseIP(ip) |
| 130 | if ipObj == nil { |
| 131 | return errors.New("invalid ip '" + ip + "'") |
| 132 | } |
| 133 | |
| 134 | if utils.IsIPv4(ip) { |
| 135 | return this.AddElement(ipObj.To4(), options, overwrite) |
| 136 | } else { |
| 137 | return this.AddElement(ipObj.To16(), options, overwrite) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | func (this *Set) DeleteElement(key []byte) error { |
| 142 | // if set element does not exist, we return immediately |
no test coverage detected