aboutsummaryrefslogtreecommitdiffstats
path: root/examples/binapi/memif/memif.ba.go
diff options
context:
space:
mode:
Diffstat (limited to 'examples/binapi/memif/memif.ba.go')
-rw-r--r--examples/binapi/memif/memif.ba.go166
1 files changed, 93 insertions, 73 deletions
diff --git a/examples/binapi/memif/memif.ba.go b/examples/binapi/memif/memif.ba.go
index 4123ad8..8d23986 100644
--- a/examples/binapi/memif/memif.ba.go
+++ b/examples/binapi/memif/memif.ba.go
@@ -1,33 +1,23 @@
-// Code generated by GoVPP binapi-generator. DO NOT EDIT.
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// source: /usr/share/vpp/api/plugins/memif.api.json
/*
-Package memif is a generated from VPP binary API module 'memif'.
+Package memif is a generated VPP binary API for 'memif' module.
- The memif module consists of:
+It consists of:
10 messages
5 services
*/
package memif
-import api "git.fd.io/govpp.git/api"
-import bytes "bytes"
-import context "context"
-import strconv "strconv"
-import struc "github.com/lunixbochs/struc"
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = strconv.Itoa
-var _ = struc.Pack
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the GoVPP api package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// GoVPP api package needs to be updated.
-const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
+import (
+ bytes "bytes"
+ context "context"
+ api "git.fd.io/govpp.git/api"
+ struc "github.com/lunixbochs/struc"
+ io "io"
+ strconv "strconv"
+)
const (
// ModuleName is the name of this module.
@@ -38,9 +28,7 @@ const (
VersionCrc = 0x31b42e17
)
-/* Messages */
-
-// MemifCreate represents VPP binary API message 'memif_create':
+// MemifCreate represents VPP binary API message 'memif_create'.
type MemifCreate struct {
Role uint8
Mode uint8
@@ -64,7 +52,7 @@ func (*MemifCreate) GetMessageType() api.MessageType {
return api.RequestMessage
}
-// MemifCreateReply represents VPP binary API message 'memif_create_reply':
+// MemifCreateReply represents VPP binary API message 'memif_create_reply'.
type MemifCreateReply struct {
Retval int32
SwIfIndex uint32
@@ -80,7 +68,7 @@ func (*MemifCreateReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-// MemifDelete represents VPP binary API message 'memif_delete':
+// MemifDelete represents VPP binary API message 'memif_delete'.
type MemifDelete struct {
SwIfIndex uint32
}
@@ -95,7 +83,7 @@ func (*MemifDelete) GetMessageType() api.MessageType {
return api.RequestMessage
}
-// MemifDeleteReply represents VPP binary API message 'memif_delete_reply':
+// MemifDeleteReply represents VPP binary API message 'memif_delete_reply'.
type MemifDeleteReply struct {
Retval int32
}
@@ -110,7 +98,7 @@ func (*MemifDeleteReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-// MemifDetails represents VPP binary API message 'memif_details':
+// MemifDetails represents VPP binary API message 'memif_details'.
type MemifDetails struct {
SwIfIndex uint32
IfName []byte `struc:"[64]byte"`
@@ -135,7 +123,7 @@ func (*MemifDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-// MemifDump represents VPP binary API message 'memif_dump':
+// MemifDump represents VPP binary API message 'memif_dump'.
type MemifDump struct{}
func (*MemifDump) GetMessageName() string {
@@ -148,7 +136,7 @@ func (*MemifDump) GetMessageType() api.MessageType {
return api.RequestMessage
}
-// MemifSocketFilenameAddDel represents VPP binary API message 'memif_socket_filename_add_del':
+// MemifSocketFilenameAddDel represents VPP binary API message 'memif_socket_filename_add_del'.
type MemifSocketFilenameAddDel struct {
IsAdd uint8
SocketID uint32
@@ -165,7 +153,7 @@ func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType {
return api.RequestMessage
}
-// MemifSocketFilenameAddDelReply represents VPP binary API message 'memif_socket_filename_add_del_reply':
+// MemifSocketFilenameAddDelReply represents VPP binary API message 'memif_socket_filename_add_del_reply'.
type MemifSocketFilenameAddDelReply struct {
Retval int32
}
@@ -180,7 +168,7 @@ func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-// MemifSocketFilenameDetails represents VPP binary API message 'memif_socket_filename_details':
+// MemifSocketFilenameDetails represents VPP binary API message 'memif_socket_filename_details'.
type MemifSocketFilenameDetails struct {
SocketID uint32
SocketFilename []byte `struc:"[128]byte"`
@@ -196,7 +184,7 @@ func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-// MemifSocketFilenameDump represents VPP binary API message 'memif_socket_filename_dump':
+// MemifSocketFilenameDump represents VPP binary API message 'memif_socket_filename_dump'.
type MemifSocketFilenameDump struct{}
func (*MemifSocketFilenameDump) GetMessageName() string {
@@ -238,58 +226,76 @@ func AllMessages() []api.Message {
}
}
-// Service represents VPP binary API services in memif module.
-type Service interface {
- DumpMemif(ctx context.Context, in *MemifDump) ([]*MemifDetails, error)
- DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) ([]*MemifSocketFilenameDetails, error)
+// RPCService represents RPC service API for memif module.
+type RPCService interface {
+ DumpMemif(ctx context.Context, in *MemifDump) (RPCService_DumpMemifClient, error)
+ DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_DumpMemifSocketFilenameClient, error)
MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error)
MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error)
MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error)
}
-type service struct {
+type serviceClient struct {
ch api.Channel
}
-func NewService(ch api.Channel) Service {
- return &service{ch}
+func NewServiceClient(ch api.Channel) RPCService {
+ return &serviceClient{ch}
+}
+
+func (c *serviceClient) DumpMemif(ctx context.Context, in *MemifDump) (RPCService_DumpMemifClient, error) {
+ stream := c.ch.SendMultiRequest(in)
+ x := &serviceClient_DumpMemifClient{stream}
+ return x, nil
+}
+
+type RPCService_DumpMemifClient interface {
+ Recv() (*MemifDetails, error)
+}
+
+type serviceClient_DumpMemifClient struct {
+ api.MultiRequestCtx
+}
+
+func (c *serviceClient_DumpMemifClient) Recv() (*MemifDetails, error) {
+ m := new(MemifDetails)
+ stop, err := c.MultiRequestCtx.ReceiveReply(m)
+ if err != nil {
+ return nil, err
+ }
+ if stop {
+ return nil, io.EOF
+ }
+ return m, nil
+}
+
+func (c *serviceClient) DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_DumpMemifSocketFilenameClient, error) {
+ stream := c.ch.SendMultiRequest(in)
+ x := &serviceClient_DumpMemifSocketFilenameClient{stream}
+ return x, nil
+}
+
+type RPCService_DumpMemifSocketFilenameClient interface {
+ Recv() (*MemifSocketFilenameDetails, error)
+}
+
+type serviceClient_DumpMemifSocketFilenameClient struct {
+ api.MultiRequestCtx
}
-func (c *service) DumpMemif(ctx context.Context, in *MemifDump) ([]*MemifDetails, error) {
- var dump []*MemifDetails
- req := c.ch.SendMultiRequest(in)
- for {
- m := new(MemifDetails)
- stop, err := req.ReceiveReply(m)
- if stop {
- break
- }
- if err != nil {
- return nil, err
- }
- dump = append(dump, m)
+func (c *serviceClient_DumpMemifSocketFilenameClient) Recv() (*MemifSocketFilenameDetails, error) {
+ m := new(MemifSocketFilenameDetails)
+ stop, err := c.MultiRequestCtx.ReceiveReply(m)
+ if err != nil {
+ return nil, err
}
- return dump, nil
-}
-
-func (c *service) DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) ([]*MemifSocketFilenameDetails, error) {
- var dump []*MemifSocketFilenameDetails
- req := c.ch.SendMultiRequest(in)
- for {
- m := new(MemifSocketFilenameDetails)
- stop, err := req.ReceiveReply(m)
- if stop {
- break
- }
- if err != nil {
- return nil, err
- }
- dump = append(dump, m)
+ if stop {
+ return nil, io.EOF
}
- return dump, nil
+ return m, nil
}
-func (c *service) MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error) {
+func (c *serviceClient) MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error) {
out := new(MemifCreateReply)
err := c.ch.SendRequest(in).ReceiveReply(out)
if err != nil {
@@ -298,7 +304,7 @@ func (c *service) MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreat
return out, nil
}
-func (c *service) MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error) {
+func (c *serviceClient) MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error) {
out := new(MemifDeleteReply)
err := c.ch.SendRequest(in).ReceiveReply(out)
if err != nil {
@@ -307,7 +313,7 @@ func (c *service) MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDelet
return out, nil
}
-func (c *service) MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error) {
+func (c *serviceClient) MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error) {
out := new(MemifSocketFilenameAddDelReply)
err := c.ch.SendRequest(in).ReceiveReply(out)
if err != nil {
@@ -315,3 +321,17 @@ func (c *service) MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocket
}
return out, nil
}
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the GoVPP api package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// GoVPP api package needs to be updated.
+const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = api.RegisterMessage
+var _ = bytes.NewBuffer
+var _ = context.Background
+var _ = io.Copy
+var _ = strconv.Itoa
+var _ = struc.Pack