mirror of
https://gitlab.com/pnx-tools/dns-updater.git
synced 2026-06-16 05:54:56 +02:00
26 lines
379 B
Go
26 lines
379 B
Go
package dns
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
type Record struct {
|
|
Id string // Internal id.
|
|
Name string
|
|
Ip net.IP
|
|
}
|
|
|
|
type RecordList []Record
|
|
|
|
func (l *RecordList) Add(record Record) {
|
|
*l = append(*l, record)
|
|
}
|
|
|
|
func (l RecordList) FindByName(name string) (Record, bool) {
|
|
for _, record := range l {
|
|
if record.Name == name {
|
|
return record, true
|
|
}
|
|
}
|
|
return Record{}, false
|
|
}
|