/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/service/identify3.go
50 строк
2 KB
zoom-ua
remove golang.org/x/net/context in favor of context (#28708)
17 дек 2025, 18:24
Не верифицирован
17 дек 2025, 18:24
67b0ffe
Код
Авторство
О чём код?
package service import ( "context" "fmt" "github.com/keybase/client/go/identify3" "github.com/keybase/client/go/libkb" keybase1 "github.com/keybase/client/go/protocol/keybase1" "github.com/keybase/go-framed-msgpack-rpc/rpc" ) // identify3Handler handles one RPC in the identify3 flow type identify3Handler struct { libkb.Contextified xp rpc.Transporter } func (i *identify3Handler) newMetaContext(ctx context.Context) libkb.MetaContext { return libkb.NewMetaContext(ctx, i.G()).WithLogTag("ID3") } func newIdentify3Handler(xp rpc.Transporter, g *libkb.GlobalContext) *identify3Handler { return &identify3Handler{ Contextified: libkb.NewContextified(g), xp: xp, } } func (i *identify3Handler) Identify3(ctx context.Context, arg keybase1.Identify3Arg) (err error) { mctx := i.newMetaContext(ctx) defer mctx.Trace(fmt.Sprintf("Identify3(%+v)", arg), &err)() cli := rpc.NewClient(i.xp, libkb.NewContextifiedErrorUnwrapper(mctx.G()), nil) id3cli := keybase1.Identify3UiClient{Cli: cli} return identify3.Identify3(mctx, id3cli, arg) } func (i *identify3Handler) Identify3FollowUser(ctx context.Context, arg keybase1.Identify3FollowUserArg) (err error) { mctx := i.newMetaContext(ctx) defer mctx.Trace(fmt.Sprintf("Identify3FollowUser(%+v)", arg), &err)() return identify3.FollowUser(mctx, arg) } func (i *identify3Handler) Identify3IgnoreUser(ctx context.Context, guiID keybase1.Identify3GUIID) (err error) { mctx := i.newMetaContext(ctx) defer mctx.Trace(fmt.Sprintf("Identify3IgnoreUser(%+v)", guiID), &err)() return identify3.IgnoreUser(mctx, guiID) } var _ keybase1.Identify3Interface = (*identify3Handler)(nil)