当前位置: 首页>>代码示例>>Golang>>正文


Golang UID.String方法代码示例

本文整理汇总了Golang中github.com/keybase/client/go/protocol.UID.String方法的典型用法代码示例。如果您正苦于以下问题:Golang UID.String方法的具体用法?Golang UID.String怎么用?Golang UID.String使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/keybase/client/go/protocol.UID的用法示例。


在下文中一共展示了UID.String方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: getUserCard

func getUserCard(g *libkb.GlobalContext, uid keybase1.UID, useSession bool) (ret *keybase1.UserCard, err error) {
	defer g.Trace("getUserCard", func() error { return err })()

	arg := libkb.APIArg{
		Endpoint:     "user/card",
		NeedSession:  useSession,
		Contextified: libkb.NewContextified(g),
		Args:         libkb.HTTPArgs{"uid": libkb.S{Val: uid.String()}},
	}

	var card card

	if err = g.API.GetDecode(arg, &card); err != nil {
		g.Log.Warning("error getting user/card for %s: %s\n", uid, err)
		return nil, err
	}

	g.Log.Debug("user card: %+v", card)

	ret = &keybase1.UserCard{
		Following:     card.FollowSummary.Following,
		Followers:     card.FollowSummary.Followers,
		Uid:           uid,
		FullName:      card.Profile.FullName,
		Location:      card.Profile.Location,
		Bio:           card.Profile.Bio,
		Website:       card.Profile.Website,
		Twitter:       card.Profile.Twitter,
		YouFollowThem: card.YouFollowThem,
		TheyFollowYou: card.TheyFollowYou,
	}
	return ret, nil
}
开发者ID:mark-adams,项目名称:client,代码行数:33,代码来源:identify.go

示例2: getLocalUser

func (m localUserMap) getLocalUser(uid keybase1.UID) (LocalUser, error) {
	user, ok := m[uid]
	if !ok {
		return LocalUser{}, NoSuchUserError{uid.String()}
	}
	return user, nil
}
开发者ID:gozes,项目名称:kbfs-beta,代码行数:7,代码来源:keybase_daemon_local.go

示例3: NewRekeyPermissionError

// NewRekeyPermissionError constructs a RekeyPermissionError for the given
// directory and user.
func NewRekeyPermissionError(ctx context.Context, config Config, dir *TlfHandle,
	uid keybase1.UID) error {
	dirname := dir.ToString(ctx, config)
	if name, err2 := config.KBPKI().GetNormalizedUsername(ctx, uid); err2 == nil {
		return RekeyPermissionError{string(name), dirname}
	}
	return RekeyPermissionError{uid.String(), dirname}
}
开发者ID:gozes,项目名称:kbfs-beta,代码行数:10,代码来源:errors.go

示例4: NewUserConfig

func NewUserConfig(id keybase1.UID, name NormalizedUsername, salt []byte, dev keybase1.DeviceID) *UserConfig {
	ret := &UserConfig{
		ID:               id.String(),
		Name:             name,
		Salt:             hex.EncodeToString(salt),
		Device:           nil,
		importedID:       id,
		importedSalt:     salt,
		importedDeviceID: dev,
	}
	if dev.Exists() {
		tmp := dev.String()
		ret.Device = &tmp
	}
	return ret
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:16,代码来源:userconfig.go

示例5: GetUser

func (u *userKeyAPI) GetUser(ctx context.Context, uid keybase1.UID) (
	un libkb.NormalizedUsername, sibkeys, subkeys []keybase1.KID, err error) {
	u.log.Debug("+ GetUser")
	defer func() {
		u.log.Debug("- GetUser -> %v", err)
	}()
	var ukr userKeyRes
	err = u.api.GetDecode(libkb.APIArg{
		Endpoint: "user/keys",
		Args: libkb.HTTPArgs{
			"uid": libkb.S{Val: uid.String()},
		},
	}, &ukr)
	if err != nil {
		return "", nil, nil, err
	}
	un = libkb.NewNormalizedUsername(ukr.Username)
	return un, ukr.PublicKeys.Sibkeys, ukr.PublicKeys.Subkeys, nil
}
开发者ID:Varjelus,项目名称:keybase-client,代码行数:19,代码来源:user_keys_api.go

示例6: DbKeyUID

func DbKeyUID(t ObjType, uid keybase1.UID) DbKey {
	return DbKey{Typ: t, Key: uid.String()}
}
开发者ID:mark-adams,项目名称:client,代码行数:3,代码来源:db.go

示例7: UIDArg

func UIDArg(uid keybase1.UID) HTTPValue {
	return S{Val: uid.String()}
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:3,代码来源:uid.go

示例8: UIDWrapper

func UIDWrapper(uid keybase1.UID) *jsonw.Wrapper {
	return jsonw.NewString(uid.String())
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:3,代码来源:uid.go


注:本文中的github.com/keybase/client/go/protocol.UID.String方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。