github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/notify_invite_friends.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/notify_invite_friends.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 UpdateInviteCountsArg struct {
    13  	Counts InviteCounts `codec:"counts" json:"counts"`
    14  }
    15  
    16  type NotifyInviteFriendsInterface interface {
    17  	UpdateInviteCounts(context.Context, InviteCounts) error
    18  }
    19  
    20  func NotifyInviteFriendsProtocol(i NotifyInviteFriendsInterface) rpc.Protocol {
    21  	return rpc.Protocol{
    22  		Name: "keybase.1.NotifyInviteFriends",
    23  		Methods: map[string]rpc.ServeHandlerDescription{
    24  			"updateInviteCounts": {
    25  				MakeArg: func() interface{} {
    26  					var ret [1]UpdateInviteCountsArg
    27  					return &ret
    28  				},
    29  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    30  					typedArgs, ok := args.(*[1]UpdateInviteCountsArg)
    31  					if !ok {
    32  						err = rpc.NewTypeError((*[1]UpdateInviteCountsArg)(nil), args)
    33  						return
    34  					}
    35  					err = i.UpdateInviteCounts(ctx, typedArgs[0].Counts)
    36  					return
    37  				},
    38  			},
    39  		},
    40  	}
    41  }
    42  
    43  type NotifyInviteFriendsClient struct {
    44  	Cli rpc.GenericClient
    45  }
    46  
    47  func (c NotifyInviteFriendsClient) UpdateInviteCounts(ctx context.Context, counts InviteCounts) (err error) {
    48  	__arg := UpdateInviteCountsArg{Counts: counts}
    49  	err = c.Cli.Notify(ctx, "keybase.1.NotifyInviteFriends.updateInviteCounts", []interface{}{__arg}, 0*time.Millisecond)
    50  	return
    51  }