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
65 // FieldMeta represents VPP binary API meta info for field
66 type FieldMeta struct {
71 // Union represents VPP binary API union
78 // Message represents VPP binary API message
85 // MessageType represents the type of a VPP message
89 requestMessage MessageType = iota // VPP request message
90 replyMessage // VPP reply message
91 eventMessage // VPP event message
92 otherMessage // other VPP message
95 // printPackage prints all loaded objects for package
96 func printPackage(pkg *Package) {
97 logf("package: %s %s (%s)", pkg.Name, pkg.Version, pkg.CRC)
98 if len(pkg.Enums) > 0 {
99 logf(" %d enums:", len(pkg.Enums))
100 for _, enum := range pkg.Enums {
101 logf(" - %s: %+v", enum.Name, enum)
104 if len(pkg.Unions) > 0 {
105 logf(" %d unions:", len(pkg.Unions))
106 for _, union := range pkg.Unions {
107 logf(" - %s: %+v", union.Name, union)
110 if len(pkg.Types) > 0 {
111 logf(" %d types:", len(pkg.Types))
112 for _, typ := range pkg.Types {
113 logf(" - %s (%d fields): %+v", typ.Name, len(typ.Fields), typ)
116 if len(pkg.Messages) > 0 {
117 logf(" %d messages:", len(pkg.Messages))
118 for _, msg := range pkg.Messages {
119 logf(" - %s (%d fields) %s", msg.Name, len(msg.Fields), msg.CRC)
122 if len(pkg.Services) > 0 {
123 logf(" %d services:", len(pkg.Services))
124 for _, svc := range pkg.Services {
128 } else if len(svc.Events) > 0 {
129 info = fmt.Sprintf("(EVENTS: %v)", svc.Events)
131 logf(" - %s: %q -> %q %s", svc.Name, svc.RequestType, svc.ReplyType, info)