github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/keybase1/revoke.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/revoke.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 RevokeKeyArg struct {
    13  	SessionID int `codec:"sessionID" json:"sessionID"`
    14  	KeyID     KID `codec:"keyID" json:"keyID"`
    15  }
    16  
    17  type RevokeDeviceArg struct {
    18  	SessionID int      `codec:"sessionID" json:"sessionID"`
    19  	DeviceID  DeviceID `codec:"deviceID" json:"deviceID"`
    20  	ForceSelf bool     `codec:"forceSelf" json:"forceSelf"`
    21  	ForceLast bool     `codec:"forceLast" json:"forceLast"`
    22  }
    23  
    24  type RevokeSigsArg struct {
    25  	SessionID    int      `codec:"sessionID" json:"sessionID"`
    26  	SigIDQueries []string `codec:"sigIDQueries" json:"sigIDQueries"`
    27  }
    28  
    29  type RevokeInterface interface {
    30  	RevokeKey(context.Context, RevokeKeyArg) error
    31  	RevokeDevice(context.Context, RevokeDeviceArg) error
    32  	RevokeSigs(context.Context, RevokeSigsArg) error
    33  }
    34  
    35  func RevokeProtocol(i RevokeInterface) rpc.Protocol {
    36  	return rpc.Protocol{
    37  		Name: "keybase.1.revoke",
    38  		Methods: map[string]rpc.ServeHandlerDescription{
    39  			"revokeKey": {
    40  				MakeArg: func() interface{} {
    41  					var ret [1]RevokeKeyArg
    42  					return &ret
    43  				},
    44  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    45  					typedArgs, ok := args.(*[1]RevokeKeyArg)
    46  					if !ok {
    47  						err = rpc.NewTypeError((*[1]RevokeKeyArg)(nil), args)
    48  						return
    49  					}
    50  					err = i.RevokeKey(ctx, typedArgs[0])
    51  					return
    52  				},
    53  			},
    54  			"revokeDevice": {
    55  				MakeArg: func() interface{} {
    56  					var ret [1]RevokeDeviceArg
    57  					return &ret
    58  				},
    59  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    60  					typedArgs, ok := args.(*[1]RevokeDeviceArg)
    61  					if !ok {
    62  						err = rpc.NewTypeError((*[1]RevokeDeviceArg)(nil), args)
    63  						return
    64  					}
    65  					err = i.RevokeDevice(ctx, typedArgs[0])
    66  					return
    67  				},
    68  			},
    69  			"revokeSigs": {
    70  				MakeArg: func() interface{} {
    71  					var ret [1]RevokeSigsArg
    72  					return &ret
    73  				},
    74  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    75  					typedArgs, ok := args.(*[1]RevokeSigsArg)
    76  					if !ok {
    77  						err = rpc.NewTypeError((*[1]RevokeSigsArg)(nil), args)
    78  						return
    79  					}
    80  					err = i.RevokeSigs(ctx, typedArgs[0])
    81  					return
    82  				},
    83  			},
    84  		},
    85  	}
    86  }
    87  
    88  type RevokeClient struct {
    89  	Cli rpc.GenericClient
    90  }
    91  
    92  func (c RevokeClient) RevokeKey(ctx context.Context, __arg RevokeKeyArg) (err error) {
    93  	err = c.Cli.Call(ctx, "keybase.1.revoke.revokeKey", []interface{}{__arg}, nil, 0*time.Millisecond)
    94  	return
    95  }
    96  
    97  func (c RevokeClient) RevokeDevice(ctx context.Context, __arg RevokeDeviceArg) (err error) {
    98  	err = c.Cli.Call(ctx, "keybase.1.revoke.revokeDevice", []interface{}{__arg}, nil, 0*time.Millisecond)
    99  	return
   100  }
   101  
   102  func (c RevokeClient) RevokeSigs(ctx context.Context, __arg RevokeSigsArg) (err error) {
   103  	err = c.Cli.Call(ctx, "keybase.1.revoke.revokeSigs", []interface{}{__arg}, nil, 0*time.Millisecond)
   104  	return
   105  }