本文整理汇总了Golang中github.com/keybase/client/go/libkb.TrackChainLink.ToServiceBlocks方法的典型用法代码示例。如果您正苦于以下问题:Golang TrackChainLink.ToServiceBlocks方法的具体用法?Golang TrackChainLink.ToServiceBlocks怎么用?Golang TrackChainLink.ToServiceBlocks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/keybase/client/go/libkb.TrackChainLink
的用法示例。
在下文中一共展示了TrackChainLink.ToServiceBlocks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: linkSocialProofs
func (e *ListTrackingEngine) linkSocialProofs(link *libkb.TrackChainLink) (res []keybase1.TrackProof) {
for _, sb := range link.ToServiceBlocks() {
if !sb.IsSocial() {
continue
}
proofType, proofName := sb.ToKeyValuePair()
res = append(res, keybase1.TrackProof{
ProofType: proofType,
ProofName: proofName,
IdString: sb.ToIDString(),
})
}
return res
}
示例2: linkWebProofs
func (e *ListTrackingEngine) linkWebProofs(link *libkb.TrackChainLink) (res []keybase1.WebProof) {
webp := make(map[string]*keybase1.WebProof)
for _, sb := range link.ToServiceBlocks() {
if sb.IsSocial() {
continue
}
proofType, proofName := sb.ToKeyValuePair()
p, ok := webp[proofName]
if !ok {
p = &keybase1.WebProof{Hostname: proofName}
webp[proofName] = p
}
p.Protocols = append(p.Protocols, proofType)
}
for _, v := range webp {
res = append(res, *v)
}
return res
}