7 // Package represents collection of objects parsed from VPP binary API JSON data
16 RefMap map[string]string
19 // Service represents VPP binary API service
28 // Enum represents VPP binary API enum
35 // EnumEntry represents VPP binary API enum entry
36 type EnumEntry struct {
41 // Alias represents VPP binary API alias
48 // Type represents VPP binary API type
55 // Union represents VPP binary API union
62 // Message represents VPP binary API message
69 // MessageType represents the type of a VPP message
73 requestMessage MessageType = iota // VPP request message
74 replyMessage // VPP reply message
75 eventMessage // VPP event message
76 otherMessage // other VPP message
79 // Field represents VPP binary API object field
87 func (f *Field) IsArray() bool {
88 return f.Length > 0 || f.SizeFrom != ""
91 func (s Service) MethodName() string {
92 reqTyp := camelCaseName(s.RequestType)
94 // method name is same as parameter type name by default
97 // use Dump as prefix instead of suffix for stream services
98 if m := strings.TrimSuffix(method, "Dump"); method != m {
106 func (s Service) IsDumpService() bool {
110 func (s Service) IsEventService() bool {
111 return len(s.Events) > 0
114 func (s Service) IsRequestService() bool {
115 // some binapi messages might have `null` reply (for example: memclnt)
116 return s.ReplyType != "" && s.ReplyType != "null" // not null