本文整理匯總了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
}