Fix encode/decode for []bool
[govpp.git] / binapigen / vppapi / api_schema.go
1 //  Copyright (c) 2020 Cisco and/or its affiliates.
2 //
3 //  Licensed under the Apache License, Version 2.0 (the "License");
4 //  you may not use this file except in compliance with the License.
5 //  You may obtain a copy of the License at:
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 //  Unless required by applicable law or agreed to in writing, software
10 //  distributed under the License is distributed on an "AS IS" BASIS,
11 //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 //  See the License for the specific language governing permissions and
13 //  limitations under the License.
14
15 // Package vppapi parses VPP API files without any additional processing.
16 package vppapi
17
18 type (
19         File struct {
20                 Name string
21                 Path string
22                 CRC  string
23
24                 Options map[string]string `json:",omitempty"`
25                 Imports []string          `json:",omitempty"`
26
27                 AliasTypes    []AliasType  `json:",omitempty"`
28                 EnumTypes     []EnumType   `json:",omitempty"`
29                 EnumflagTypes []EnumType   `json:",omitempty"`
30                 StructTypes   []StructType `json:",omitempty"`
31                 UnionTypes    []UnionType  `json:",omitempty"`
32
33                 Messages []Message `json:",omitempty"`
34                 Service  *Service  `json:",omitempty"`
35         }
36
37         AliasType struct {
38                 Name   string
39                 Type   string
40                 Length int `json:",omitempty"`
41         }
42
43         EnumType struct {
44                 Name    string
45                 Type    string
46                 Entries []EnumEntry
47         }
48
49         EnumEntry struct {
50                 Name  string
51                 Value uint32
52         }
53
54         StructType struct {
55                 Name   string
56                 Fields []Field
57         }
58
59         UnionType struct {
60                 Name   string
61                 Fields []Field
62         }
63
64         Message struct {
65                 Name    string
66                 Fields  []Field
67                 CRC     string
68                 Options map[string]string
69         }
70
71         Field struct {
72                 Name     string
73                 Type     string
74                 Length   int                    `json:",omitempty"`
75                 Array    bool                   `json:",omitempty"`
76                 SizeFrom string                 `json:",omitempty"`
77                 Meta     map[string]interface{} `json:",omitempty"`
78         }
79
80         Service struct {
81                 RPCs []RPC `json:",omitempty"`
82         }
83
84         RPC struct {
85                 Request   string
86                 Reply     string
87                 Stream    bool     `json:",omitempty"`
88                 StreamMsg string   `json:",omitempty"`
89                 Events    []string `json:",omitempty"`
90         }
91 )