• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang engine.RunEngine函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/keybase/client/go/engine.RunEngine函数的典型用法代码示例。如果您正苦于以下问题:Golang RunEngine函数的具体用法?Golang RunEngine怎么用?Golang RunEngine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: PassphraseChange

func (h *AccountHandler) PassphraseChange(_ context.Context, arg keybase1.PassphraseChangeArg) error {
	eng := engine.NewPassphraseChange(&arg, h.G())
	ctx := &engine.Context{
		SecretUI: h.getSecretUI(arg.SessionID),
	}
	return engine.RunEngine(eng, ctx)
}
开发者ID:polluks,项目名称:client,代码行数:7,代码来源:account.go


示例2: keygen

func (h *PGPHandler) keygen(sessionID int, earg engine.PGPKeyImportEngineArg, doInteractive bool) (err error) {
	ctx := &engine.Context{LogUI: h.getLogUI(sessionID), SecretUI: h.getSecretUI(sessionID)}
	earg.Gen.AddDefaultUID()
	eng := engine.NewPGPKeyImportEngine(earg)
	err = engine.RunEngine(eng, ctx)
	return err
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:7,代码来源:pgp.go


示例3: FavoriteAdd

// FavoriteAdd handles the favoriteAdd RPC.
func (h *FavoriteHandler) FavoriteAdd(_ context.Context, arg keybase1.FavoriteAddArg) error {
	eng := engine.NewFavoriteAdd(&arg, h.G())
	ctx := &engine.Context{
		IdentifyUI: h.NewRemoteIdentifyUI(arg.SessionID, h.G()),
	}
	return engine.RunEngine(eng, ctx)
}
开发者ID:qbit,项目名称:client,代码行数:8,代码来源:favorite.go


示例4: run

func (h *SigsHandler) run(args keybase1.SigListArgs) (*engine.SigsList, error) {
	ctx := &engine.Context{}

	ea := engine.SigsListArgs{
		Username: args.Username,
		AllKeys:  args.AllKeys,
		Filterx:  args.Filterx,
		Verbose:  args.Verbose,
		Revoked:  args.Revoked,
		Types:    nil,
	}
	if args.Types != nil {
		t := make(map[string]bool)
		f := func(v bool, name string) {
			if v {
				t[name] = true
			}
		}
		f(args.Types.Track, "track")
		f(args.Types.Proof, "proof")
		f(args.Types.Cryptocurrency, "cryptocurrency")
		f(args.Types.IsSelf, "self")
		ea.Types = t
	}
	eng := engine.NewSigsList(ea, h.G())
	if err := engine.RunEngine(eng, ctx); err != nil {
		return nil, err
	}
	return eng, nil
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:30,代码来源:sigs.go


示例5: CreateAndSignupFakeUser

func CreateAndSignupFakeUser(prefix string, g *libkb.GlobalContext) (*FakeUser, error) {
	fu, err := NewFakeUser(prefix)
	if err != nil {
		return nil, err
	}
	arg := engine.SignupEngineRunArg{
		Username:   fu.Username,
		Email:      fu.Email,
		InviteCode: testInviteCode,
		Passphrase: fu.Passphrase,
		DeviceName: "my device",
		SkipGPG:    true,
		SkipMail:   true,
	}
	ctx := &engine.Context{
		LogUI:    g.UI.GetLogUI(),
		GPGUI:    &gpgtestui{},
		SecretUI: fu.NewSecretUI(),
		LoginUI:  libkb.TestLoginUI{Username: fu.Username},
	}
	s := engine.NewSignupEngine(&arg, g)
	if err := engine.RunEngine(s, ctx); err != nil {
		return nil, err
	}
	return fu, nil
}
开发者ID:moul,项目名称:client,代码行数:26,代码来源:kbtest.go


示例6: PGPDecrypt

func (h *PGPHandler) PGPDecrypt(_ context.Context, arg keybase1.PGPDecryptArg) (keybase1.PGPSigVerification, error) {
	cli := h.getStreamUICli()
	src := libkb.NewRemoteStreamBuffered(arg.Source, cli, arg.SessionID)
	snk := libkb.NewRemoteStreamBuffered(arg.Sink, cli, arg.SessionID)
	earg := &engine.PGPDecryptArg{
		Sink:         snk,
		Source:       src,
		AssertSigned: arg.Opts.AssertSigned,
		SignedBy:     arg.Opts.SignedBy,
	}
	ctx := &engine.Context{
		SecretUI:   h.getSecretUI(arg.SessionID, h.G()),
		IdentifyUI: h.NewRemoteSkipPromptIdentifyUI(arg.SessionID, h.G()),
		LogUI:      h.getLogUI(arg.SessionID),
		PgpUI:      h.getPgpUI(arg.SessionID),
		SessionID:  arg.SessionID,
	}
	eng := engine.NewPGPDecrypt(earg, h.G())
	err := engine.RunEngine(eng, ctx)
	if err != nil {
		return keybase1.PGPSigVerification{}, err
	}

	return sigVer(eng.SignatureStatus(), eng.Owner()), nil
}
开发者ID:jacobhaven,项目名称:client,代码行数:25,代码来源:pgp.go


示例7: RegisterBTC

// BTC creates a BTCEngine and runs it.
func (h *BTCHandler) RegisterBTC(_ context.Context, arg keybase1.RegisterBTCArg) error {
	ctx := engine.Context{
		LogUI:    h.getLogUI(arg.SessionID),
		SecretUI: h.getSecretUI(arg.SessionID),
	}
	eng := engine.NewBTCEngine(arg.Address, arg.Force, h.G())
	return engine.RunEngine(eng, &ctx)
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:9,代码来源:btc.go


示例8: GetFavorites

// FavoriteList handles the favoriteList RPC.
func (h *FavoriteHandler) GetFavorites(_ context.Context, sessionID int) (keybase1.FavoritesResult, error) {
	eng := engine.NewFavoriteList(h.G())
	ctx := &engine.Context{}
	if err := engine.RunEngine(eng, ctx); err != nil {
		return keybase1.FavoritesResult{}, err
	}
	return eng.Result(), nil
}
开发者ID:qbit,项目名称:client,代码行数:9,代码来源:favorite.go


示例9: DeviceAdd

// DeviceAdd starts the kex2 device provisioning on the
// provisioner (device X/C1)
func (h *DeviceHandler) DeviceAdd(_ context.Context, sessionID int) error {
	ctx := &engine.Context{
		ProvisionUI: h.getProvisionUI(sessionID),
		SecretUI:    h.getSecretUI(sessionID),
	}
	eng := engine.NewDeviceAdd(h.G())
	return engine.RunEngine(eng, ctx)
}
开发者ID:mark-adams,项目名称:client,代码行数:10,代码来源:device.go


示例10: DeviceList

// DeviceList returns a list of all the devices for a user.
func (h *DeviceHandler) DeviceList(_ context.Context, sessionID int) ([]keybase1.Device, error) {
	ctx := &engine.Context{LogUI: h.getLogUI(sessionID)}
	eng := engine.NewDevList(h.G())
	if err := engine.RunEngine(eng, ctx); err != nil {
		return nil, err
	}
	return eng.List(), nil
}
开发者ID:mark-adams,项目名称:client,代码行数:9,代码来源:device.go


示例11: Deprovision

func (h *LoginHandler) Deprovision(_ context.Context, arg keybase1.DeprovisionArg) error {
	eng := engine.NewDeprovisionEngine(h.G(), arg.Username)
	ctx := engine.Context{
		LogUI:    h.getLogUI(arg.SessionID),
		SecretUI: h.getSecretUI(arg.SessionID),
	}
	return engine.RunEngine(eng, &ctx)
}
开发者ID:polluks,项目名称:client,代码行数:8,代码来源:login.go


示例12: XLogin

func (h *LoginHandler) XLogin(_ context.Context, arg keybase1.XLoginArg) error {
	ctx := &engine.Context{
		LogUI:       h.getLogUI(arg.SessionID),
		ProvisionUI: h.getProvisionUI(arg.SessionID),
	}
	eng := engine.NewXLogin(h.G(), arg.DeviceType, arg.Username)
	return engine.RunEngine(eng, ctx)
}
开发者ID:alex,项目名称:client-beta,代码行数:8,代码来源:login.go


示例13: PGPUpdate

func (h *PGPHandler) PGPUpdate(_ context.Context, arg keybase1.PGPUpdateArg) error {
	ctx := engine.Context{
		LogUI:    h.getLogUI(arg.SessionID),
		SecretUI: h.getSecretUI(arg.SessionID),
	}
	eng := engine.NewPGPUpdateEngine(arg.Fingerprints, arg.All, h.G())
	return engine.RunEngine(eng, &ctx)
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:8,代码来源:pgp.go


示例14: PaperKeySubmit

func (h *LoginHandler) PaperKeySubmit(_ context.Context, arg keybase1.PaperKeySubmitArg) error {
	ctx := &engine.Context{
		LogUI:     h.getLogUI(arg.SessionID),
		SessionID: arg.SessionID,
	}
	eng := engine.NewPaperKeySubmit(h.G(), arg.PaperPhrase)
	return engine.RunEngine(eng, ctx)
}
开发者ID:qbit,项目名称:client,代码行数:8,代码来源:login.go


示例15: RevokeSigs

func (h *RevokeHandler) RevokeSigs(_ context.Context, arg keybase1.RevokeSigsArg) error {
	ctx := engine.Context{
		LogUI:    h.getLogUI(arg.SessionID),
		SecretUI: h.getSecretUI(arg.SessionID),
	}
	eng := engine.NewRevokeSigsEngine(arg.SigIDs, h.G())
	return engine.RunEngine(eng, &ctx)
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:8,代码来源:revoke.go


示例16: Unlock

func (h *LoginHandler) Unlock(_ context.Context, sessionID int) error {
	ctx := &engine.Context{
		LogUI:    h.getLogUI(sessionID),
		SecretUI: h.getSecretUI(sessionID),
	}
	eng := engine.NewUnlock(h.G())
	return engine.RunEngine(eng, ctx)
}
开发者ID:stevefox,项目名称:client,代码行数:8,代码来源:login.go


示例17: FavoriteList

// FavoriteList handles the favoriteList RPC.
func (h *FavoriteHandler) FavoriteList(_ context.Context, sessionID int) ([]keybase1.Folder, error) {
	eng := engine.NewFavoriteList(h.G())
	ctx := &engine.Context{}
	if err := engine.RunEngine(eng, ctx); err != nil {
		return nil, err
	}
	return eng.Favorites(), nil
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:9,代码来源:favorite.go


示例18: listTrackers

func (h *UserHandler) listTrackers(sessionID int, eng *engine.ListTrackersEngine) ([]keybase1.Tracker, error) {
	ctx := &engine.Context{LogUI: h.getLogUI(sessionID)}
	if err := engine.RunEngine(eng, ctx); err != nil {
		return nil, err
	}
	res := eng.ExportedList()
	return res, nil
}
开发者ID:mark-adams,项目名称:client,代码行数:8,代码来源:user.go


示例19: UnlockWithPassphrase

func (h *LoginHandler) UnlockWithPassphrase(_ context.Context, arg keybase1.UnlockWithPassphraseArg) error {
	ctx := &engine.Context{
		LogUI:    h.getLogUI(arg.SessionID),
		SecretUI: h.getSecretUI(arg.SessionID),
	}
	eng := engine.NewUnlockWithPassphrase(h.G(), arg.Passphrase)
	return engine.RunEngine(eng, ctx)
}
开发者ID:Varjelus,项目名称:keybase-client,代码行数:8,代码来源:login.go


示例20: RevokeDevice

func (h *RevokeHandler) RevokeDevice(_ context.Context, arg keybase1.RevokeDeviceArg) error {
	sessionID := arg.SessionID
	ctx := engine.Context{
		LogUI:    h.getLogUI(sessionID),
		SecretUI: h.getSecretUI(sessionID),
	}
	eng := engine.NewRevokeDeviceEngine(engine.RevokeDeviceEngineArgs{ID: arg.DeviceID, Force: arg.Force}, h.G())
	return engine.RunEngine(eng, &ctx)
}
开发者ID:paul-pearce,项目名称:client-beta,代码行数:9,代码来源:revoke.go



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang kex2.MessageRouter类代码示例发布时间:2022-05-23
下一篇:
Golang cli.Context类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap