Skip to content

introduce api/mixer/adapter/model/v1beta #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,17 @@ mixer_template_protos := $(shell find $(mixer_template_path) -maxdepth 1 -type f
mixer_template_pb_gos := $(mixer_template_protos:.proto=.pb.go)
mixer_template_pb_doc := $(mixer_template_path)/istio.mixer.v1.template.pb.html

mixer_adapter_model_v1beta_path := mixer/adapter/model/v1beta
mixer_adapter_model_v1beta_protos := $(shell find $(mixer_adapter_model_v1beta_path) -maxdepth 1 -type f -name '*.proto' | sort)
mixer_adapter_model_v1beta_pb_gos := $(mixer_adapter_model_v1beta_protos:.proto=.pb.go)
mixer_adapter_model_v1beta_pb_doc := $(mixer_adapter_model_v1beta_path)/istio.mixer.adapter.model.v1beta.pb.html

generate-mixer-go: \
$(mixer_v1_pb_gos) $(mixer_v1_pb_doc) \
$(mixer_config_client_pb_gos) $(mixer_config_client_pb_doc) \
$(mixer_config_descriptor_pb_gos) $(mixer_config_descriptor_pb_doc) \
$(mixer_template_pb_gos) $(mixer_template_pb_doc) \
$(mixer_adapter_model_v1beta_pb_gos) $(mixer_adapter_model_v1beta_pb_doc) \
mixer/v1/config/fixed_cfg.pb.go mixer/v1/config/istio.mixer.v1.config.pb.html

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

$(mixer_adapter_model_v1beta_pb_gos) $(mixer_adapter_model_v1beta_pb_doc) : $(mixer_adapter_model_v1beta_protos) | depend $(protoc_gen_gogoslick) $(protoc_bin)
## Generate mixer/adapter/model/v1beta/*.pb.go + $(mixer_adapter_model_v1beta_pb_doc)
@$(protoc) $(proto_path) $(gogoslick_plugin) $(protoc_gen_docs_plugin)$(mixer_adapter_model_v1beta_path) $^

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)
# Generate mixer/v1/config/fixed_cfg.pb.go (requires alternate plugin and sed scripting due to issues with google.protobuf.Struct)
@$(protoc) $(proto_path) $(gogo_plugin) $(protoc_gen_docs_plugin)mixer/v1/config $^
Expand All @@ -241,8 +251,8 @@ mixer/v1/config/fixed_cfg.pb.go mixer/v1/config/istio.mixer.v1.config.pb.html: m
@rm mixer/v1/config/cfg.pb.go

clean-mixer-generated:
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
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
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
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

#####################
# routing/...
Expand Down
121 changes: 121 additions & 0 deletions mixer/adapter/model/v1beta/extensions.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions mixer/adapter/model/v1beta/extensions.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2017 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

// $title: Mixer Adapter Model
// $overview: Definitions used when creating Mixer templates
// $location: https://istio.io/docs/reference/config/mixer/istio.mixer.adapter.model.v1beta.html

// This package defines the types that are used when creating Mixer templates. `ValueType` defined in this pacakge
// is also used by adapters to know the underlying datatype of the instance fields.
package istio.mixer.adapter.model.v1beta;

option go_package="istio.io/api/mixer/adapter/model/v1beta";

import "google/protobuf/descriptor.proto";


// The available varieties of templates, controlling the semantics of what an adapter does with each instance.
enum TemplateVariety {
// Makes the template applicable for Mixer's check calls.
TEMPLATE_VARIETY_CHECK = 0;
// Makes the template applicable for Mixer's report calls.
TEMPLATE_VARIETY_REPORT = 1;
// Makes the template applicable for Mixer's quota calls.
TEMPLATE_VARIETY_QUOTA = 2;
// Makes the template applicable for Mixer's quota calls.
TEMPLATE_VARIETY_ATTRIBUTE_GENERATOR = 3;
}

// File option for the TemplateVariety.
extend google.protobuf.FileOptions {
TemplateVariety template_variety = 72295727;
}
Loading