本文整理汇总了Golang中github.com/keybase/client/go/libkb.User.GetUID方法的典型用法代码示例。如果您正苦于以下问题:Golang User.GetUID方法的具体用法?Golang User.GetUID怎么用?Golang User.GetUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/keybase/client/go/libkb.User
的用法示例。
在下文中一共展示了User.GetUID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: storeRemoteUntrack
func (e *UntrackEngine) storeRemoteUntrack(them *libkb.User, ctx *Context) (err error) {
e.G().Log.Debug("+ StoreRemoteUntrack")
defer e.G().Log.Debug("- StoreRemoteUntrack -> %s", libkb.ErrToOk(err))
arg := libkb.SecretKeyArg{
Me: e.arg.Me,
KeyType: libkb.DeviceSigningKeyType,
}
var signingKeyPriv libkb.GenericKey
if signingKeyPriv, err = e.G().Keyrings.GetSecretKeyWithPrompt(ctx.LoginContext, arg, ctx.SecretUI, "untracking signature"); err != nil {
return
}
var sig string
var sigid keybase1.SigID
if sig, sigid, err = signingKeyPriv.SignToString(e.untrackStatementBytes); err != nil {
return
}
_, err = e.G().API.Post(libkb.APIArg{
Endpoint: "follow",
NeedSession: true,
Args: libkb.HTTPArgs{
"sig_id_base": libkb.S{Val: sigid.ToString(false)},
"sig_id_short": libkb.S{Val: sigid.ToShortID()},
"sig": libkb.S{Val: sig},
"uid": libkb.UIDArg(them.GetUID()),
"type": libkb.S{Val: "untrack"},
"signing_kid": e.signingKeyPub.GetKID(),
},
})
return
}
示例2: checkTrackCommon
func checkTrackCommon(tc libkb.TestContext, blocks []sb, outcome *keybase1.IdentifyOutcome, them *libkb.User, ui *FakeIdentifyUI) error {
me, err := libkb.LoadMe(libkb.NewLoadUserArg(tc.G))
if err != nil {
return err
}
if them == nil {
tc.T.Fatal("checkTrackCommon called with nil 'them' user")
}
s, err := me.TrackChainLinkFor(them.GetName(), them.GetUID())
if err != nil {
return err
}
if s == nil {
tc.T.Fatal("me.TrackChainLinkFor(...) returned nil, nil")
}
tc.T.Logf("payload json:\n%s", s.GetPayloadJSON().MarshalPretty())
sbs := s.ToServiceBlocks()
if len(sbs) != len(blocks) {
return fmt.Errorf("num service blocks: %d, expected %d", len(sbs), len(blocks))
}
sort.Sort(byID(sbs))
for i, sb := range sbs {
tsb := blocks[i]
if sb.IsSocial() != tsb.social {
return fmt.Errorf("(sb %d): social: %v, expected %v", i, sb.IsSocial(), tsb.social)
}
if sb.ToIDString() != tsb.id {
return fmt.Errorf("(sb %d): id: %s, expected %s", i, sb.ToIDString(), tsb.id)
}
if sb.GetProofState() != tsb.proofState {
return fmt.Errorf("(sb %d): proof state: %d, expected %d", i, sb.GetProofState(), tsb.proofState)
}
}
if ui.Outcome.TrackStatus != outcome.TrackStatus {
return fmt.Errorf("track status: %d, expected %d", ui.Outcome.TrackStatus, outcome.TrackStatus)
}
if ui.Outcome.NumTrackFailures != outcome.NumTrackFailures {
return fmt.Errorf("num track failures: %d, expected %d", ui.Outcome.NumTrackFailures, outcome.NumTrackFailures)
}
if ui.Outcome.NumTrackChanges != outcome.NumTrackChanges {
return fmt.Errorf("num track changes: %d, expected %d", ui.Outcome.NumTrackChanges, outcome.NumTrackChanges)
}
if ui.Outcome.NumProofFailures != outcome.NumProofFailures {
return fmt.Errorf("num proof failures: %d, expected %d", ui.Outcome.NumProofFailures, outcome.NumProofFailures)
}
if ui.Outcome.NumProofSuccesses != outcome.NumProofSuccesses {
return fmt.Errorf("num proof successes: %d, expected %d", ui.Outcome.NumProofSuccesses, outcome.NumProofSuccesses)
}
if ui.Outcome.NumRevoked != outcome.NumRevoked {
return fmt.Errorf("num revoked: %d, expected %d", ui.Outcome.NumRevoked, outcome.NumRevoked)
}
return nil
}
示例3: storeLocalUntrack
func (e *UntrackEngine) storeLocalUntrack(them *libkb.User) error {
return libkb.RemoveLocalTrack(e.arg.Me.GetUID(), them.GetUID(), e.G())
}
示例4: storeLocalUntrack
func (e *UntrackEngine) storeLocalUntrack(them *libkb.User) error {
// Also do a removal in case of expiring local tracks
return libkb.RemoveLocalTracks(e.arg.Me.GetUID(), them.GetUID(), e.G())
}