dns/zone.go
Miek Gieben 9b1e7b4b3d documentation
make Str_rr and Str_class private, prolly only needed
for parsing
2011-07-23 23:15:40 +02:00

35 lines
670 B
Go

// Copyright 2011 Miek Gieben. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dns
import (
"container/vector"
)
// Zone implements the concept of RFC 1035 master zone files.
type Zone struct {
v vector.Vector
}
// Add a new RR to the zone.
func (z *Zone) Push(r RR) {
z.v.Push(r)
}
// Remove a RR from the zone.
func (z *Zone) Pop() RR {
return z.v.Pop().(RR)
}
// Return the RR at index i of zone.
func (z *Zone) At(i int) RR {
return z.v.At(i).(RR)
}
// The number of RRs in zone.
func (z *Zone) Len() int {
return z.v.Len()
}