5 // 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 // Field represents VPP binary API object field
64 // FieldMeta represents VPP binary API meta info for field
65 type FieldMeta struct {
69 // Union represents VPP binary API union
76 // Message represents VPP binary API message
83 // MessageType represents the type of a VPP message
87 requestMessage MessageType = iota // VPP request message
88 replyMessage // VPP reply message
89 eventMessage // VPP event message
90 otherMessage // other VPP message
93 // printPackage prints all loaded objects for package
94 func printPackage(pkg *Package) {
95 logf("package: %s %s (%s)", pkg.Name, pkg.Version, pkg.CRC)
96 if len(pkg.Enums) > 0 {
97 logf(" %d enums:", len(pkg.Enums))
98 for _, enum := range pkg.Enums {
99 logf(" - %s: %+v", enum.Name, enum)
102 if len(pkg.Unions) > 0 {
103 logf(" %d unions:", len(pkg.Unions))
104 for _, union := range pkg.Unions {
105 logf(" - %s: %+v", union.Name, union)
108 if len(pkg.Types) > 0 {
109 logf(" %d types:", len(pkg.Types))
110 for _, typ := range pkg.Types {
111 logf(" - %s (%d fields): %+v", typ.Name, len(typ.Fields), typ)
114 if len(pkg.Messages) > 0 {
115 logf(" %d messages:", len(pkg.Messages))
116 for _, msg := range pkg.Messages {
117 logf(" - %s (%d fields) %s", msg.Name, len(msg.Fields), msg.CRC)
120 if len(pkg.Services) > 0 {
121 logf(" %d services:", len(pkg.Services))
122 for _, svc := range pkg.Services {
126 } else if len(svc.Events) > 0 {
127 info = fmt.Sprintf("(EVENTS: %v)", svc.Events)
129 logf(" - %s: %q -> %q %s", svc.Name, svc.RequestType, svc.ReplyType, info)