当前位置: 首页>>代码示例>>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;未经允许,请勿转载。