5 // Package represents collection of objects parsed from VPP binary API JSON data
16 RefMap map[string]string
17 Imports map[string]Import
24 // Service represents VPP binary API service
33 // Enum represents VPP binary API enum
40 // EnumEntry represents VPP binary API enum entry
41 type EnumEntry struct {
46 // Alias represents VPP binary API alias
53 // Type represents VPP binary API type
60 // Field represents VPP binary API object field
70 // FieldMeta represents VPP binary API meta info for field
71 type FieldMeta struct {
76 // Union represents VPP binary API union
83 // Message represents VPP binary API message
90 // MessageType represents the type of a VPP message
94 requestMessage MessageType = iota // VPP request message
95 replyMessage // VPP reply message
96 eventMessage // VPP event message
97 otherMessage // other VPP message
100 // printPackage prints all loaded objects for package
101 func printPackage(pkg *Package) {
102 logf("package: %s %s (%s)", pkg.Name, pkg.Version, pkg.CRC)
103 if len(pkg.Enums) > 0 {
104 logf(" %d enums:", len(pkg.Enums))
105 for _, enum := range pkg.Enums {
106 logf(" - %s: %+v", enum.Name, enum)
109 if len(pkg.Unions) > 0 {
110 logf(" %d unions:", len(pkg.Unions))
111 for _, union := range pkg.Unions {
112 logf(" - %s: %+v", union.Name, union)
115 if len(pkg.Types) > 0 {
116 logf(" %d types:", len(pkg.Types))
117 for _, typ := range pkg.Types {
118 logf(" - %s (%d fields): %+v", typ.Name, len(typ.Fields), typ)
121 if len(pkg.Messages) > 0 {
122 logf(" %d messages:", len(pkg.Messages))
123 for _, msg := range pkg.Messages {
124 logf(" - %s (%d fields) %s", msg.Name, len(msg.Fields), msg.CRC)
127 if len(pkg.Services) > 0 {
128 logf(" %d services:", len(pkg.Services))
129 for _, svc := range pkg.Services {
133 } else if len(svc.Events) > 0 {
134 info = fmt.Sprintf("(EVENTS: %v)", svc.Events)
136 logf(" - %s: %q -> %q %s", svc.Name, svc.RequestType, svc.ReplyType, info)