コード例 #1
0
ファイル: meta.go プロジェクト: chendx79/gafka
func (this *BrokerInfo) NamedAddr() string {
	dns, present := ctx.ReverseDnsLookup(this.Host, this.Port)
	if !present {
		return this.Addr()
	}

	return fmt.Sprintf("%s:%d", dns, this.Port)
}
コード例 #2
0
ファイル: meta.go プロジェクト: funkygao/gafka
func (this *BrokerZnode) NamedAddr() (string, bool) {
	dns, present := ctx.ReverseDnsLookup(this.Host, this.Port)
	if !present {
		return this.Addr(), false
	}

	return fmt.Sprintf("%s:%d", dns, this.Port), true
}