Rename CopyRdata to just Copy.
Still not sure if this makes things more clear.
This commit is contained in:
parent
685f708a9e
commit
45f3dc89e4
|
@ -102,7 +102,7 @@ func (rd *APAIR) Unpack(buf []byte) (int, error) {
|
|||
return len(buf), nil
|
||||
}
|
||||
|
||||
func (rd *APAIR) CopyRdata(dest dns.PrivateRdata) error {
|
||||
func (rd *APAIR) Copy(dest dns.PrivateRdata) error {
|
||||
cp := make([]byte, rd.Len())
|
||||
_, err := rd.Pack(cp)
|
||||
if err != nil {
|
||||
|
|
|
@ -25,8 +25,8 @@ type PrivateRdata interface {
|
|||
// Unpack is used when unpacking a private RR from a buffer.
|
||||
// TODO(miek): diff. signature than Pack, see edns0.go for instance.
|
||||
Unpack([]byte) (int, error)
|
||||
// CopyRdata copies the Rdata.
|
||||
CopyRdata(PrivateRdata) error
|
||||
// Copy copies the Rdata.
|
||||
Copy(PrivateRdata) error
|
||||
// Len returns the length in octets of the Rdata.
|
||||
Len() int
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ func (r *PrivateRR) copy() RR {
|
|||
newh := r.Hdr.copyHeader()
|
||||
rr.Hdr = *newh
|
||||
|
||||
err := r.Data.CopyRdata(rr.Data)
|
||||
err := r.Data.Copy(rr.Data)
|
||||
if err != nil {
|
||||
panic("dns: got value that could not be used to copy Private rdata")
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ func (rd *ISBN) Unpack(buf []byte) (int, error) {
|
|||
return len(buf), nil
|
||||
}
|
||||
|
||||
func (rd *ISBN) CopyRdata(dest dns.PrivateRdata) error {
|
||||
func (rd *ISBN) Copy(dest dns.PrivateRdata) error {
|
||||
isbn, ok := dest.(*ISBN)
|
||||
if !ok {
|
||||
return dns.ErrRdata
|
||||
|
@ -127,7 +127,7 @@ func (rd *VERSION) Unpack(buf []byte) (int, error) {
|
|||
return len(buf), nil
|
||||
}
|
||||
|
||||
func (rd *VERSION) CopyRdata(dest dns.PrivateRdata) error {
|
||||
func (rd *VERSION) Copy(dest dns.PrivateRdata) error {
|
||||
isbn, ok := dest.(*VERSION)
|
||||
if !ok {
|
||||
return dns.ErrRdata
|
||||
|
|
Loading…
Reference in New Issue