github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/chat1/blocking.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/chat1/blocking.avdl
     3  
     4  package chat1
     5  
     6  import (
     7  	gregor1 "github.com/keybase/client/go/protocol/gregor1"
     8  	"github.com/keybase/go-framed-msgpack-rpc/rpc"
     9  	context "golang.org/x/net/context"
    10  	"time"
    11  )
    12  
    13  type BlockConversationsArg struct {
    14  	Uid             gregor1.UID `codec:"uid" json:"uid"`
    15  	TlfIDsBlocked   []TLFID     `codec:"tlfIDsBlocked" json:"tlfIDsBlocked"`
    16  	TlfIDsUnblocked []TLFID     `codec:"tlfIDsUnblocked" json:"tlfIDsUnblocked"`
    17  }
    18  
    19  type BlockingInterface interface {
    20  	BlockConversations(context.Context, BlockConversationsArg) error
    21  }
    22  
    23  func BlockingProtocol(i BlockingInterface) rpc.Protocol {
    24  	return rpc.Protocol{
    25  		Name: "chat.1.blocking",
    26  		Methods: map[string]rpc.ServeHandlerDescription{
    27  			"blockConversations": {
    28  				MakeArg: func() interface{} {
    29  					var ret [1]BlockConversationsArg
    30  					return &ret
    31  				},
    32  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
    33  					typedArgs, ok := args.(*[1]BlockConversationsArg)
    34  					if !ok {
    35  						err = rpc.NewTypeError((*[1]BlockConversationsArg)(nil), args)
    36  						return
    37  					}
    38  					err = i.BlockConversations(ctx, typedArgs[0])
    39  					return
    40  				},
    41  			},
    42  		},
    43  	}
    44  }
    45  
    46  type BlockingClient struct {
    47  	Cli rpc.GenericClient
    48  }
    49  
    50  func (c BlockingClient) BlockConversations(ctx context.Context, __arg BlockConversationsArg) (err error) {
    51  	err = c.Cli.Call(ctx, "chat.1.blocking.blockConversations", []interface{}{__arg}, nil, 0*time.Millisecond)
    52  	return
    53  }