예제 #1
0
// test scribble cache deleteRecord
func TestScribbleDeleteRecord(t *testing.T) {
	scribbleReset()
	err := cache.DeleteRecord("nanobox.io")
	cache.AddRecord(&nanopack)
	err2 := cache.DeleteRecord("nanopack.io")
	if err != nil || err2 != nil {
		t.Errorf("Failed to delete record from scribble cacher - %v%v", err, err2)
	}
}
예제 #2
0
// test nil cache deleteRecord
func TestNoneDeleteRecord(t *testing.T) {
	noneReset()
	err := cache.DeleteRecord("nanopack.io")
	if err != nil {
		t.Errorf("Failed to delete record from none cacher - %v", err)
	}
}
예제 #3
0
파일: shaman.go 프로젝트: nanopack/shaman
// DeleteRecord deletes the resource(domain)
func DeleteRecord(domain string) error {
	sham.SanitizeDomain(&domain)

	// update cache
	config.Log.Trace("Removing record from persistent cache...")
	err := cache.DeleteRecord(domain)
	if err != nil {
		return err
	}

	// todo: atomic
	delete(Answers, domain)

	// otherwise, be idempotent and report it was deleted...
	return nil
}