/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/protocol/keybase1/airdrop.go
96 строк
2 KB
chrisnojima-zoom
Version 670 - clean2 (#29122)
08 июн 2026, 19:31
Не верифицирован
08 июн 2026, 19:31
1943197
Код
Авторство
О чём код?
// Code generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler). DO NOT EDIT. // Input file: avdl/keybase1/airdrop.avdl package keybase1 import ( "context" "time" "github.com/keybase/go-framed-msgpack-rpc/rpc" ) type AirdropDetails struct { Uid UID `codec:"uid" json:"uid"` Kid BinaryKID `codec:"kid" json:"kid"` Vid VID `codec:"vid" json:"vid"` Vers string `codec:"vers" json:"vers"` Time Time `codec:"time" json:"time"` } func (o AirdropDetails) DeepCopy() AirdropDetails { return AirdropDetails{ Uid: o.Uid.DeepCopy(), Kid: o.Kid.DeepCopy(), Vid: o.Vid.DeepCopy(), Vers: o.Vers, Time: o.Time.DeepCopy(), } } type Reg1Arg struct { Uid UID `codec:"uid" json:"uid"` Kid BinaryKID `codec:"kid" json:"kid"` } type Reg2Arg struct { Ctext []byte `codec:"ctext" json:"ctext"` } type AirdropInterface interface { Reg1(context.Context, Reg1Arg) (BinaryKID, error) Reg2(context.Context, []byte) error } func AirdropProtocol(i AirdropInterface) rpc.Protocol { return rpc.Protocol{ Name: "keybase.1.airdrop", Methods: map[string]rpc.ServeHandlerDescription{ "reg1": { MakeArg: func() any { var ret [1]Reg1Arg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]Reg1Arg) if !ok { err = rpc.NewTypeError((*[1]Reg1Arg)(nil), args) return } ret, err = i.Reg1(ctx, typedArgs[0]) return }, }, "reg2": { MakeArg: func() any { var ret [1]Reg2Arg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]Reg2Arg) if !ok { err = rpc.NewTypeError((*[1]Reg2Arg)(nil), args) return } err = i.Reg2(ctx, typedArgs[0].Ctext) return }, }, }, } } type AirdropClient struct { Cli rpc.GenericClient } func (c AirdropClient) Reg1(ctx context.Context, __arg Reg1Arg) (res BinaryKID, err error) { err = c.Cli.Call(ctx, "keybase.1.airdrop.reg1", []any{__arg}, &res, 0*time.Millisecond) return } func (c AirdropClient) Reg2(ctx context.Context, ctext []byte) (err error) { __arg := Reg2Arg{Ctext: ctext} err = c.Cli.Call(ctx, "keybase.1.airdrop.reg2", []any{__arg}, nil, 0*time.Millisecond) return }