github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/session/session_rpc.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  
     3  package session
     4  
     5  import (
     6  	"context"
     7  	"fmt"
     8  	"io"
     9  
    10  	memclnt "github.com/networkservicemesh/govpp/binapi/memclnt"
    11  	api "go.fd.io/govpp/api"
    12  )
    13  
    14  // RPCService defines RPC service session.
    15  type RPCService interface {
    16  	AppAddCertKeyPair(ctx context.Context, in *AppAddCertKeyPair) (*AppAddCertKeyPairReply, error)
    17  	AppAttach(ctx context.Context, in *AppAttach) (*AppAttachReply, error)
    18  	AppDelCertKeyPair(ctx context.Context, in *AppDelCertKeyPair) (*AppDelCertKeyPairReply, error)
    19  	AppNamespaceAddDel(ctx context.Context, in *AppNamespaceAddDel) (*AppNamespaceAddDelReply, error)
    20  	AppNamespaceAddDelV2(ctx context.Context, in *AppNamespaceAddDelV2) (*AppNamespaceAddDelV2Reply, error)
    21  	AppNamespaceAddDelV3(ctx context.Context, in *AppNamespaceAddDelV3) (*AppNamespaceAddDelV3Reply, error)
    22  	AppNamespaceAddDelV4(ctx context.Context, in *AppNamespaceAddDelV4) (*AppNamespaceAddDelV4Reply, error)
    23  	AppWorkerAddDel(ctx context.Context, in *AppWorkerAddDel) (*AppWorkerAddDelReply, error)
    24  	ApplicationDetach(ctx context.Context, in *ApplicationDetach) (*ApplicationDetachReply, error)
    25  	SessionEnableDisable(ctx context.Context, in *SessionEnableDisable) (*SessionEnableDisableReply, error)
    26  	SessionRuleAddDel(ctx context.Context, in *SessionRuleAddDel) (*SessionRuleAddDelReply, error)
    27  	SessionRulesDump(ctx context.Context, in *SessionRulesDump) (RPCService_SessionRulesDumpClient, error)
    28  	SessionSapiEnableDisable(ctx context.Context, in *SessionSapiEnableDisable) (*SessionSapiEnableDisableReply, error)
    29  }
    30  
    31  type serviceClient struct {
    32  	conn api.Connection
    33  }
    34  
    35  func NewServiceClient(conn api.Connection) RPCService {
    36  	return &serviceClient{conn}
    37  }
    38  
    39  func (c *serviceClient) AppAddCertKeyPair(ctx context.Context, in *AppAddCertKeyPair) (*AppAddCertKeyPairReply, error) {
    40  	out := new(AppAddCertKeyPairReply)
    41  	err := c.conn.Invoke(ctx, in, out)
    42  	if err != nil {
    43  		return nil, err
    44  	}
    45  	return out, api.RetvalToVPPApiError(out.Retval)
    46  }
    47  
    48  func (c *serviceClient) AppAttach(ctx context.Context, in *AppAttach) (*AppAttachReply, error) {
    49  	out := new(AppAttachReply)
    50  	err := c.conn.Invoke(ctx, in, out)
    51  	if err != nil {
    52  		return nil, err
    53  	}
    54  	return out, api.RetvalToVPPApiError(out.Retval)
    55  }
    56  
    57  func (c *serviceClient) AppDelCertKeyPair(ctx context.Context, in *AppDelCertKeyPair) (*AppDelCertKeyPairReply, error) {
    58  	out := new(AppDelCertKeyPairReply)
    59  	err := c.conn.Invoke(ctx, in, out)
    60  	if err != nil {
    61  		return nil, err
    62  	}
    63  	return out, api.RetvalToVPPApiError(out.Retval)
    64  }
    65  
    66  func (c *serviceClient) AppNamespaceAddDel(ctx context.Context, in *AppNamespaceAddDel) (*AppNamespaceAddDelReply, error) {
    67  	out := new(AppNamespaceAddDelReply)
    68  	err := c.conn.Invoke(ctx, in, out)
    69  	if err != nil {
    70  		return nil, err
    71  	}
    72  	return out, api.RetvalToVPPApiError(out.Retval)
    73  }
    74  
    75  func (c *serviceClient) AppNamespaceAddDelV2(ctx context.Context, in *AppNamespaceAddDelV2) (*AppNamespaceAddDelV2Reply, error) {
    76  	out := new(AppNamespaceAddDelV2Reply)
    77  	err := c.conn.Invoke(ctx, in, out)
    78  	if err != nil {
    79  		return nil, err
    80  	}
    81  	return out, api.RetvalToVPPApiError(out.Retval)
    82  }
    83  
    84  func (c *serviceClient) AppNamespaceAddDelV3(ctx context.Context, in *AppNamespaceAddDelV3) (*AppNamespaceAddDelV3Reply, error) {
    85  	out := new(AppNamespaceAddDelV3Reply)
    86  	err := c.conn.Invoke(ctx, in, out)
    87  	if err != nil {
    88  		return nil, err
    89  	}
    90  	return out, api.RetvalToVPPApiError(out.Retval)
    91  }
    92  
    93  func (c *serviceClient) AppNamespaceAddDelV4(ctx context.Context, in *AppNamespaceAddDelV4) (*AppNamespaceAddDelV4Reply, error) {
    94  	out := new(AppNamespaceAddDelV4Reply)
    95  	err := c.conn.Invoke(ctx, in, out)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return out, api.RetvalToVPPApiError(out.Retval)
   100  }
   101  
   102  func (c *serviceClient) AppWorkerAddDel(ctx context.Context, in *AppWorkerAddDel) (*AppWorkerAddDelReply, error) {
   103  	out := new(AppWorkerAddDelReply)
   104  	err := c.conn.Invoke(ctx, in, out)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return out, api.RetvalToVPPApiError(out.Retval)
   109  }
   110  
   111  func (c *serviceClient) ApplicationDetach(ctx context.Context, in *ApplicationDetach) (*ApplicationDetachReply, error) {
   112  	out := new(ApplicationDetachReply)
   113  	err := c.conn.Invoke(ctx, in, out)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	return out, api.RetvalToVPPApiError(out.Retval)
   118  }
   119  
   120  func (c *serviceClient) SessionEnableDisable(ctx context.Context, in *SessionEnableDisable) (*SessionEnableDisableReply, error) {
   121  	out := new(SessionEnableDisableReply)
   122  	err := c.conn.Invoke(ctx, in, out)
   123  	if err != nil {
   124  		return nil, err
   125  	}
   126  	return out, api.RetvalToVPPApiError(out.Retval)
   127  }
   128  
   129  func (c *serviceClient) SessionRuleAddDel(ctx context.Context, in *SessionRuleAddDel) (*SessionRuleAddDelReply, error) {
   130  	out := new(SessionRuleAddDelReply)
   131  	err := c.conn.Invoke(ctx, in, out)
   132  	if err != nil {
   133  		return nil, err
   134  	}
   135  	return out, api.RetvalToVPPApiError(out.Retval)
   136  }
   137  
   138  func (c *serviceClient) SessionRulesDump(ctx context.Context, in *SessionRulesDump) (RPCService_SessionRulesDumpClient, error) {
   139  	stream, err := c.conn.NewStream(ctx)
   140  	if err != nil {
   141  		return nil, err
   142  	}
   143  	x := &serviceClient_SessionRulesDumpClient{stream}
   144  	if err := x.Stream.SendMsg(in); err != nil {
   145  		return nil, err
   146  	}
   147  	if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil {
   148  		return nil, err
   149  	}
   150  	return x, nil
   151  }
   152  
   153  type RPCService_SessionRulesDumpClient interface {
   154  	Recv() (*SessionRulesDetails, error)
   155  	api.Stream
   156  }
   157  
   158  type serviceClient_SessionRulesDumpClient struct {
   159  	api.Stream
   160  }
   161  
   162  func (c *serviceClient_SessionRulesDumpClient) Recv() (*SessionRulesDetails, error) {
   163  	msg, err := c.Stream.RecvMsg()
   164  	if err != nil {
   165  		return nil, err
   166  	}
   167  	switch m := msg.(type) {
   168  	case *SessionRulesDetails:
   169  		return m, nil
   170  	case *memclnt.ControlPingReply:
   171  		err = c.Stream.Close()
   172  		if err != nil {
   173  			return nil, err
   174  		}
   175  		return nil, io.EOF
   176  	default:
   177  		return nil, fmt.Errorf("unexpected message: %T %v", m, m)
   178  	}
   179  }
   180  
   181  func (c *serviceClient) SessionSapiEnableDisable(ctx context.Context, in *SessionSapiEnableDisable) (*SessionSapiEnableDisableReply, error) {
   182  	out := new(SessionSapiEnableDisableReply)
   183  	err := c.conn.Invoke(ctx, in, out)
   184  	if err != nil {
   185  		return nil, err
   186  	}
   187  	return out, api.RetvalToVPPApiError(out.Retval)
   188  }