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