當前位置: 首頁>>代碼示例>>Golang>>正文


Golang dnsprovider.ResourceRecordSets類代碼示例

本文整理匯總了Golang中k8s/io/kubernetes/federation/pkg/dnsprovider.ResourceRecordSets的典型用法代碼示例。如果您正苦於以下問題:Golang ResourceRecordSets類的具體用法?Golang ResourceRecordSets怎麽用?Golang ResourceRecordSets使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ResourceRecordSets類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: addRrsetOrFail

func addRrsetOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordSet {
	result, err := rrsets.Add(rrset)
	if err != nil {
		t.Fatalf("Failed to add recordsets: %v", err)
	}
	return result
}
開發者ID:CsatariGergely,項目名稱:kubernetes,代碼行數:7,代碼來源:route53_test.go

示例2: getRrOrFail

func getRrOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, name string) dnsprovider.ResourceRecordSet {
	rrset, err := rrsets.Get(name)
	if err != nil {
		t.Fatalf("Failed to get recordset: %v", err)
	} else if rrset == nil {
		t.Logf("Did not Get recordset: %v", name)
	} else {
		t.Logf("Got recordset: %v", rrset.Name())
	}
	return rrset
}
開發者ID:alex-mohr,項目名稱:kubernetes,代碼行數:11,代碼來源:coredns_test.go

示例3: listRrsOrFail

func listRrsOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets) []dnsprovider.ResourceRecordSet {
	rrset, err := rrsets.List()
	if err != nil {
		t.Fatalf("Failed to list recordsets: %v", err)
	} else {
		if len(rrset) < 0 {
			t.Fatalf("Record set length=%d, expected >=0", len(rrset))
		} else {
			t.Logf("Got %d recordsets: %v", len(rrset), rrset)
		}
	}
	return rrset
}
開發者ID:CsatariGergely,項目名稱:kubernetes,代碼行數:13,代碼來源:route53_test.go

示例4: getRrset

/* getRrset is a hack around the fact that dnsprovider.ResourceRecordSets interface does not yet include a Get() method, only a List() method.  TODO:  Fix that.
   Note that if the named resource record set does not exist, but no error occurred, the returned set, and error, are both nil
*/
func getRrset(dnsName string, rrsetsInterface dnsprovider.ResourceRecordSets) (dnsprovider.ResourceRecordSet, error) {
	var returnVal dnsprovider.ResourceRecordSet
	rrsets, err := rrsetsInterface.List()
	if err != nil {
		return nil, err
	}
	for _, rrset := range rrsets {
		if rrset.Name() == dnsName {
			returnVal = rrset
			break
		}
	}
	return returnVal, nil
}
開發者ID:RyanBinfeng,項目名稱:kubernetes,代碼行數:17,代碼來源:dns.go

示例5: addRrsetOrFail

func addRrsetOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, rrset dnsprovider.ResourceRecordSet) {
	err := rrsets.StartChangeset().Add(rrset).Apply()
	if err != nil {
		t.Fatalf("Failed to add recordsets: %v", err)
	}
}
開發者ID:humblec,項目名稱:kubernetes,代碼行數:6,代碼來源:route53_test.go

示例6: getRrset

//   Note that if the named resource record set does not exist, but no error occurred, the returned set, and error, are both nil
func getRrset(dnsName string, rrsetsInterface dnsprovider.ResourceRecordSets) (dnsprovider.ResourceRecordSet, error) {
	return rrsetsInterface.Get(dnsName)
}
開發者ID:alex-mohr,項目名稱:kubernetes,代碼行數:4,代碼來源:dns.go


注:本文中的k8s/io/kubernetes/federation/pkg/dnsprovider.ResourceRecordSets類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。