1 // Copyright (c) 2020 Cisco and/or its affiliates.
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:
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
22 Options map[string]string `json:",omitempty"`
24 Imports []string `json:",omitempty"`
26 AliasTypes []AliasType `json:",omitempty"`
27 EnumTypes []EnumType `json:",omitempty"`
28 StructTypes []StructType `json:",omitempty"`
29 UnionTypes []UnionType `json:",omitempty"`
30 Messages []Message `json:",omitempty"`
31 Service *Service `json:",omitempty"`
34 func (x File) Version() string {
36 return x.Options[fileOptionVersion]
41 type AliasType struct {
44 Length int `json:",omitempty"`
47 type EnumType struct {
53 type EnumEntry struct {
58 type StructType struct {
63 type UnionType struct {
77 Length int `json:",omitempty"`
78 Array bool `json:",omitempty"`
79 SizeFrom string `json:",omitempty"`
80 Meta map[string]interface{} `json:",omitempty"`
84 RPCs []RPC `json:",omitempty"`
91 Stream bool `json:",omitempty"`
92 StreamMsg string `json:",omitempty"`
93 Events []string `json:",omitempty"`