5 // Package represents collection of objects parsed from VPP binary API JSON data
14 RefMap map[string]string
17 // MessageType represents the type of a VPP message
21 requestMessage MessageType = iota // VPP request message
22 replyMessage // VPP reply message
23 eventMessage // VPP event message
24 otherMessage // other VPP message
27 // Message represents VPP binary API message
34 // Type represents VPP binary API type
41 // Alias represents VPP binary API alias
48 // Union represents VPP binary API union
55 // Field represents VPP binary API object field
63 func (f *Field) IsArray() bool {
64 return f.Length > 0 || f.SizeFrom != ""
67 // Enum represents VPP binary API enum
74 // EnumEntry represents VPP binary API enum entry
75 type EnumEntry struct {
80 // Service represents VPP binary API service
89 func (s Service) MethodName() string {
90 reqTyp := camelCaseName(s.RequestType)
92 // method name is same as parameter type name by default
95 // use Dump as prefix instead of suffix for stream services
96 if m := strings.TrimSuffix(method, "Dump"); method != m {
104 func (s Service) IsDumpService() bool {
108 func (s Service) IsEventService() bool {
109 return len(s.Events) > 0
112 func (s Service) IsRequestService() bool {
113 // some binapi messages might have `null` reply (for example: memclnt)
114 return s.ReplyType != "" && s.ReplyType != "null" // not null