Skip to content

Commit 12edb32

Browse files
authored
introduce api/mixer/adapter/model/v1beta (#359)
Move template and valuetype to mixer/adapter/model/v1beta
1 parent ebec456 commit 12edb32

8 files changed

+1677
-2
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,17 @@ mixer_template_protos := $(shell find $(mixer_template_path) -maxdepth 1 -type f
209209
mixer_template_pb_gos := $(mixer_template_protos:.proto=.pb.go)
210210
mixer_template_pb_doc := $(mixer_template_path)/istio.mixer.v1.template.pb.html
211211

212+
mixer_adapter_model_v1beta_path := mixer/adapter/model/v1beta
213+
mixer_adapter_model_v1beta_protos := $(shell find $(mixer_adapter_model_v1beta_path) -maxdepth 1 -type f -name '*.proto' | sort)
214+
mixer_adapter_model_v1beta_pb_gos := $(mixer_adapter_model_v1beta_protos:.proto=.pb.go)
215+
mixer_adapter_model_v1beta_pb_doc := $(mixer_adapter_model_v1beta_path)/istio.mixer.adapter.model.v1beta.pb.html
216+
212217
generate-mixer-go: \
213218
$(mixer_v1_pb_gos) $(mixer_v1_pb_doc) \
214219
$(mixer_config_client_pb_gos) $(mixer_config_client_pb_doc) \
215220
$(mixer_config_descriptor_pb_gos) $(mixer_config_descriptor_pb_doc) \
216221
$(mixer_template_pb_gos) $(mixer_template_pb_doc) \
222+
$(mixer_adapter_model_v1beta_pb_gos) $(mixer_adapter_model_v1beta_pb_doc) \
217223
mixer/v1/config/fixed_cfg.pb.go mixer/v1/config/istio.mixer.v1.config.pb.html
218224

219225
$(mixer_v1_pb_gos) $(mixer_v1_pb_doc): $(mixer_v1_protos) | depend $(protoc_gen_gogoslick) $(protoc_bin)
@@ -232,6 +238,10 @@ $(mixer_template_pb_gos) $(mixer_template_pb_doc) : $(mixer_template_protos) | d
232238
## Generate mixer/v1/template/*.pb.go + $(mixer_template_pb_doc)
233239
@$(protoc) $(proto_path) $(gogoslick_plugin) $(protoc_gen_docs_plugin)$(mixer_template_path) $^
234240

241+
$(mixer_adapter_model_v1beta_pb_gos) $(mixer_adapter_model_v1beta_pb_doc) : $(mixer_adapter_model_v1beta_protos) | depend $(protoc_gen_gogoslick) $(protoc_bin)
242+
## Generate mixer/adapter/model/v1beta/*.pb.go + $(mixer_adapter_model_v1beta_pb_doc)
243+
@$(protoc) $(proto_path) $(gogoslick_plugin) $(protoc_gen_docs_plugin)$(mixer_adapter_model_v1beta_path) $^
244+
235245
mixer/v1/config/fixed_cfg.pb.go mixer/v1/config/istio.mixer.v1.config.pb.html: mixer/v1/config/cfg.proto | depend $(protoc_gen_gogo) $(protoc_bin)
236246
# Generate mixer/v1/config/fixed_cfg.pb.go (requires alternate plugin and sed scripting due to issues with google.protobuf.Struct)
237247
@$(protoc) $(proto_path) $(gogo_plugin) $(protoc_gen_docs_plugin)mixer/v1/config $^
@@ -241,8 +251,8 @@ mixer/v1/config/fixed_cfg.pb.go mixer/v1/config/istio.mixer.v1.config.pb.html: m
241251
@rm mixer/v1/config/cfg.pb.go
242252

243253
clean-mixer-generated:
244-
rm -f $(mixer_v1_pb_gos) $(mixer_config_client_pb_gos) $(mixer_config_descriptor_pb_gos) $(mixer_template_pb_gos) mixer/v1/config/fixed_cfg.pb.go
245-
rm -f $(mixer_v1_pb_doc) $(mixer_config_client_pb_doc) $(mixer_config_descriptor_pb_doc) $(mixer_template_pb_doc) mixer/v1/config/istio.mixer.v1.config.pb.html
254+
rm -f $(mixer_v1_pb_gos) $(mixer_config_client_pb_gos) $(mixer_config_descriptor_pb_gos) $(mixer_template_pb_gos) $(mixer_adapter_model_v1beta_pb_gos) mixer/v1/config/fixed_cfg.pb.go
255+
rm -f $(mixer_v1_pb_doc) $(mixer_config_client_pb_doc) $(mixer_config_descriptor_pb_doc) $(mixer_template_pb_doc) $(mixer_adapter_model_v1beta_pb_doc) mixer/v1/config/istio.mixer.v1.config.pb.html
246256

247257
#####################
248258
# routing/...

mixer/adapter/model/v1beta/extensions.pb.go

Lines changed: 121 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2017 Istio Authors
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+
syntax = "proto3";
16+
17+
// $title: Mixer Adapter Model
18+
// $overview: Definitions used when creating Mixer templates
19+
// $location: https://istio.io/docs/reference/config/mixer/istio.mixer.adapter.model.v1beta.html
20+
21+
// This package defines the types that are used when creating Mixer templates. `ValueType` defined in this pacakge
22+
// is also used by adapters to know the underlying datatype of the instance fields.
23+
package istio.mixer.adapter.model.v1beta;
24+
25+
option go_package="istio.io/api/mixer/adapter/model/v1beta";
26+
27+
import "google/protobuf/descriptor.proto";
28+
29+
30+
// The available varieties of templates, controlling the semantics of what an adapter does with each instance.
31+
enum TemplateVariety {
32+
// Makes the template applicable for Mixer's check calls.
33+
TEMPLATE_VARIETY_CHECK = 0;
34+
// Makes the template applicable for Mixer's report calls.
35+
TEMPLATE_VARIETY_REPORT = 1;
36+
// Makes the template applicable for Mixer's quota calls.
37+
TEMPLATE_VARIETY_QUOTA = 2;
38+
// Makes the template applicable for Mixer's quota calls.
39+
TEMPLATE_VARIETY_ATTRIBUTE_GENERATOR = 3;
40+
}
41+
42+
// File option for the TemplateVariety.
43+
extend google.protobuf.FileOptions {
44+
TemplateVariety template_variety = 72295727;
45+
}

0 commit comments

Comments
 (0)