- // LookupByID looks up message name and crc by ID
- LookupByID(ID uint16) (string, error)
-}
-
-// Channel is the main communication interface with govpp core. It contains two Go channels, one for sending the requests
-// to VPP and one for receiving the replies from it. The user can access the Go channels directly, or use the helper
-// methods provided inside of this package. Do not use the same channel from multiple goroutines concurrently,
-// otherwise the responses could mix! Use multiple channels instead.
-type Channel struct {
- ReqChan chan *VppRequest // channel for sending the requests to VPP, closing this channel releases all resources in the ChannelProvider
- ReplyChan chan *VppReply // channel where VPP replies are delivered to
-
- NotifSubsChan chan *NotifSubscribeRequest // channel for sending notification subscribe requests
- NotifSubsReplyChan chan error // channel where replies to notification subscribe requests are delivered to
-
- MsgDecoder MessageDecoder // used to decode binary data to generated API messages
- MsgIdentifier MessageIdentifier // used to retrieve message ID of a message
-
- replyTimeout time.Duration // maximum time that the API waits for a reply from VPP before returning an error, can be set with SetReplyTimeout
- metadata interface{} // opaque metadata of the API channel
- lastTimedOut bool // wether last request timed out
-}
-
-// VppRequest is a request that will be sent to VPP.
-type VppRequest struct {
- Message Message // binary API message to be send to VPP
- Multipart bool // true if multipart response is expected, false otherwise
-}
-
-// VppReply is a reply received from VPP.
-type VppReply struct {
- MessageID uint16 // ID of the message
- Data []byte // encoded data with the message - MessageDecoder can be used for decoding
- LastReplyReceived bool // in case of multipart replies, true if the last reply has been already received and this one should be ignored
- Error error // in case of error, data is nil and this member contains error description
-}
-
-// NotifSubscribeRequest is a request to subscribe for delivery of specific notification messages.
-type NotifSubscribeRequest struct {
- Subscription *NotifSubscription // subscription details
- Subscribe bool // true if this is a request to subscribe, false if unsubscribe
-}
-
-// NotifSubscription represents a subscription for delivery of specific notification messages.
-type NotifSubscription struct {
- NotifChan chan Message // channel where notification messages will be delivered to
- MsgFactory func() Message // function that returns a new instance of the specific message that is expected as a notification
-}
-
-// RequestCtx is a context of a ongoing request (simple one - only one response is expected).
-type RequestCtx struct {
- ch *Channel
-}