github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/keybase1/sigs.go (about) 1 // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler) 2 // Input file: avdl/keybase1/sigs.avdl 3 4 package keybase1 5 6 import ( 7 "github.com/keybase/go-framed-msgpack-rpc/rpc" 8 context "golang.org/x/net/context" 9 "time" 10 ) 11 12 type Sig struct { 13 Seqno Seqno `codec:"seqno" json:"seqno"` 14 SigID SigID `codec:"sigID" json:"sigID"` 15 SigIDDisplay string `codec:"sigIDDisplay" json:"sigIDDisplay"` 16 Type string `codec:"type" json:"type"` 17 CTime Time `codec:"cTime" json:"cTime"` 18 Revoked bool `codec:"revoked" json:"revoked"` 19 Active bool `codec:"active" json:"active"` 20 Key string `codec:"key" json:"key"` 21 Body string `codec:"body" json:"body"` 22 } 23 24 func (o Sig) DeepCopy() Sig { 25 return Sig{ 26 Seqno: o.Seqno.DeepCopy(), 27 SigID: o.SigID.DeepCopy(), 28 SigIDDisplay: o.SigIDDisplay, 29 Type: o.Type, 30 CTime: o.CTime.DeepCopy(), 31 Revoked: o.Revoked, 32 Active: o.Active, 33 Key: o.Key, 34 Body: o.Body, 35 } 36 } 37 38 type SigTypes struct { 39 Track bool `codec:"track" json:"track"` 40 Proof bool `codec:"proof" json:"proof"` 41 Cryptocurrency bool `codec:"cryptocurrency" json:"cryptocurrency"` 42 IsSelf bool `codec:"isSelf" json:"isSelf"` 43 } 44 45 func (o SigTypes) DeepCopy() SigTypes { 46 return SigTypes{ 47 Track: o.Track, 48 Proof: o.Proof, 49 Cryptocurrency: o.Cryptocurrency, 50 IsSelf: o.IsSelf, 51 } 52 } 53 54 type SigListArgs struct { 55 SessionID int `codec:"sessionID" json:"sessionID"` 56 Username string `codec:"username" json:"username"` 57 AllKeys bool `codec:"allKeys" json:"allKeys"` 58 Types *SigTypes `codec:"types,omitempty" json:"types,omitempty"` 59 Filterx string `codec:"filterx" json:"filterx"` 60 Verbose bool `codec:"verbose" json:"verbose"` 61 Revoked bool `codec:"revoked" json:"revoked"` 62 } 63 64 func (o SigListArgs) DeepCopy() SigListArgs { 65 return SigListArgs{ 66 SessionID: o.SessionID, 67 Username: o.Username, 68 AllKeys: o.AllKeys, 69 Types: (func(x *SigTypes) *SigTypes { 70 if x == nil { 71 return nil 72 } 73 tmp := (*x).DeepCopy() 74 return &tmp 75 })(o.Types), 76 Filterx: o.Filterx, 77 Verbose: o.Verbose, 78 Revoked: o.Revoked, 79 } 80 } 81 82 type SigListArg struct { 83 SessionID int `codec:"sessionID" json:"sessionID"` 84 Arg SigListArgs `codec:"arg" json:"arg"` 85 } 86 87 type SigListJSONArg struct { 88 SessionID int `codec:"sessionID" json:"sessionID"` 89 Arg SigListArgs `codec:"arg" json:"arg"` 90 } 91 92 type SigsInterface interface { 93 SigList(context.Context, SigListArg) ([]Sig, error) 94 SigListJSON(context.Context, SigListJSONArg) (string, error) 95 } 96 97 func SigsProtocol(i SigsInterface) rpc.Protocol { 98 return rpc.Protocol{ 99 Name: "keybase.1.sigs", 100 Methods: map[string]rpc.ServeHandlerDescription{ 101 "sigList": { 102 MakeArg: func() interface{} { 103 var ret [1]SigListArg 104 return &ret 105 }, 106 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 107 typedArgs, ok := args.(*[1]SigListArg) 108 if !ok { 109 err = rpc.NewTypeError((*[1]SigListArg)(nil), args) 110 return 111 } 112 ret, err = i.SigList(ctx, typedArgs[0]) 113 return 114 }, 115 }, 116 "sigListJSON": { 117 MakeArg: func() interface{} { 118 var ret [1]SigListJSONArg 119 return &ret 120 }, 121 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 122 typedArgs, ok := args.(*[1]SigListJSONArg) 123 if !ok { 124 err = rpc.NewTypeError((*[1]SigListJSONArg)(nil), args) 125 return 126 } 127 ret, err = i.SigListJSON(ctx, typedArgs[0]) 128 return 129 }, 130 }, 131 }, 132 } 133 } 134 135 type SigsClient struct { 136 Cli rpc.GenericClient 137 } 138 139 func (c SigsClient) SigList(ctx context.Context, __arg SigListArg) (res []Sig, err error) { 140 err = c.Cli.Call(ctx, "keybase.1.sigs.sigList", []interface{}{__arg}, &res, 0*time.Millisecond) 141 return 142 } 143 144 func (c SigsClient) SigListJSON(ctx context.Context, __arg SigListJSONArg) (res string, err error) { 145 err = c.Cli.Call(ctx, "keybase.1.sigs.sigListJSON", []interface{}{__arg}, &res, 0*time.Millisecond) 146 return 147 }