Beispiel #1
0
func CreateZone(name string) (types.Zone, error) {
	if GetZoneByName(name) != nil {
		return nil, errors.New("A zone with that name already exists")
	}

	return db.NewZone(name), nil
}
Beispiel #2
0
func Test_Zone(t *testing.T) {
	zoneName := "testzone"
	zone := database.NewZone(zoneName)

	testutils.Assert(zone.GetName() == zoneName, t, "Zone didn't have correct name upon creation", zoneName, zone.GetName())
}