diff --git a/Makefile b/Makefile index d7c441040b5..931b63dc50d 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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 $^ @@ -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/... diff --git a/mixer/adapter/model/v1beta/extensions.pb.go b/mixer/adapter/model/v1beta/extensions.pb.go new file mode 100644 index 00000000000..92ce18693d6 --- /dev/null +++ b/mixer/adapter/model/v1beta/extensions.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: mixer/adapter/model/v1beta/extensions.proto + +/* +Package v1beta is a generated protocol buffer package. + +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. + +It is generated from these files: + mixer/adapter/model/v1beta/extensions.proto + mixer/adapter/model/v1beta/type.proto + mixer/adapter/model/v1beta/value_type.proto + +It has these top-level messages: + Value + IPAddress + Duration + TimeStamp + DNSName + EmailAddress + Uri +*/ +package v1beta + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" + +import strconv "strconv" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// The available varieties of templates, controlling the semantics of what an adapter does with each instance. +type TemplateVariety int32 + +const ( + // Makes the template applicable for Mixer's check calls. + TEMPLATE_VARIETY_CHECK TemplateVariety = 0 + // Makes the template applicable for Mixer's report calls. + TEMPLATE_VARIETY_REPORT TemplateVariety = 1 + // Makes the template applicable for Mixer's quota calls. + TEMPLATE_VARIETY_QUOTA TemplateVariety = 2 + // Makes the template applicable for Mixer's quota calls. + TEMPLATE_VARIETY_ATTRIBUTE_GENERATOR TemplateVariety = 3 +) + +var TemplateVariety_name = map[int32]string{ + 0: "TEMPLATE_VARIETY_CHECK", + 1: "TEMPLATE_VARIETY_REPORT", + 2: "TEMPLATE_VARIETY_QUOTA", + 3: "TEMPLATE_VARIETY_ATTRIBUTE_GENERATOR", +} +var TemplateVariety_value = map[string]int32{ + "TEMPLATE_VARIETY_CHECK": 0, + "TEMPLATE_VARIETY_REPORT": 1, + "TEMPLATE_VARIETY_QUOTA": 2, + "TEMPLATE_VARIETY_ATTRIBUTE_GENERATOR": 3, +} + +func (TemplateVariety) EnumDescriptor() ([]byte, []int) { return fileDescriptorExtensions, []int{0} } + +var E_TemplateVariety = &proto.ExtensionDesc{ + ExtendedType: (*google_protobuf.FileOptions)(nil), + ExtensionType: (*TemplateVariety)(nil), + Field: 72295727, + Name: "istio.mixer.adapter.model.v1beta.template_variety", + Tag: "varint,72295727,opt,name=template_variety,json=templateVariety,enum=istio.mixer.adapter.model.v1beta.TemplateVariety", + Filename: "mixer/adapter/model/v1beta/extensions.proto", +} + +func init() { + proto.RegisterEnum("istio.mixer.adapter.model.v1beta.TemplateVariety", TemplateVariety_name, TemplateVariety_value) + proto.RegisterExtension(E_TemplateVariety) +} +func (x TemplateVariety) String() string { + s, ok := TemplateVariety_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} + +func init() { + proto.RegisterFile("mixer/adapter/model/v1beta/extensions.proto", fileDescriptorExtensions) +} + +var fileDescriptorExtensions = []byte{ + // 334 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xce, 0xcd, 0xac, 0x48, + 0x2d, 0xd2, 0x4f, 0x4c, 0x49, 0x2c, 0x28, 0x49, 0x2d, 0xd2, 0xcf, 0xcd, 0x4f, 0x49, 0xcd, 0xd1, + 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0xd4, 0x4f, 0xad, 0x28, 0x49, 0xcd, 0x2b, 0xce, 0xcc, 0xcf, + 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0xc8, 0x2c, 0x2e, 0xc9, 0xcc, 0xd7, 0x03, + 0x6b, 0xd1, 0x83, 0x6a, 0xd1, 0x03, 0x6b, 0xd1, 0x83, 0x68, 0x91, 0x52, 0x48, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x07, 0xab, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, + 0x28, 0xc9, 0x2f, 0x82, 0x98, 0xa1, 0x35, 0x81, 0x91, 0x8b, 0x3f, 0x24, 0x35, 0xb7, 0x20, 0x27, + 0xb1, 0x24, 0x35, 0x2c, 0xb1, 0x28, 0x33, 0xb5, 0xa4, 0x52, 0x48, 0x8a, 0x4b, 0x2c, 0xc4, 0xd5, + 0x37, 0xc0, 0xc7, 0x31, 0xc4, 0x35, 0x3e, 0xcc, 0x31, 0xc8, 0xd3, 0x35, 0x24, 0x32, 0xde, 0xd9, + 0xc3, 0xd5, 0xd9, 0x5b, 0x80, 0x41, 0x48, 0x9a, 0x4b, 0x1c, 0x43, 0x2e, 0xc8, 0x35, 0xc0, 0x3f, + 0x28, 0x44, 0x80, 0x11, 0xab, 0xc6, 0xc0, 0x50, 0xff, 0x10, 0x47, 0x01, 0x26, 0x21, 0x0d, 0x2e, + 0x15, 0x0c, 0x39, 0xc7, 0x90, 0x90, 0x20, 0x4f, 0xa7, 0xd0, 0x10, 0xd7, 0x78, 0x77, 0x57, 0x3f, + 0xd7, 0x20, 0xc7, 0x10, 0xff, 0x20, 0x01, 0x66, 0xab, 0x5a, 0x2e, 0x81, 0x12, 0xa8, 0x8b, 0xe2, + 0xcb, 0xa0, 0x4e, 0x92, 0xd1, 0x83, 0xf8, 0x44, 0x0f, 0xe6, 0x13, 0x3d, 0xb7, 0xcc, 0x9c, 0x54, + 0xff, 0x82, 0x12, 0x50, 0x70, 0x48, 0xac, 0x3f, 0xb5, 0x47, 0x49, 0x81, 0x51, 0x83, 0xcf, 0xc8, + 0x50, 0x8f, 0x50, 0x90, 0xe8, 0xa1, 0x79, 0x36, 0x88, 0xbf, 0x04, 0x55, 0xc0, 0x29, 0xf4, 0xc2, + 0x43, 0x39, 0x86, 0x1b, 0x0f, 0xe5, 0x18, 0x3e, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, + 0xe2, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, + 0xf8, 0xe2, 0x91, 0x1c, 0xc3, 0x87, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0x43, + 0x2c, 0xcc, 0xcc, 0xd7, 0x4f, 0x2c, 0xc8, 0xd4, 0xc7, 0x1d, 0x7b, 0x49, 0x6c, 0x60, 0x97, 0x1b, + 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xf2, 0x48, 0x92, 0xe2, 0x01, 0x00, 0x00, +} diff --git a/mixer/adapter/model/v1beta/extensions.proto b/mixer/adapter/model/v1beta/extensions.proto new file mode 100644 index 00000000000..eb4170a58d1 --- /dev/null +++ b/mixer/adapter/model/v1beta/extensions.proto @@ -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; +} diff --git a/mixer/adapter/model/v1beta/istio.mixer.adapter.model.v1beta.pb.html b/mixer/adapter/model/v1beta/istio.mixer.adapter.model.v1beta.pb.html new file mode 100644 index 00000000000..12cb5d67a1b --- /dev/null +++ b/mixer/adapter/model/v1beta/istio.mixer.adapter.model.v1beta.pb.html @@ -0,0 +1,195 @@ +--- +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 +layout: protoc-gen-docs +number_of_entries: 9 +--- +{% raw %} +

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.

+ +

DNSName

+
+

DNSName is used inside templates for fields that are of ValueType “DNS_NAME”

+ +
+

Duration

+
+

Duration is used inside templates for fields that are of ValueType “DURATION”

+ +
+

EmailAddress

+
+

EmailAddress is used inside templates for fields that are of ValueType “EMAIL_ADDRESS” +DO NOT USE !! Under Development

+ +
+

IPAddress

+
+

IPAddress is used inside templates for fields that are of ValueType “IP_ADDRESS”

+ +
+

TemplateVariety

+
+

The available varieties of templates, controlling the semantics of what an adapter does with each instance.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
TEMPLATE_VARIETY_CHECK +

Makes the template applicable for Mixer’s check calls.

+ +
TEMPLATE_VARIETY_REPORT +

Makes the template applicable for Mixer’s report calls.

+ +
TEMPLATE_VARIETY_QUOTA +

Makes the template applicable for Mixer’s quota calls.

+ +
TEMPLATE_VARIETY_ATTRIBUTE_GENERATOR +

Makes the template applicable for Mixer’s quota calls.

+ +
+
+

TimeStamp

+
+

TimeStamp is used inside templates for fields that are of ValueType “TIMESTAMP”

+ +
+

Uri

+
+

Uri is used inside templates for fields that are of ValueType “URI” +DO NOT USE ! Under Development

+ +
+

Value

+
+

Value is used inside templates for fields that have dynamic types. The actual datatype +of the field depends on the datatype of the expression used in the operator configuration.

+ +
+

ValueType

+
+

ValueType describes the types that values in the Istio system can take. These +are used to describe the type of Attributes at run time, describe the type of +the result of evaluating an expression, and to describe the runtime type of +fields of other descriptors.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
VALUE_TYPE_UNSPECIFIED +

Invalid, default value.

+ +
STRING +

An undiscriminated variable-length string.

+ +
INT64 +

An undiscriminated 64-bit signed integer.

+ +
DOUBLE +

An undiscriminated 64-bit floating-point value.

+ +
BOOL +

An undiscriminated boolean value.

+ +
TIMESTAMP +

A point in time.

+ +
IP_ADDRESS +

An IP address.

+ +
EMAIL_ADDRESS +

An email address.

+ +
URI +

A URI.

+ +
DNS_NAME +

A DNS name.

+ +
DURATION +

A span between two points in time.

+ +
STRING_MAP +

A map string -> string, typically used by headers.

+ +
+
+{% endraw %} diff --git a/mixer/adapter/model/v1beta/type.pb.go b/mixer/adapter/model/v1beta/type.pb.go new file mode 100644 index 00000000000..0f53af14302 --- /dev/null +++ b/mixer/adapter/model/v1beta/type.pb.go @@ -0,0 +1,1082 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: mixer/adapter/model/v1beta/type.proto + +package v1beta + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" + +import strings "strings" +import reflect "reflect" + +import io "io" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Value is used inside templates for fields that have dynamic types. The actual datatype +// of the field depends on the datatype of the expression used in the operator configuration. +type Value struct { +} + +func (m *Value) Reset() { *m = Value{} } +func (*Value) ProtoMessage() {} +func (*Value) Descriptor() ([]byte, []int) { return fileDescriptorType, []int{0} } + +// IPAddress is used inside templates for fields that are of ValueType "IP_ADDRESS" +type IPAddress struct { +} + +func (m *IPAddress) Reset() { *m = IPAddress{} } +func (*IPAddress) ProtoMessage() {} +func (*IPAddress) Descriptor() ([]byte, []int) { return fileDescriptorType, []int{1} } + +// Duration is used inside templates for fields that are of ValueType "DURATION" +type Duration struct { +} + +func (m *Duration) Reset() { *m = Duration{} } +func (*Duration) ProtoMessage() {} +func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptorType, []int{2} } + +// TimeStamp is used inside templates for fields that are of ValueType "TIMESTAMP" +type TimeStamp struct { +} + +func (m *TimeStamp) Reset() { *m = TimeStamp{} } +func (*TimeStamp) ProtoMessage() {} +func (*TimeStamp) Descriptor() ([]byte, []int) { return fileDescriptorType, []int{3} } + +// DNSName is used inside templates for fields that are of ValueType "DNS_NAME" +type DNSName struct { +} + +func (m *DNSName) Reset() { *m = DNSName{} } +func (*DNSName) ProtoMessage() {} +func (*DNSName) Descriptor() ([]byte, []int) { return fileDescriptorType, []int{4} } + +// EmailAddress is used inside templates for fields that are of ValueType "EMAIL_ADDRESS" +// DO NOT USE !! Under Development +type EmailAddress struct { +} + +func (m *EmailAddress) Reset() { *m = EmailAddress{} } +func (*EmailAddress) ProtoMessage() {} +func (*EmailAddress) Descriptor() ([]byte, []int) { return fileDescriptorType, []int{5} } + +// Uri is used inside templates for fields that are of ValueType "URI" +// DO NOT USE ! Under Development +type Uri struct { +} + +func (m *Uri) Reset() { *m = Uri{} } +func (*Uri) ProtoMessage() {} +func (*Uri) Descriptor() ([]byte, []int) { return fileDescriptorType, []int{6} } + +func init() { + proto.RegisterType((*Value)(nil), "istio.mixer.adapter.model.v1beta.Value") + proto.RegisterType((*IPAddress)(nil), "istio.mixer.adapter.model.v1beta.IPAddress") + proto.RegisterType((*Duration)(nil), "istio.mixer.adapter.model.v1beta.Duration") + proto.RegisterType((*TimeStamp)(nil), "istio.mixer.adapter.model.v1beta.TimeStamp") + proto.RegisterType((*DNSName)(nil), "istio.mixer.adapter.model.v1beta.DNSName") + proto.RegisterType((*EmailAddress)(nil), "istio.mixer.adapter.model.v1beta.EmailAddress") + proto.RegisterType((*Uri)(nil), "istio.mixer.adapter.model.v1beta.Uri") +} +func (this *Value) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Value) + if !ok { + that2, ok := that.(Value) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + return true +} +func (this *IPAddress) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*IPAddress) + if !ok { + that2, ok := that.(IPAddress) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + return true +} +func (this *Duration) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Duration) + if !ok { + that2, ok := that.(Duration) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + return true +} +func (this *TimeStamp) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*TimeStamp) + if !ok { + that2, ok := that.(TimeStamp) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + return true +} +func (this *DNSName) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*DNSName) + if !ok { + that2, ok := that.(DNSName) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + return true +} +func (this *EmailAddress) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*EmailAddress) + if !ok { + that2, ok := that.(EmailAddress) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + return true +} +func (this *Uri) Equal(that interface{}) bool { + if that == nil { + if this == nil { + return true + } + return false + } + + that1, ok := that.(*Uri) + if !ok { + that2, ok := that.(Uri) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + if this == nil { + return true + } + return false + } else if this == nil { + return false + } + return true +} +func (this *Value) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&v1beta.Value{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *IPAddress) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&v1beta.IPAddress{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Duration) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&v1beta.Duration{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *TimeStamp) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&v1beta.TimeStamp{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DNSName) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&v1beta.DNSName{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *EmailAddress) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&v1beta.EmailAddress{") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Uri) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 4) + s = append(s, "&v1beta.Uri{") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringType(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *Value) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Value) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func (m *IPAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IPAddress) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func (m *Duration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Duration) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func (m *TimeStamp) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TimeStamp) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func (m *DNSName) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DNSName) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func (m *EmailAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EmailAddress) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func (m *Uri) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Uri) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func encodeVarintType(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *Value) Size() (n int) { + var l int + _ = l + return n +} + +func (m *IPAddress) Size() (n int) { + var l int + _ = l + return n +} + +func (m *Duration) Size() (n int) { + var l int + _ = l + return n +} + +func (m *TimeStamp) Size() (n int) { + var l int + _ = l + return n +} + +func (m *DNSName) Size() (n int) { + var l int + _ = l + return n +} + +func (m *EmailAddress) Size() (n int) { + var l int + _ = l + return n +} + +func (m *Uri) Size() (n int) { + var l int + _ = l + return n +} + +func sovType(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozType(x uint64) (n int) { + return sovType(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Value) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Value{`, + `}`, + }, "") + return s +} +func (this *IPAddress) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&IPAddress{`, + `}`, + }, "") + return s +} +func (this *Duration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Duration{`, + `}`, + }, "") + return s +} +func (this *TimeStamp) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TimeStamp{`, + `}`, + }, "") + return s +} +func (this *DNSName) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DNSName{`, + `}`, + }, "") + return s +} +func (this *EmailAddress) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EmailAddress{`, + `}`, + }, "") + return s +} +func (this *Uri) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Uri{`, + `}`, + }, "") + return s +} +func valueToStringType(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Value) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowType + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Value: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipType(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthType + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IPAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowType + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IPAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IPAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipType(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthType + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Duration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowType + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Duration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Duration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipType(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthType + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TimeStamp) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowType + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TimeStamp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TimeStamp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipType(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthType + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DNSName) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowType + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DNSName: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DNSName: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipType(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthType + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EmailAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowType + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EmailAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EmailAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipType(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthType + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Uri) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowType + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Uri: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Uri: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipType(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthType + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipType(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowType + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowType + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowType + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthType + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowType + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipType(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthType = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowType = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("mixer/adapter/model/v1beta/type.proto", fileDescriptorType) } + +var fileDescriptorType = []byte{ + // 223 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcd, 0xcd, 0xac, 0x48, + 0x2d, 0xd2, 0x4f, 0x4c, 0x49, 0x2c, 0x28, 0x49, 0x2d, 0xd2, 0xcf, 0xcd, 0x4f, 0x49, 0xcd, 0xd1, + 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0xd4, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x52, 0xc8, 0x2c, 0x2e, 0xc9, 0xcc, 0xd7, 0x03, 0x2b, 0xd6, 0x83, 0x2a, 0xd6, 0x03, + 0x2b, 0xd6, 0x83, 0x28, 0x56, 0x62, 0xe7, 0x62, 0x0d, 0x4b, 0xcc, 0x29, 0x4d, 0x55, 0xe2, 0xe6, + 0xe2, 0xf4, 0x0c, 0x70, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x56, 0xe2, 0xe2, 0xe2, 0x70, 0x29, + 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0x03, 0x49, 0x84, 0x64, 0xe6, 0xa6, 0x06, 0x97, 0x24, 0xe6, + 0x16, 0x28, 0x71, 0x72, 0xb1, 0xbb, 0xf8, 0x05, 0xfb, 0x25, 0xe6, 0xa6, 0x2a, 0xf1, 0x71, 0xf1, + 0xb8, 0xe6, 0x26, 0x66, 0xe6, 0xc0, 0xf4, 0xb0, 0x72, 0x31, 0x87, 0x16, 0x65, 0x3a, 0x85, 0x5e, + 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, + 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, + 0x18, 0x5f, 0x3c, 0x92, 0x63, 0xf8, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x28, 0x75, + 0x88, 0x03, 0x33, 0xf3, 0xf5, 0x13, 0x0b, 0x32, 0xf5, 0x71, 0x7b, 0x2a, 0x89, 0x0d, 0xec, 0x21, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xea, 0x81, 0x8a, 0x56, 0xf9, 0x00, 0x00, 0x00, +} diff --git a/mixer/adapter/model/v1beta/type.proto b/mixer/adapter/model/v1beta/type.proto new file mode 100644 index 00000000000..cf8298ccf50 --- /dev/null +++ b/mixer/adapter/model/v1beta/type.proto @@ -0,0 +1,43 @@ +// 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"; + +package istio.mixer.adapter.model.v1beta; + +option go_package="istio.io/api/mixer/adapter/model/v1beta"; + +// Value is used inside templates for fields that have dynamic types. The actual datatype +// of the field depends on the datatype of the expression used in the operator configuration. +message Value {} + +// IPAddress is used inside templates for fields that are of ValueType "IP_ADDRESS" +message IPAddress {} + +// Duration is used inside templates for fields that are of ValueType "DURATION" +message Duration {} + +// TimeStamp is used inside templates for fields that are of ValueType "TIMESTAMP" +message TimeStamp {} + +// DNSName is used inside templates for fields that are of ValueType "DNS_NAME" +message DNSName {} + +// EmailAddress is used inside templates for fields that are of ValueType "EMAIL_ADDRESS" +// DO NOT USE !! Under Development +message EmailAddress {} + +// Uri is used inside templates for fields that are of ValueType "URI" +// DO NOT USE ! Under Development +message Uri {} diff --git a/mixer/adapter/model/v1beta/value_type.pb.go b/mixer/adapter/model/v1beta/value_type.pb.go new file mode 100644 index 00000000000..047d81062de --- /dev/null +++ b/mixer/adapter/model/v1beta/value_type.pb.go @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: mixer/adapter/model/v1beta/value_type.proto + +package v1beta + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" + +import strconv "strconv" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// ValueType describes the types that values in the Istio system can take. These +// are used to describe the type of Attributes at run time, describe the type of +// the result of evaluating an expression, and to describe the runtime type of +// fields of other descriptors. +type ValueType int32 + +const ( + // Invalid, default value. + VALUE_TYPE_UNSPECIFIED ValueType = 0 + // An undiscriminated variable-length string. + STRING ValueType = 1 + // An undiscriminated 64-bit signed integer. + INT64 ValueType = 2 + // An undiscriminated 64-bit floating-point value. + DOUBLE ValueType = 3 + // An undiscriminated boolean value. + BOOL ValueType = 4 + // A point in time. + TIMESTAMP ValueType = 5 + // An IP address. + IP_ADDRESS ValueType = 6 + // An email address. + EMAIL_ADDRESS ValueType = 7 + // A URI. + URI ValueType = 8 + // A DNS name. + DNS_NAME ValueType = 9 + // A span between two points in time. + DURATION ValueType = 10 + // A map string -> string, typically used by headers. + STRING_MAP ValueType = 11 +) + +var ValueType_name = map[int32]string{ + 0: "VALUE_TYPE_UNSPECIFIED", + 1: "STRING", + 2: "INT64", + 3: "DOUBLE", + 4: "BOOL", + 5: "TIMESTAMP", + 6: "IP_ADDRESS", + 7: "EMAIL_ADDRESS", + 8: "URI", + 9: "DNS_NAME", + 10: "DURATION", + 11: "STRING_MAP", +} +var ValueType_value = map[string]int32{ + "VALUE_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INT64": 2, + "DOUBLE": 3, + "BOOL": 4, + "TIMESTAMP": 5, + "IP_ADDRESS": 6, + "EMAIL_ADDRESS": 7, + "URI": 8, + "DNS_NAME": 9, + "DURATION": 10, + "STRING_MAP": 11, +} + +func (ValueType) EnumDescriptor() ([]byte, []int) { return fileDescriptorValueType, []int{0} } + +func init() { + proto.RegisterEnum("istio.mixer.adapter.model.v1beta.ValueType", ValueType_name, ValueType_value) +} +func (x ValueType) String() string { + s, ok := ValueType_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} + +func init() { + proto.RegisterFile("mixer/adapter/model/v1beta/value_type.proto", fileDescriptorValueType) +} + +var fileDescriptorValueType = []byte{ + // 318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0xd0, 0x3d, 0x4b, 0xc3, 0x40, + 0x1c, 0xc7, 0xf1, 0x9c, 0x7d, 0xcc, 0x5f, 0x2b, 0xe7, 0x0d, 0x0e, 0x0e, 0x87, 0x9b, 0xa0, 0x90, + 0x20, 0x8a, 0xfb, 0xd5, 0x9c, 0x72, 0x90, 0x27, 0x92, 0x4b, 0x41, 0x97, 0x90, 0xd2, 0x1b, 0x02, + 0x2d, 0x09, 0x35, 0x16, 0xbb, 0xf9, 0x12, 0x7c, 0x19, 0xbe, 0x07, 0xdf, 0x80, 0x63, 0x47, 0x47, + 0x7b, 0x2e, 0x8e, 0x7d, 0x09, 0xd2, 0x44, 0xdc, 0x1c, 0xef, 0x07, 0x9f, 0xe3, 0xcf, 0x17, 0xce, + 0x66, 0xf9, 0x93, 0x9a, 0xdb, 0xd9, 0x24, 0x2b, 0x2b, 0x35, 0xb7, 0x67, 0xc5, 0x44, 0x4d, 0xed, + 0xc5, 0xf9, 0x58, 0x55, 0x99, 0xbd, 0xc8, 0xa6, 0x8f, 0x2a, 0xad, 0x96, 0xa5, 0xb2, 0xca, 0x79, + 0x51, 0x15, 0xe4, 0x38, 0x7f, 0xa8, 0xf2, 0xc2, 0xaa, 0x89, 0xf5, 0x4b, 0xac, 0x9a, 0x58, 0x0d, + 0x39, 0x7d, 0x43, 0x60, 0x8e, 0xb6, 0x4c, 0x2e, 0x4b, 0x45, 0x8e, 0xe0, 0x70, 0xc4, 0xdc, 0x84, + 0xa7, 0xf2, 0x2e, 0xe4, 0x69, 0xe2, 0xc7, 0x21, 0xbf, 0x16, 0x37, 0x82, 0x3b, 0xd8, 0x20, 0x00, + 0xdd, 0x58, 0x46, 0xc2, 0xbf, 0xc5, 0x88, 0x98, 0xd0, 0x11, 0xbe, 0xbc, 0xba, 0xc4, 0x3b, 0xdb, + 0xd9, 0x09, 0x92, 0xa1, 0xcb, 0x71, 0x8b, 0xf4, 0xa1, 0x3d, 0x0c, 0x02, 0x17, 0xb7, 0xc9, 0x00, + 0x4c, 0x29, 0x3c, 0x1e, 0x4b, 0xe6, 0x85, 0xb8, 0x43, 0xf6, 0x01, 0x44, 0x98, 0x32, 0xc7, 0x89, + 0x78, 0x1c, 0xe3, 0x2e, 0x39, 0x80, 0x01, 0xf7, 0x98, 0x70, 0xff, 0xa6, 0x1e, 0xe9, 0x41, 0x2b, + 0x89, 0x04, 0xee, 0x93, 0x3d, 0xe8, 0x3b, 0x7e, 0x9c, 0xfa, 0xcc, 0xe3, 0xd8, 0xac, 0x5f, 0x49, + 0xc4, 0xa4, 0x08, 0x7c, 0x0c, 0xdb, 0x7f, 0x9a, 0x1b, 0x52, 0x8f, 0x85, 0x78, 0x77, 0x98, 0xac, + 0xd6, 0xd4, 0xf8, 0x58, 0x53, 0x63, 0xb3, 0xa6, 0xe8, 0x59, 0x53, 0xf4, 0xaa, 0x29, 0x7a, 0xd7, + 0x14, 0xad, 0x34, 0x45, 0x9f, 0x9a, 0xa2, 0x6f, 0x4d, 0x8d, 0x8d, 0xa6, 0xe8, 0xe5, 0x8b, 0x1a, + 0xf7, 0x27, 0x4d, 0x8d, 0xbc, 0xb0, 0xb3, 0x32, 0xb7, 0xff, 0xef, 0x38, 0xee, 0xd6, 0xf5, 0x2e, + 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0xab, 0x66, 0x67, 0xd4, 0x6c, 0x01, 0x00, 0x00, +} diff --git a/mixer/adapter/model/v1beta/value_type.proto b/mixer/adapter/model/v1beta/value_type.proto new file mode 100644 index 00000000000..269301e3b5f --- /dev/null +++ b/mixer/adapter/model/v1beta/value_type.proto @@ -0,0 +1,61 @@ +// 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"; + +package istio.mixer.adapter.model.v1beta; + +option go_package="istio.io/api/mixer/adapter/model/v1beta"; + +// ValueType describes the types that values in the Istio system can take. These +// are used to describe the type of Attributes at run time, describe the type of +// the result of evaluating an expression, and to describe the runtime type of +// fields of other descriptors. +enum ValueType { + // Invalid, default value. + VALUE_TYPE_UNSPECIFIED = 0; + + // An undiscriminated variable-length string. + STRING = 1; + + // An undiscriminated 64-bit signed integer. + INT64 = 2; + + // An undiscriminated 64-bit floating-point value. + DOUBLE = 3; + + // An undiscriminated boolean value. + BOOL = 4; + + // A point in time. + TIMESTAMP = 5; + + // An IP address. + IP_ADDRESS = 6; + + // An email address. + EMAIL_ADDRESS = 7; + + // A URI. + URI = 8; + + // A DNS name. + DNS_NAME = 9; + + // A span between two points in time. + DURATION = 10; + + // A map string -> string, typically used by headers. + STRING_MAP = 11; +}