From 84645b86ef7aa8c375049f16e9505e7ca7c82422 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:30:55 -0400 Subject: [PATCH 01/39] chore(wip): gah --- internal/server/data/server.go | 210 ++++++ rpc/flipt/data/data.pb.go | 1133 ++++++++++++++++++++++++++++++++ rpc/flipt/data/data.proto | 84 +++ rpc/flipt/data/data_grpc.pb.go | 109 +++ sdk/go/data.sdk.gen.go | 21 + sdk/go/grpc/grpc.sdk.gen.go | 5 + sdk/go/http/data.sdk.gen.go | 17 + sdk/go/sdk.gen.go | 9 + 8 files changed, 1588 insertions(+) create mode 100644 internal/server/data/server.go create mode 100644 rpc/flipt/data/data.pb.go create mode 100644 rpc/flipt/data/data.proto create mode 100644 rpc/flipt/data/data_grpc.pb.go create mode 100644 sdk/go/data.sdk.gen.go create mode 100644 sdk/go/http/data.sdk.gen.go diff --git a/internal/server/data/server.go b/internal/server/data/server.go new file mode 100644 index 0000000000..ba3285a9c9 --- /dev/null +++ b/internal/server/data/server.go @@ -0,0 +1,210 @@ +package data + +import ( + "context" + "encoding/json" + "fmt" + + "go.flipt.io/flipt/internal/storage" + "go.flipt.io/flipt/rpc/flipt" + "go.flipt.io/flipt/rpc/flipt/data" + "go.uber.org/zap" +) + +type Server struct { + logger *zap.Logger + store storage.Store + + data.UnimplementedDataServer +} + +func NewServer(logger *zap.Logger, store storage.Store) *Server { + return &Server{ + logger: logger, + store: store, + } +} + +func (s *Server) Snapshot(ctx context.Context, r *data.NamespaceRequest) (*data.NamespaceResponse, error) { + var ( + namespaceKey = r.Key + resp = &data.NamespaceResponse{} + remaining = true + nextPage string + ) + + // flags/variants in batches + for batch := int32(0); remaining; batch++ { + res, err := s.store.ListFlags( + ctx, + namespaceKey, + storage.WithPageToken(nextPage), + ) + if err != nil { + return nil, fmt.Errorf("getting flags: %w", err) + } + + flags := res.Results + nextPage = res.NextPageToken + remaining = nextPage != "" + + for _, f := range flags { + flag := &data.Flag{ + Key: f.Key, + Name: f.Name, + Type: f.Type.String(), + Description: f.Description, + Enabled: f.Enabled, + } + + // map variant id => variant key + variantKeys := make(map[string]string) + + for _, v := range f.Variants { + var attachment interface{} + + if v.Attachment != "" { + if err := json.Unmarshal([]byte(v.Attachment), &attachment); err != nil { + return nil, fmt.Errorf("unmarshaling variant attachment: %w", err) + } + } + + flag.Variants = append(flag.Variants, &data.Variant{ + Key: v.Key, + Name: v.Name, + Description: v.Description, + Attachment: attachment, + }) + + variantKeys[v.Id] = v.Key + } + + // rules for flag + resp, err := e.store.ListRules( + ctx, + &flipt.ListRuleRequest{ + NamespaceKey: namespaces[i], + FlagKey: flag.Key, + }, + ) + if err != nil { + return fmt.Errorf("getting rules for flag %q: %w", flag.Key, err) + } + + rules := resp.Rules + for _, r := range rules { + rule := &Rule{} + + switch { + case r.SegmentKey != "": + rule.Segment = &SegmentEmbed{ + IsSegment: SegmentKey(r.SegmentKey), + } + case len(r.SegmentKeys) > 0: + rule.Segment = &SegmentEmbed{ + IsSegment: &Segments{ + Keys: r.SegmentKeys, + SegmentOperator: r.SegmentOperator.String(), + }, + } + default: + return fmt.Errorf("wrong format for rule segments") + } + + for _, d := range r.Distributions { + rule.Distributions = append(rule.Distributions, &Distribution{ + VariantKey: variantKeys[d.VariantId], + Rollout: d.Rollout, + }) + } + + flag.Rules = append(flag.Rules, rule) + } + + rollouts, err := e.store.ListRollouts(ctx, &flipt.ListRolloutRequest{ + NamespaceKey: namespaces[i], + FlagKey: flag.Key, + }) + if err != nil { + return fmt.Errorf("getting rollout rules for flag %q: %w", flag.Key, err) + } + + for _, r := range rollouts.Rules { + rollout := Rollout{ + Description: r.Description, + } + + switch rule := r.Rule.(type) { + case *flipt.Rollout_Segment: + rollout.Segment = &SegmentRule{ + Value: rule.Segment.Value, + } + + if rule.Segment.SegmentKey != "" { + rollout.Segment.Key = rule.Segment.SegmentKey + } else if len(rule.Segment.SegmentKeys) > 0 { + rollout.Segment.Keys = rule.Segment.SegmentKeys + } + + if rule.Segment.SegmentOperator == flipt.SegmentOperator_AND_SEGMENT_OPERATOR { + rollout.Segment.Operator = rule.Segment.SegmentOperator.String() + } + case *flipt.Rollout_Threshold: + rollout.Threshold = &ThresholdRule{ + Percentage: rule.Threshold.Percentage, + Value: rule.Threshold.Value, + } + } + + flag.Rollouts = append(flag.Rollouts, &rollout) + } + + doc.Flags = append(doc.Flags, flag) + } + } + + remaining = true + nextPage = "" + + // segments/constraints in batches + for batch := int32(0); remaining; batch++ { + resp, err := e.store.ListSegments( + ctx, + &flipt.ListSegmentRequest{ + NamespaceKey: namespaces[i], + PageToken: nextPage, + Limit: batchSize, + }, + ) + if err != nil { + return fmt.Errorf("getting segments: %w", err) + } + + segments := resp.Segments + nextPage = resp.NextPageToken + remaining = nextPage != "" + + for _, s := range segments { + segment := &Segment{ + Key: s.Key, + Name: s.Name, + Description: s.Description, + MatchType: s.MatchType.String(), + } + + for _, c := range s.Constraints { + segment.Constraints = append(segment.Constraints, &Constraint{ + Type: c.Type.String(), + Property: c.Property, + Operator: c.Operator, + Value: c.Value, + Description: c.Description, + }) + } + + doc.Segments = append(doc.Segments, segment) + } + } + + return nil, nil +} diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go new file mode 100644 index 0000000000..cad9a880f1 --- /dev/null +++ b/rpc/flipt/data/data.pb.go @@ -0,0 +1,1133 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: data/data.proto + +package data + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Flag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + Variants []*Variant `protobuf:"bytes,8,rep,name=variants,proto3" json:"variants,omitempty"` + Rules []*Rule `protobuf:"bytes,9,rep,name=rules,proto3" json:"rules,omitempty"` +} + +func (x *Flag) Reset() { + *x = Flag{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Flag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag) ProtoMessage() {} + +func (x *Flag) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag.ProtoReflect.Descriptor instead. +func (*Flag) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{0} +} + +func (x *Flag) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Flag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Flag) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Flag) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *Flag) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Flag) GetVariants() []*Variant { + if x != nil { + return x.Variants + } + return nil +} + +func (x *Flag) GetRules() []*Rule { + if x != nil { + return x.Rules + } + return nil +} + +type Rule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Segments *Rule_SegmentsRule `protobuf:"bytes,1,opt,name=segments,proto3" json:"segments,omitempty"` + Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` + Distributions []*Distribution `protobuf:"bytes,3,rep,name=distributions,proto3" json:"distributions,omitempty"` +} + +func (x *Rule) Reset() { + *x = Rule{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rule) ProtoMessage() {} + +func (x *Rule) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rule.ProtoReflect.Descriptor instead. +func (*Rule) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{1} +} + +func (x *Rule) GetSegments() *Rule_SegmentsRule { + if x != nil { + return x.Segments + } + return nil +} + +func (x *Rule) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *Rule) GetDistributions() []*Distribution { + if x != nil { + return x.Distributions + } + return nil +} + +type Rollout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Segment *Rollout_SegmentsRollout `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + Threshold *Rollout_ThresholdRollout `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *Rollout) Reset() { + *x = Rollout{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rollout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rollout) ProtoMessage() {} + +func (x *Rollout) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rollout.ProtoReflect.Descriptor instead. +func (*Rollout) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{2} +} + +func (x *Rollout) GetSegment() *Rollout_SegmentsRollout { + if x != nil { + return x.Segment + } + return nil +} + +func (x *Rollout) GetThreshold() *Rollout_ThresholdRollout { + if x != nil { + return x.Threshold + } + return nil +} + +func (x *Rollout) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type Distribution struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VariantKey string `protobuf:"bytes,1,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` + Rollout float32 `protobuf:"fixed32,2,opt,name=rollout,proto3" json:"rollout,omitempty"` +} + +func (x *Distribution) Reset() { + *x = Distribution{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Distribution) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Distribution) ProtoMessage() {} + +func (x *Distribution) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Distribution.ProtoReflect.Descriptor instead. +func (*Distribution) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{3} +} + +func (x *Distribution) GetVariantKey() string { + if x != nil { + return x.VariantKey + } + return "" +} + +func (x *Distribution) GetRollout() float32 { + if x != nil { + return x.Rollout + } + return 0 +} + +type Variant struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Attachment string `protobuf:"bytes,4,opt,name=attachment,proto3" json:"attachment,omitempty"` +} + +func (x *Variant) Reset() { + *x = Variant{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Variant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Variant) ProtoMessage() {} + +func (x *Variant) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Variant.ProtoReflect.Descriptor instead. +func (*Variant) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{4} +} + +func (x *Variant) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Variant) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Variant) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Variant) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +type Segment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + MatchType string `protobuf:"bytes,4,opt,name=match_type,json=matchType,proto3" json:"match_type,omitempty"` + Constraints []*Constraint `protobuf:"bytes,5,rep,name=constraints,proto3" json:"constraints,omitempty"` +} + +func (x *Segment) Reset() { + *x = Segment{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Segment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Segment) ProtoMessage() {} + +func (x *Segment) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Segment.ProtoReflect.Descriptor instead. +func (*Segment) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{5} +} + +func (x *Segment) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Segment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Segment) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Segment) GetMatchType() string { + if x != nil { + return x.MatchType + } + return "" +} + +func (x *Segment) GetConstraints() []*Constraint { + if x != nil { + return x.Constraints + } + return nil +} + +type Constraint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Property string `protobuf:"bytes,2,opt,name=property,proto3" json:"property,omitempty"` + Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` + Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *Constraint) Reset() { + *x = Constraint{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Constraint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Constraint) ProtoMessage() {} + +func (x *Constraint) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Constraint.ProtoReflect.Descriptor instead. +func (*Constraint) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{6} +} + +func (x *Constraint) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Constraint) GetProperty() string { + if x != nil { + return x.Property + } + return "" +} + +func (x *Constraint) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *Constraint) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *Constraint) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type NamespaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *NamespaceRequest) Reset() { + *x = NamespaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NamespaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NamespaceRequest) ProtoMessage() {} + +func (x *NamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NamespaceRequest.ProtoReflect.Descriptor instead. +func (*NamespaceRequest) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{7} +} + +func (x *NamespaceRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type NamespaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Flags []*Flag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` + Segments []*Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` +} + +func (x *NamespaceResponse) Reset() { + *x = NamespaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NamespaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NamespaceResponse) ProtoMessage() {} + +func (x *NamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NamespaceResponse.ProtoReflect.Descriptor instead. +func (*NamespaceResponse) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{8} +} + +func (x *NamespaceResponse) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *NamespaceResponse) GetFlags() []*Flag { + if x != nil { + return x.Flags + } + return nil +} + +func (x *NamespaceResponse) GetSegments() []*Segment { + if x != nil { + return x.Segments + } + return nil +} + +type Rule_SegmentsRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` + SegmentOperator string `protobuf:"bytes,2,opt,name=segment_operator,json=segmentOperator,proto3" json:"segment_operator,omitempty"` +} + +func (x *Rule_SegmentsRule) Reset() { + *x = Rule_SegmentsRule{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rule_SegmentsRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rule_SegmentsRule) ProtoMessage() {} + +func (x *Rule_SegmentsRule) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rule_SegmentsRule.ProtoReflect.Descriptor instead. +func (*Rule_SegmentsRule) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *Rule_SegmentsRule) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +func (x *Rule_SegmentsRule) GetSegmentOperator() string { + if x != nil { + return x.SegmentOperator + } + return "" +} + +type Rollout_SegmentsRollout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` + SegmentOperator string `protobuf:"bytes,2,opt,name=segment_operator,json=segmentOperator,proto3" json:"segment_operator,omitempty"` + Value bool `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Rollout_SegmentsRollout) Reset() { + *x = Rollout_SegmentsRollout{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rollout_SegmentsRollout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rollout_SegmentsRollout) ProtoMessage() {} + +func (x *Rollout_SegmentsRollout) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rollout_SegmentsRollout.ProtoReflect.Descriptor instead. +func (*Rollout_SegmentsRollout) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *Rollout_SegmentsRollout) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +func (x *Rollout_SegmentsRollout) GetSegmentOperator() string { + if x != nil { + return x.SegmentOperator + } + return "" +} + +func (x *Rollout_SegmentsRollout) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +type Rollout_ThresholdRollout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` + Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Rollout_ThresholdRollout) Reset() { + *x = Rollout_ThresholdRollout{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rollout_ThresholdRollout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rollout_ThresholdRollout) ProtoMessage() {} + +func (x *Rollout_ThresholdRollout) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rollout_ThresholdRollout.ProtoReflect.Descriptor instead. +func (*Rollout_ThresholdRollout) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *Rollout_ThresholdRollout) GetPercentage() float32 { + if x != nil { + return x.Percentage + } + return 0 +} + +func (x *Rollout_ThresholdRollout) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +var File_data_data_proto protoreflect.FileDescriptor + +var file_data_data_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd5, 0x01, + 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x08, + 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x61, 0x72, 0x69, + 0x61, 0x6e, 0x74, 0x52, 0x08, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, + 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, + 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x39, + 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x75, + 0x6c, 0x65, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x52, + 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, + 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x3e, 0x0a, + 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4d, 0x0a, + 0x0c, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, + 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xe0, 0x02, 0x0a, + 0x07, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x2e, 0x53, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x07, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x2e, + 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, + 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x66, 0x0a, + 0x0f, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, + 0x6b, 0x65, 0x79, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x48, 0x0a, 0x10, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x49, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0x71, 0x0a, 0x07, 0x56, 0x61, + 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xaa, 0x01, + 0x0a, 0x07, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0a, 0x43, + 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a, + 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x22, 0x7e, 0x0a, 0x11, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x66, 0x6c, + 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, + 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x32, 0x4f, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x08, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_data_data_proto_rawDescOnce sync.Once + file_data_data_proto_rawDescData = file_data_data_proto_rawDesc +) + +func file_data_data_proto_rawDescGZIP() []byte { + file_data_data_proto_rawDescOnce.Do(func() { + file_data_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_data_data_proto_rawDescData) + }) + return file_data_data_proto_rawDescData +} + +var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_data_data_proto_goTypes = []interface{}{ + (*Flag)(nil), // 0: flipt.data.Flag + (*Rule)(nil), // 1: flipt.data.Rule + (*Rollout)(nil), // 2: flipt.data.Rollout + (*Distribution)(nil), // 3: flipt.data.Distribution + (*Variant)(nil), // 4: flipt.data.Variant + (*Segment)(nil), // 5: flipt.data.Segment + (*Constraint)(nil), // 6: flipt.data.Constraint + (*NamespaceRequest)(nil), // 7: flipt.data.NamespaceRequest + (*NamespaceResponse)(nil), // 8: flipt.data.NamespaceResponse + (*Rule_SegmentsRule)(nil), // 9: flipt.data.Rule.SegmentsRule + (*Rollout_SegmentsRollout)(nil), // 10: flipt.data.Rollout.SegmentsRollout + (*Rollout_ThresholdRollout)(nil), // 11: flipt.data.Rollout.ThresholdRollout +} +var file_data_data_proto_depIdxs = []int32{ + 4, // 0: flipt.data.Flag.variants:type_name -> flipt.data.Variant + 1, // 1: flipt.data.Flag.rules:type_name -> flipt.data.Rule + 9, // 2: flipt.data.Rule.segments:type_name -> flipt.data.Rule.SegmentsRule + 3, // 3: flipt.data.Rule.distributions:type_name -> flipt.data.Distribution + 10, // 4: flipt.data.Rollout.segment:type_name -> flipt.data.Rollout.SegmentsRollout + 11, // 5: flipt.data.Rollout.threshold:type_name -> flipt.data.Rollout.ThresholdRollout + 6, // 6: flipt.data.Segment.constraints:type_name -> flipt.data.Constraint + 0, // 7: flipt.data.NamespaceResponse.flags:type_name -> flipt.data.Flag + 5, // 8: flipt.data.NamespaceResponse.segments:type_name -> flipt.data.Segment + 7, // 9: flipt.data.Data.Snapshot:input_type -> flipt.data.NamespaceRequest + 8, // 10: flipt.data.Data.Snapshot:output_type -> flipt.data.NamespaceResponse + 10, // [10:11] is the sub-list for method output_type + 9, // [9:10] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_data_data_proto_init() } +func file_data_data_proto_init() { + if File_data_data_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_data_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Flag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rollout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Distribution); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Variant); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Segment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Constraint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamespaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamespaceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rule_SegmentsRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rollout_SegmentsRollout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rollout_ThresholdRollout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_data_data_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_data_data_proto_goTypes, + DependencyIndexes: file_data_data_proto_depIdxs, + MessageInfos: file_data_data_proto_msgTypes, + }.Build() + File_data_data_proto = out.File + file_data_data_proto_rawDesc = nil + file_data_data_proto_goTypes = nil + file_data_data_proto_depIdxs = nil +} diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto new file mode 100644 index 0000000000..33d712e964 --- /dev/null +++ b/rpc/flipt/data/data.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; + +package flipt.data; + +option go_package = "go.flipt.io/flipt/rpc/flipt/data"; + +message Flag { + string key = 1; + string name = 2; + string description = 3; + bool enabled = 4; + string type = 5; + repeated Variant variants = 8; + repeated Rule rules = 9; +} + +message Rule { + message SegmentsRule { + repeated string keys = 1; + string segment_operator = 2; + } + SegmentsRule segments = 1; + int32 rank = 2; + repeated Distribution distributions = 3; +} + +message Rollout { + message SegmentsRollout { + repeated string keys = 1; + string segment_operator = 2; + bool value = 3; + } + message ThresholdRollout { + float percentage = 1; + bool value = 2; + } + SegmentsRollout segment = 1; + ThresholdRollout threshold = 2; + string description = 3; +} + +message Distribution { + string variant_key = 1; + float rollout = 2; +} + +message Variant { + string key = 1; + string name = 2; + string description = 3; + string attachment = 4; +} + +message Segment { + string key = 1; + string name = 2; + string description = 3; + string match_type = 4; + repeated Constraint constraints = 5; +} + +message Constraint { + string type = 1; + string property = 2; + string operator = 3; + string value = 4; + string description = 5; +} + +message NamespaceRequest { + string key = 1; + //int32 limit = 2; + //string page_token = 3; +} + +message NamespaceResponse { + string key = 1; + repeated Flag flags = 2; + repeated Segment segments = 3; +} + +service Data { + rpc Snapshot(NamespaceRequest) returns (NamespaceResponse); +} diff --git a/rpc/flipt/data/data_grpc.pb.go b/rpc/flipt/data/data_grpc.pb.go new file mode 100644 index 0000000000..8f4aa52f2f --- /dev/null +++ b/rpc/flipt/data/data_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: data/data.proto + +package data + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Data_Snapshot_FullMethodName = "/flipt.data.Data/Snapshot" +) + +// DataClient is the client API for Data service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DataClient interface { + Snapshot(ctx context.Context, in *NamespaceRequest, opts ...grpc.CallOption) (*NamespaceResponse, error) +} + +type dataClient struct { + cc grpc.ClientConnInterface +} + +func NewDataClient(cc grpc.ClientConnInterface) DataClient { + return &dataClient{cc} +} + +func (c *dataClient) Snapshot(ctx context.Context, in *NamespaceRequest, opts ...grpc.CallOption) (*NamespaceResponse, error) { + out := new(NamespaceResponse) + err := c.cc.Invoke(ctx, Data_Snapshot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DataServer is the server API for Data service. +// All implementations must embed UnimplementedDataServer +// for forward compatibility +type DataServer interface { + Snapshot(context.Context, *NamespaceRequest) (*NamespaceResponse, error) + mustEmbedUnimplementedDataServer() +} + +// UnimplementedDataServer must be embedded to have forward compatible implementations. +type UnimplementedDataServer struct { +} + +func (UnimplementedDataServer) Snapshot(context.Context, *NamespaceRequest) (*NamespaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Snapshot not implemented") +} +func (UnimplementedDataServer) mustEmbedUnimplementedDataServer() {} + +// UnsafeDataServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DataServer will +// result in compilation errors. +type UnsafeDataServer interface { + mustEmbedUnimplementedDataServer() +} + +func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) { + s.RegisterService(&Data_ServiceDesc, srv) +} + +func _Data_Snapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NamespaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataServer).Snapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Data_Snapshot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataServer).Snapshot(ctx, req.(*NamespaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Data_ServiceDesc is the grpc.ServiceDesc for Data service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Data_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipt.data.Data", + HandlerType: (*DataServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Snapshot", + Handler: _Data_Snapshot_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "data/data.proto", +} diff --git a/sdk/go/data.sdk.gen.go b/sdk/go/data.sdk.gen.go new file mode 100644 index 0000000000..6e0ac6f213 --- /dev/null +++ b/sdk/go/data.sdk.gen.go @@ -0,0 +1,21 @@ +// Code generated by protoc-gen-go-flipt-sdk. DO NOT EDIT. + +package sdk + +import ( + context "context" + data "go.flipt.io/flipt/rpc/flipt/data" +) + +type Data struct { + transport data.DataClient + tokenProvider ClientTokenProvider +} + +func (x *Data) Snapshot(ctx context.Context, v *data.NamespaceRequest) (*data.NamespaceResponse, error) { + ctx, err := authenticate(ctx, x.tokenProvider) + if err != nil { + return nil, err + } + return x.transport.Snapshot(ctx, v) +} diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index 96f7cd0644..89d95741a4 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -5,6 +5,7 @@ package grpc import ( flipt "go.flipt.io/flipt/rpc/flipt" auth "go.flipt.io/flipt/rpc/flipt/auth" + data "go.flipt.io/flipt/rpc/flipt/data" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" _go "go.flipt.io/flipt/sdk/go" @@ -53,6 +54,10 @@ func (t Transport) AuthClient() _go.AuthClient { return authClient{cc: t.cc} } +func (t Transport) DataClient() data.DataClient { + return data.NewDataClient(t.cc) +} + func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { return evaluation.NewEvaluationServiceClient(t.cc) } diff --git a/sdk/go/http/data.sdk.gen.go b/sdk/go/http/data.sdk.gen.go new file mode 100644 index 0000000000..e6fbf7982b --- /dev/null +++ b/sdk/go/http/data.sdk.gen.go @@ -0,0 +1,17 @@ +// Code generated by protoc-gen-go-flipt-sdk. DO NOT EDIT. + +package http + +import ( + data "go.flipt.io/flipt/rpc/flipt/data" + http "net/http" +) + +type DataClient struct { + client *http.Client + addr string +} + +func (t Transport) DataClient() data.DataClient { + return &DataClient{client: t.client, addr: t.addr} +} diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index 13952f90bc..04e5ef8ed9 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -5,6 +5,7 @@ package sdk import ( context "context" flipt "go.flipt.io/flipt/rpc/flipt" + data "go.flipt.io/flipt/rpc/flipt/data" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" metadata "google.golang.org/grpc/metadata" @@ -12,6 +13,7 @@ import ( type Transport interface { AuthClient() AuthClient + DataClient() data.DataClient EvaluationClient() evaluation.EvaluationServiceClient FliptClient() flipt.FliptClient MetaClient() meta.MetadataServiceClient @@ -73,6 +75,13 @@ func (s SDK) Auth() *Auth { } } +func (s SDK) Data() *Data { + return &Data{ + transport: s.transport.DataClient(), + tokenProvider: s.tokenProvider, + } +} + func (s SDK) Evaluation() *Evaluation { return &Evaluation{ transport: s.transport.EvaluationClient(), From 66483c72570143ae967ae7e30780aaf9c65afc1a Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Wed, 1 Nov 2023 20:35:27 -0400 Subject: [PATCH 02/39] feat(wip): snapshot api --- internal/ext/exporter.go | 4 +- internal/server/data/server.go | 167 +---- rpc/flipt/data/data.pb.go | 1053 ++++---------------------------- rpc/flipt/data/data.pb.gw.go | 189 ++++++ rpc/flipt/data/data.proto | 81 +-- rpc/flipt/data/data_grpc.pb.go | 74 +-- rpc/flipt/flipt.yaml | 3 + sdk/go/data.sdk.gen.go | 6 +- sdk/go/grpc/grpc.sdk.gen.go | 12 +- sdk/go/http/data.sdk.gen.go | 39 +- sdk/go/sdk.gen.go | 18 +- 11 files changed, 429 insertions(+), 1217 deletions(-) create mode 100644 rpc/flipt/data/data.pb.gw.go diff --git a/internal/ext/exporter.go b/internal/ext/exporter.go index 46d5df3015..cd7c531351 100644 --- a/internal/ext/exporter.go +++ b/internal/ext/exporter.go @@ -75,7 +75,7 @@ func (e *Exporter) Export(ctx context.Context, w io.Writer) error { intermediateNamespaces := make([]string, 0) - for batch := int32(0); remaining; batch++ { + for remaining { resp, err := e.store.ListNamespaces(ctx, &flipt.ListNamespaceRequest{ PageToken: nextPage, Limit: batchSize, @@ -246,7 +246,7 @@ func (e *Exporter) Export(ctx context.Context, w io.Writer) error { nextPage = "" // export segments/constraints in batches - for batch := int32(0); remaining; batch++ { + for remaining { resp, err := e.store.ListSegments( ctx, &flipt.ListSegmentRequest{ diff --git a/internal/server/data/server.go b/internal/server/data/server.go index ba3285a9c9..dc92952f9a 100644 --- a/internal/server/data/server.go +++ b/internal/server/data/server.go @@ -2,7 +2,6 @@ package data import ( "context" - "encoding/json" "fmt" "go.flipt.io/flipt/internal/storage" @@ -25,16 +24,19 @@ func NewServer(logger *zap.Logger, store storage.Store) *Server { } } -func (s *Server) Snapshot(ctx context.Context, r *data.NamespaceRequest) (*data.NamespaceResponse, error) { +func (s *Server) SnapshotNamespace(ctx context.Context, r *data.SnapshotNamespaceRequest) (*data.SnapshotNamespaceResponse, error) { var ( namespaceKey = r.Key - resp = &data.NamespaceResponse{} - remaining = true - nextPage string + resp = &data.SnapshotNamespaceResponse{ + Rules: make(map[string]*flipt.RuleList), + Rollouts: make(map[string]*flipt.RolloutList), + } + remaining = true + nextPage string ) // flags/variants in batches - for batch := int32(0); remaining; batch++ { + for remaining { res, err := s.store.ListFlags( ctx, namespaceKey, @@ -48,118 +50,33 @@ func (s *Server) Snapshot(ctx context.Context, r *data.NamespaceRequest) (*data. nextPage = res.NextPageToken remaining = nextPage != "" - for _, f := range flags { - flag := &data.Flag{ - Key: f.Key, - Name: f.Name, - Type: f.Type.String(), - Description: f.Description, - Enabled: f.Enabled, - } - - // map variant id => variant key - variantKeys := make(map[string]string) - - for _, v := range f.Variants { - var attachment interface{} - - if v.Attachment != "" { - if err := json.Unmarshal([]byte(v.Attachment), &attachment); err != nil { - return nil, fmt.Errorf("unmarshaling variant attachment: %w", err) - } - } - - flag.Variants = append(flag.Variants, &data.Variant{ - Key: v.Key, - Name: v.Name, - Description: v.Description, - Attachment: attachment, - }) - - variantKeys[v.Id] = v.Key - } + resp.Flags = flags + for _, f := range flags { // rules for flag - resp, err := e.store.ListRules( + rules, err := s.store.ListRules( ctx, - &flipt.ListRuleRequest{ - NamespaceKey: namespaces[i], - FlagKey: flag.Key, - }, + namespaceKey, + f.Key, ) if err != nil { - return fmt.Errorf("getting rules for flag %q: %w", flag.Key, err) + return nil, fmt.Errorf("getting rules for flag %q: %w", f.Key, err) } - rules := resp.Rules - for _, r := range rules { - rule := &Rule{} - - switch { - case r.SegmentKey != "": - rule.Segment = &SegmentEmbed{ - IsSegment: SegmentKey(r.SegmentKey), - } - case len(r.SegmentKeys) > 0: - rule.Segment = &SegmentEmbed{ - IsSegment: &Segments{ - Keys: r.SegmentKeys, - SegmentOperator: r.SegmentOperator.String(), - }, - } - default: - return fmt.Errorf("wrong format for rule segments") - } - - for _, d := range r.Distributions { - rule.Distributions = append(rule.Distributions, &Distribution{ - VariantKey: variantKeys[d.VariantId], - Rollout: d.Rollout, - }) - } - - flag.Rules = append(flag.Rules, rule) + resp.Rules[f.Key] = &flipt.RuleList{ + Rules: rules.Results, + TotalCount: int32(len(rules.Results)), } - rollouts, err := e.store.ListRollouts(ctx, &flipt.ListRolloutRequest{ - NamespaceKey: namespaces[i], - FlagKey: flag.Key, - }) + rollouts, err := s.store.ListRollouts(ctx, namespaceKey, f.Key) if err != nil { - return fmt.Errorf("getting rollout rules for flag %q: %w", flag.Key, err) + return nil, fmt.Errorf("getting rollout rules for flag %q: %w", f.Key, err) } - for _, r := range rollouts.Rules { - rollout := Rollout{ - Description: r.Description, - } - - switch rule := r.Rule.(type) { - case *flipt.Rollout_Segment: - rollout.Segment = &SegmentRule{ - Value: rule.Segment.Value, - } - - if rule.Segment.SegmentKey != "" { - rollout.Segment.Key = rule.Segment.SegmentKey - } else if len(rule.Segment.SegmentKeys) > 0 { - rollout.Segment.Keys = rule.Segment.SegmentKeys - } - - if rule.Segment.SegmentOperator == flipt.SegmentOperator_AND_SEGMENT_OPERATOR { - rollout.Segment.Operator = rule.Segment.SegmentOperator.String() - } - case *flipt.Rollout_Threshold: - rollout.Threshold = &ThresholdRule{ - Percentage: rule.Threshold.Percentage, - Value: rule.Threshold.Value, - } - } - - flag.Rollouts = append(flag.Rollouts, &rollout) + resp.Rollouts[f.Key] = &flipt.RolloutList{ + Rules: rollouts.Results, + TotalCount: int32(len(rollouts.Results)), } - - doc.Flags = append(doc.Flags, flag) } } @@ -167,44 +84,22 @@ func (s *Server) Snapshot(ctx context.Context, r *data.NamespaceRequest) (*data. nextPage = "" // segments/constraints in batches - for batch := int32(0); remaining; batch++ { - resp, err := e.store.ListSegments( + for remaining { + res, err := s.store.ListSegments( ctx, - &flipt.ListSegmentRequest{ - NamespaceKey: namespaces[i], - PageToken: nextPage, - Limit: batchSize, - }, + namespaceKey, + storage.WithPageToken(nextPage), ) if err != nil { - return fmt.Errorf("getting segments: %w", err) + return nil, fmt.Errorf("getting segments: %w", err) } - segments := resp.Segments - nextPage = resp.NextPageToken + segments := res.Results + nextPage = res.NextPageToken remaining = nextPage != "" - for _, s := range segments { - segment := &Segment{ - Key: s.Key, - Name: s.Name, - Description: s.Description, - MatchType: s.MatchType.String(), - } - - for _, c := range s.Constraints { - segment.Constraints = append(segment.Constraints, &Constraint{ - Type: c.Type.String(), - Property: c.Property, - Operator: c.Operator, - Value: c.Value, - Description: c.Description, - }) - } - - doc.Segments = append(doc.Segments, segment) - } + resp.Segments = append(resp.Segments, segments...) } - return nil, nil + return resp, nil } diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go index cad9a880f1..597cde106b 100644 --- a/rpc/flipt/data/data.pb.go +++ b/rpc/flipt/data/data.pb.go @@ -7,6 +7,7 @@ package data import ( + flipt "go.flipt.io/flipt/rpc/flipt" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,512 +21,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type Flag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` - Variants []*Variant `protobuf:"bytes,8,rep,name=variants,proto3" json:"variants,omitempty"` - Rules []*Rule `protobuf:"bytes,9,rep,name=rules,proto3" json:"rules,omitempty"` -} - -func (x *Flag) Reset() { - *x = Flag{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Flag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Flag) ProtoMessage() {} - -func (x *Flag) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Flag.ProtoReflect.Descriptor instead. -func (*Flag) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{0} -} - -func (x *Flag) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Flag) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Flag) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Flag) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *Flag) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Flag) GetVariants() []*Variant { - if x != nil { - return x.Variants - } - return nil -} - -func (x *Flag) GetRules() []*Rule { - if x != nil { - return x.Rules - } - return nil -} - -type Rule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Segments *Rule_SegmentsRule `protobuf:"bytes,1,opt,name=segments,proto3" json:"segments,omitempty"` - Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` - Distributions []*Distribution `protobuf:"bytes,3,rep,name=distributions,proto3" json:"distributions,omitempty"` -} - -func (x *Rule) Reset() { - *x = Rule{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rule) ProtoMessage() {} - -func (x *Rule) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rule.ProtoReflect.Descriptor instead. -func (*Rule) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{1} -} - -func (x *Rule) GetSegments() *Rule_SegmentsRule { - if x != nil { - return x.Segments - } - return nil -} - -func (x *Rule) GetRank() int32 { - if x != nil { - return x.Rank - } - return 0 -} - -func (x *Rule) GetDistributions() []*Distribution { - if x != nil { - return x.Distributions - } - return nil -} - -type Rollout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Segment *Rollout_SegmentsRollout `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` - Threshold *Rollout_ThresholdRollout `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` -} - -func (x *Rollout) Reset() { - *x = Rollout{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rollout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rollout) ProtoMessage() {} - -func (x *Rollout) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rollout.ProtoReflect.Descriptor instead. -func (*Rollout) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{2} -} - -func (x *Rollout) GetSegment() *Rollout_SegmentsRollout { - if x != nil { - return x.Segment - } - return nil -} - -func (x *Rollout) GetThreshold() *Rollout_ThresholdRollout { - if x != nil { - return x.Threshold - } - return nil -} - -func (x *Rollout) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -type Distribution struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - VariantKey string `protobuf:"bytes,1,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` - Rollout float32 `protobuf:"fixed32,2,opt,name=rollout,proto3" json:"rollout,omitempty"` -} - -func (x *Distribution) Reset() { - *x = Distribution{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Distribution) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Distribution) ProtoMessage() {} - -func (x *Distribution) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Distribution.ProtoReflect.Descriptor instead. -func (*Distribution) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{3} -} - -func (x *Distribution) GetVariantKey() string { - if x != nil { - return x.VariantKey - } - return "" -} - -func (x *Distribution) GetRollout() float32 { - if x != nil { - return x.Rollout - } - return 0 -} - -type Variant struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Attachment string `protobuf:"bytes,4,opt,name=attachment,proto3" json:"attachment,omitempty"` -} - -func (x *Variant) Reset() { - *x = Variant{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Variant) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Variant) ProtoMessage() {} - -func (x *Variant) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Variant.ProtoReflect.Descriptor instead. -func (*Variant) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{4} -} - -func (x *Variant) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Variant) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Variant) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Variant) GetAttachment() string { - if x != nil { - return x.Attachment - } - return "" -} - -type Segment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - MatchType string `protobuf:"bytes,4,opt,name=match_type,json=matchType,proto3" json:"match_type,omitempty"` - Constraints []*Constraint `protobuf:"bytes,5,rep,name=constraints,proto3" json:"constraints,omitempty"` -} - -func (x *Segment) Reset() { - *x = Segment{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Segment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Segment) ProtoMessage() {} - -func (x *Segment) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Segment.ProtoReflect.Descriptor instead. -func (*Segment) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{5} -} - -func (x *Segment) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Segment) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Segment) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Segment) GetMatchType() string { - if x != nil { - return x.MatchType - } - return "" -} - -func (x *Segment) GetConstraints() []*Constraint { - if x != nil { - return x.Constraints - } - return nil -} - -type Constraint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Property string `protobuf:"bytes,2,opt,name=property,proto3" json:"property,omitempty"` - Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` - Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` -} - -func (x *Constraint) Reset() { - *x = Constraint{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Constraint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Constraint) ProtoMessage() {} - -func (x *Constraint) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Constraint.ProtoReflect.Descriptor instead. -func (*Constraint) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{6} -} - -func (x *Constraint) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Constraint) GetProperty() string { - if x != nil { - return x.Property - } - return "" -} - -func (x *Constraint) GetOperator() string { - if x != nil { - return x.Operator - } - return "" -} - -func (x *Constraint) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Constraint) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -type NamespaceRequest struct { +type SnapshotNamespaceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -533,23 +29,23 @@ type NamespaceRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` } -func (x *NamespaceRequest) Reset() { - *x = NamespaceRequest{} +func (x *SnapshotNamespaceRequest) Reset() { + *x = SnapshotNamespaceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[7] + mi := &file_data_data_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NamespaceRequest) String() string { +func (x *SnapshotNamespaceRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NamespaceRequest) ProtoMessage() {} +func (*SnapshotNamespaceRequest) ProtoMessage() {} -func (x *NamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[7] +func (x *SnapshotNamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -560,45 +56,47 @@ func (x *NamespaceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use NamespaceRequest.ProtoReflect.Descriptor instead. -func (*NamespaceRequest) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{7} +// Deprecated: Use SnapshotNamespaceRequest.ProtoReflect.Descriptor instead. +func (*SnapshotNamespaceRequest) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{0} } -func (x *NamespaceRequest) GetKey() string { +func (x *SnapshotNamespaceRequest) GetKey() string { if x != nil { return x.Key } return "" } -type NamespaceResponse struct { +type SnapshotNamespaceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Flags []*Flag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` - Segments []*Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Flags []*flipt.Flag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` + Segments []*flipt.Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` + Rules map[string]*flipt.RuleList `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Rollouts map[string]*flipt.RolloutList `protobuf:"bytes,5,rep,name=rollouts,proto3" json:"rollouts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (x *NamespaceResponse) Reset() { - *x = NamespaceResponse{} +func (x *SnapshotNamespaceResponse) Reset() { + *x = SnapshotNamespaceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[8] + mi := &file_data_data_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NamespaceResponse) String() string { +func (x *SnapshotNamespaceResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NamespaceResponse) ProtoMessage() {} +func (*SnapshotNamespaceResponse) ProtoMessage() {} -func (x *NamespaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[8] +func (x *SnapshotNamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -609,310 +107,92 @@ func (x *NamespaceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use NamespaceResponse.ProtoReflect.Descriptor instead. -func (*NamespaceResponse) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{8} +// Deprecated: Use SnapshotNamespaceResponse.ProtoReflect.Descriptor instead. +func (*SnapshotNamespaceResponse) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{1} } -func (x *NamespaceResponse) GetKey() string { +func (x *SnapshotNamespaceResponse) GetKey() string { if x != nil { return x.Key } return "" } -func (x *NamespaceResponse) GetFlags() []*Flag { +func (x *SnapshotNamespaceResponse) GetFlags() []*flipt.Flag { if x != nil { return x.Flags } return nil } -func (x *NamespaceResponse) GetSegments() []*Segment { +func (x *SnapshotNamespaceResponse) GetSegments() []*flipt.Segment { if x != nil { return x.Segments } return nil } -type Rule_SegmentsRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` - SegmentOperator string `protobuf:"bytes,2,opt,name=segment_operator,json=segmentOperator,proto3" json:"segment_operator,omitempty"` -} - -func (x *Rule_SegmentsRule) Reset() { - *x = Rule_SegmentsRule{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rule_SegmentsRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rule_SegmentsRule) ProtoMessage() {} - -func (x *Rule_SegmentsRule) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rule_SegmentsRule.ProtoReflect.Descriptor instead. -func (*Rule_SegmentsRule) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *Rule_SegmentsRule) GetKeys() []string { +func (x *SnapshotNamespaceResponse) GetRules() map[string]*flipt.RuleList { if x != nil { - return x.Keys + return x.Rules } return nil } -func (x *Rule_SegmentsRule) GetSegmentOperator() string { - if x != nil { - return x.SegmentOperator - } - return "" -} - -type Rollout_SegmentsRollout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` - SegmentOperator string `protobuf:"bytes,2,opt,name=segment_operator,json=segmentOperator,proto3" json:"segment_operator,omitempty"` - Value bool `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Rollout_SegmentsRollout) Reset() { - *x = Rollout_SegmentsRollout{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rollout_SegmentsRollout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rollout_SegmentsRollout) ProtoMessage() {} - -func (x *Rollout_SegmentsRollout) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rollout_SegmentsRollout.ProtoReflect.Descriptor instead. -func (*Rollout_SegmentsRollout) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *Rollout_SegmentsRollout) GetKeys() []string { +func (x *SnapshotNamespaceResponse) GetRollouts() map[string]*flipt.RolloutList { if x != nil { - return x.Keys + return x.Rollouts } return nil } -func (x *Rollout_SegmentsRollout) GetSegmentOperator() string { - if x != nil { - return x.SegmentOperator - } - return "" -} - -func (x *Rollout_SegmentsRollout) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - -type Rollout_ThresholdRollout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` - Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Rollout_ThresholdRollout) Reset() { - *x = Rollout_ThresholdRollout{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rollout_ThresholdRollout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rollout_ThresholdRollout) ProtoMessage() {} - -func (x *Rollout_ThresholdRollout) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rollout_ThresholdRollout.ProtoReflect.Descriptor instead. -func (*Rollout_ThresholdRollout) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *Rollout_ThresholdRollout) GetPercentage() float32 { - if x != nil { - return x.Percentage - } - return 0 -} - -func (x *Rollout_ThresholdRollout) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - var File_data_data_proto protoreflect.FileDescriptor var file_data_data_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd5, 0x01, - 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x08, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x61, 0x72, 0x69, - 0x61, 0x6e, 0x74, 0x52, 0x08, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, - 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, - 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x39, - 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x75, - 0x6c, 0x65, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x52, - 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, - 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x3e, 0x0a, - 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4d, 0x0a, - 0x0c, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, - 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xe0, 0x02, 0x0a, - 0x07, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x2e, 0x53, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x07, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x2e, - 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, - 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x66, 0x0a, - 0x0f, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, - 0x6b, 0x65, 0x79, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x48, 0x0a, 0x10, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, - 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, - 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x49, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0x71, 0x0a, 0x07, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, - 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xaa, 0x01, - 0x0a, 0x07, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0a, 0x43, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a, - 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x22, 0x7e, 0x0a, 0x11, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x66, 0x6c, - 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, - 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x32, 0x4f, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x08, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0b, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x18, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0xb1, 0x03, 0x0a, 0x19, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x08, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x46, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, + 0x4f, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x33, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, + 0x1a, 0x49, 0x0a, 0x0a, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0d, 0x52, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x6f, 0x0a, 0x0b, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x11, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x22, 0x5a, + 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -927,38 +207,31 @@ func file_data_data_proto_rawDescGZIP() []byte { return file_data_data_proto_rawDescData } -var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_data_data_proto_goTypes = []interface{}{ - (*Flag)(nil), // 0: flipt.data.Flag - (*Rule)(nil), // 1: flipt.data.Rule - (*Rollout)(nil), // 2: flipt.data.Rollout - (*Distribution)(nil), // 3: flipt.data.Distribution - (*Variant)(nil), // 4: flipt.data.Variant - (*Segment)(nil), // 5: flipt.data.Segment - (*Constraint)(nil), // 6: flipt.data.Constraint - (*NamespaceRequest)(nil), // 7: flipt.data.NamespaceRequest - (*NamespaceResponse)(nil), // 8: flipt.data.NamespaceResponse - (*Rule_SegmentsRule)(nil), // 9: flipt.data.Rule.SegmentsRule - (*Rollout_SegmentsRollout)(nil), // 10: flipt.data.Rollout.SegmentsRollout - (*Rollout_ThresholdRollout)(nil), // 11: flipt.data.Rollout.ThresholdRollout + (*SnapshotNamespaceRequest)(nil), // 0: flipt.data.SnapshotNamespaceRequest + (*SnapshotNamespaceResponse)(nil), // 1: flipt.data.SnapshotNamespaceResponse + nil, // 2: flipt.data.SnapshotNamespaceResponse.RulesEntry + nil, // 3: flipt.data.SnapshotNamespaceResponse.RolloutsEntry + (*flipt.Flag)(nil), // 4: flipt.Flag + (*flipt.Segment)(nil), // 5: flipt.Segment + (*flipt.RuleList)(nil), // 6: flipt.RuleList + (*flipt.RolloutList)(nil), // 7: flipt.RolloutList } var file_data_data_proto_depIdxs = []int32{ - 4, // 0: flipt.data.Flag.variants:type_name -> flipt.data.Variant - 1, // 1: flipt.data.Flag.rules:type_name -> flipt.data.Rule - 9, // 2: flipt.data.Rule.segments:type_name -> flipt.data.Rule.SegmentsRule - 3, // 3: flipt.data.Rule.distributions:type_name -> flipt.data.Distribution - 10, // 4: flipt.data.Rollout.segment:type_name -> flipt.data.Rollout.SegmentsRollout - 11, // 5: flipt.data.Rollout.threshold:type_name -> flipt.data.Rollout.ThresholdRollout - 6, // 6: flipt.data.Segment.constraints:type_name -> flipt.data.Constraint - 0, // 7: flipt.data.NamespaceResponse.flags:type_name -> flipt.data.Flag - 5, // 8: flipt.data.NamespaceResponse.segments:type_name -> flipt.data.Segment - 7, // 9: flipt.data.Data.Snapshot:input_type -> flipt.data.NamespaceRequest - 8, // 10: flipt.data.Data.Snapshot:output_type -> flipt.data.NamespaceResponse - 10, // [10:11] is the sub-list for method output_type - 9, // [9:10] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 4, // 0: flipt.data.SnapshotNamespaceResponse.flags:type_name -> flipt.Flag + 5, // 1: flipt.data.SnapshotNamespaceResponse.segments:type_name -> flipt.Segment + 2, // 2: flipt.data.SnapshotNamespaceResponse.rules:type_name -> flipt.data.SnapshotNamespaceResponse.RulesEntry + 3, // 3: flipt.data.SnapshotNamespaceResponse.rollouts:type_name -> flipt.data.SnapshotNamespaceResponse.RolloutsEntry + 6, // 4: flipt.data.SnapshotNamespaceResponse.RulesEntry.value:type_name -> flipt.RuleList + 7, // 5: flipt.data.SnapshotNamespaceResponse.RolloutsEntry.value:type_name -> flipt.RolloutList + 0, // 6: flipt.data.DataService.SnapshotNamespace:input_type -> flipt.data.SnapshotNamespaceRequest + 1, // 7: flipt.data.DataService.SnapshotNamespace:output_type -> flipt.data.SnapshotNamespaceResponse + 7, // [7:8] is the sub-list for method output_type + 6, // [6:7] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_data_data_proto_init() } @@ -968,7 +241,7 @@ func file_data_data_proto_init() { } if !protoimpl.UnsafeEnabled { file_data_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Flag); i { + switch v := v.(*SnapshotNamespaceRequest); i { case 0: return &v.state case 1: @@ -980,127 +253,7 @@ func file_data_data_proto_init() { } } file_data_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rollout); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Distribution); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Variant); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Segment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Constraint); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamespaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamespaceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rule_SegmentsRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rollout_SegmentsRollout); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rollout_ThresholdRollout); i { + switch v := v.(*SnapshotNamespaceResponse); i { case 0: return &v.state case 1: @@ -1118,7 +271,7 @@ func file_data_data_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_data_data_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/flipt/data/data.pb.gw.go b/rpc/flipt/data/data.pb.gw.go new file mode 100644 index 0000000000..e436fb99be --- /dev/null +++ b/rpc/flipt/data/data.pb.gw.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: data/data.proto + +/* +Package data is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package data + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SnapshotNamespaceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + msg, err := client.SnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SnapshotNamespaceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + msg, err := server.SnapshotNamespace(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterDataServiceHandlerServer registers the http handlers for service DataService to "mux". +// UnaryRPC :call DataServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataServiceHandlerFromEndpoint instead. +func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error { + + mux.Handle("GET", pattern_DataService_SnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.data.DataService/SnapshotNamespace", runtime.WithHTTPPathPattern("/api/v1/namespaces/{key}/snapshot")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DataService_SnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataService_SnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterDataServiceHandlerFromEndpoint is same as RegisterDataServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterDataServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterDataServiceHandler(ctx, mux, conn) +} + +// RegisterDataServiceHandler registers the http handlers for service DataService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterDataServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterDataServiceHandlerClient(ctx, mux, NewDataServiceClient(conn)) +} + +// RegisterDataServiceHandlerClient registers the http handlers for service DataService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DataServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DataServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "DataServiceClient" to call the correct interceptors. +func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataServiceClient) error { + + mux.Handle("GET", pattern_DataService_SnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.data.DataService/SnapshotNamespace", runtime.WithHTTPPathPattern("/api/v1/namespaces/{key}/snapshot")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DataService_SnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataService_SnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_DataService_SnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "namespaces", "key", "snapshot"}, "")) +) + +var ( + forward_DataService_SnapshotNamespace_0 = runtime.ForwardResponseMessage +) diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto index 33d712e964..57a07ac354 100644 --- a/rpc/flipt/data/data.proto +++ b/rpc/flipt/data/data.proto @@ -2,83 +2,22 @@ syntax = "proto3"; package flipt.data; -option go_package = "go.flipt.io/flipt/rpc/flipt/data"; - -message Flag { - string key = 1; - string name = 2; - string description = 3; - bool enabled = 4; - string type = 5; - repeated Variant variants = 8; - repeated Rule rules = 9; -} - -message Rule { - message SegmentsRule { - repeated string keys = 1; - string segment_operator = 2; - } - SegmentsRule segments = 1; - int32 rank = 2; - repeated Distribution distributions = 3; -} - -message Rollout { - message SegmentsRollout { - repeated string keys = 1; - string segment_operator = 2; - bool value = 3; - } - message ThresholdRollout { - float percentage = 1; - bool value = 2; - } - SegmentsRollout segment = 1; - ThresholdRollout threshold = 2; - string description = 3; -} - -message Distribution { - string variant_key = 1; - float rollout = 2; -} +import "flipt.proto"; -message Variant { - string key = 1; - string name = 2; - string description = 3; - string attachment = 4; -} - -message Segment { - string key = 1; - string name = 2; - string description = 3; - string match_type = 4; - repeated Constraint constraints = 5; -} - -message Constraint { - string type = 1; - string property = 2; - string operator = 3; - string value = 4; - string description = 5; -} +option go_package = "go.flipt.io/flipt/rpc/flipt/data"; -message NamespaceRequest { +message SnapshotNamespaceRequest { string key = 1; - //int32 limit = 2; - //string page_token = 3; } -message NamespaceResponse { +message SnapshotNamespaceResponse { string key = 1; - repeated Flag flags = 2; - repeated Segment segments = 3; + repeated flipt.Flag flags = 2; + repeated flipt.Segment segments = 3; + map rules = 4; + map rollouts = 5; } -service Data { - rpc Snapshot(NamespaceRequest) returns (NamespaceResponse); +service DataService { + rpc SnapshotNamespace(SnapshotNamespaceRequest) returns (SnapshotNamespaceResponse); } diff --git a/rpc/flipt/data/data_grpc.pb.go b/rpc/flipt/data/data_grpc.pb.go index 8f4aa52f2f..5325e6773a 100644 --- a/rpc/flipt/data/data_grpc.pb.go +++ b/rpc/flipt/data/data_grpc.pb.go @@ -19,89 +19,89 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Data_Snapshot_FullMethodName = "/flipt.data.Data/Snapshot" + DataService_SnapshotNamespace_FullMethodName = "/flipt.data.DataService/SnapshotNamespace" ) -// DataClient is the client API for Data service. +// DataServiceClient is the client API for DataService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DataClient interface { - Snapshot(ctx context.Context, in *NamespaceRequest, opts ...grpc.CallOption) (*NamespaceResponse, error) +type DataServiceClient interface { + SnapshotNamespace(ctx context.Context, in *SnapshotNamespaceRequest, opts ...grpc.CallOption) (*SnapshotNamespaceResponse, error) } -type dataClient struct { +type dataServiceClient struct { cc grpc.ClientConnInterface } -func NewDataClient(cc grpc.ClientConnInterface) DataClient { - return &dataClient{cc} +func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient { + return &dataServiceClient{cc} } -func (c *dataClient) Snapshot(ctx context.Context, in *NamespaceRequest, opts ...grpc.CallOption) (*NamespaceResponse, error) { - out := new(NamespaceResponse) - err := c.cc.Invoke(ctx, Data_Snapshot_FullMethodName, in, out, opts...) +func (c *dataServiceClient) SnapshotNamespace(ctx context.Context, in *SnapshotNamespaceRequest, opts ...grpc.CallOption) (*SnapshotNamespaceResponse, error) { + out := new(SnapshotNamespaceResponse) + err := c.cc.Invoke(ctx, DataService_SnapshotNamespace_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -// DataServer is the server API for Data service. -// All implementations must embed UnimplementedDataServer +// DataServiceServer is the server API for DataService service. +// All implementations must embed UnimplementedDataServiceServer // for forward compatibility -type DataServer interface { - Snapshot(context.Context, *NamespaceRequest) (*NamespaceResponse, error) - mustEmbedUnimplementedDataServer() +type DataServiceServer interface { + SnapshotNamespace(context.Context, *SnapshotNamespaceRequest) (*SnapshotNamespaceResponse, error) + mustEmbedUnimplementedDataServiceServer() } -// UnimplementedDataServer must be embedded to have forward compatible implementations. -type UnimplementedDataServer struct { +// UnimplementedDataServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDataServiceServer struct { } -func (UnimplementedDataServer) Snapshot(context.Context, *NamespaceRequest) (*NamespaceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Snapshot not implemented") +func (UnimplementedDataServiceServer) SnapshotNamespace(context.Context, *SnapshotNamespaceRequest) (*SnapshotNamespaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SnapshotNamespace not implemented") } -func (UnimplementedDataServer) mustEmbedUnimplementedDataServer() {} +func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {} -// UnsafeDataServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DataServer will +// UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DataServiceServer will // result in compilation errors. -type UnsafeDataServer interface { - mustEmbedUnimplementedDataServer() +type UnsafeDataServiceServer interface { + mustEmbedUnimplementedDataServiceServer() } -func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) { - s.RegisterService(&Data_ServiceDesc, srv) +func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) { + s.RegisterService(&DataService_ServiceDesc, srv) } -func _Data_Snapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NamespaceRequest) +func _DataService_SnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SnapshotNamespaceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServer).Snapshot(ctx, in) + return srv.(DataServiceServer).SnapshotNamespace(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Data_Snapshot_FullMethodName, + FullMethod: DataService_SnapshotNamespace_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).Snapshot(ctx, req.(*NamespaceRequest)) + return srv.(DataServiceServer).SnapshotNamespace(ctx, req.(*SnapshotNamespaceRequest)) } return interceptor(ctx, in, info, handler) } -// Data_ServiceDesc is the grpc.ServiceDesc for Data service. +// DataService_ServiceDesc is the grpc.ServiceDesc for DataService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var Data_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "flipt.data.Data", - HandlerType: (*DataServer)(nil), +var DataService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipt.data.DataService", + HandlerType: (*DataServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Snapshot", - Handler: _Data_Snapshot_Handler, + MethodName: "SnapshotNamespace", + Handler: _DataService_SnapshotNamespace_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/rpc/flipt/flipt.yaml b/rpc/flipt/flipt.yaml index 49e96a99cc..c0650e58a2 100644 --- a/rpc/flipt/flipt.yaml +++ b/rpc/flipt/flipt.yaml @@ -23,6 +23,9 @@ http: - selector: flipt.Flipt.DeleteNamespace delete: /api/v1/namespaces/{key} + - selector: flipt.data.DataService.SnapshotNamespace + get: /api/v1/namespaces/{key}/snapshot + # evaluation # - selector: flipt.Flipt.Evaluate diff --git a/sdk/go/data.sdk.gen.go b/sdk/go/data.sdk.gen.go index 6e0ac6f213..71577f352b 100644 --- a/sdk/go/data.sdk.gen.go +++ b/sdk/go/data.sdk.gen.go @@ -8,14 +8,14 @@ import ( ) type Data struct { - transport data.DataClient + transport data.DataServiceClient tokenProvider ClientTokenProvider } -func (x *Data) Snapshot(ctx context.Context, v *data.NamespaceRequest) (*data.NamespaceResponse, error) { +func (x *Data) SnapshotNamespace(ctx context.Context, v *data.SnapshotNamespaceRequest) (*data.SnapshotNamespaceResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err } - return x.transport.Snapshot(ctx, v) + return x.transport.SnapshotNamespace(ctx, v) } diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index 89d95741a4..757b836741 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -54,16 +54,16 @@ func (t Transport) AuthClient() _go.AuthClient { return authClient{cc: t.cc} } -func (t Transport) DataClient() data.DataClient { - return data.NewDataClient(t.cc) +func (t Transport) FliptClient() flipt.FliptClient { + return flipt.NewFliptClient(t.cc) } -func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { - return evaluation.NewEvaluationServiceClient(t.cc) +func (t Transport) DataClient() data.DataServiceClient { + return data.NewDataServiceClient(t.cc) } -func (t Transport) FliptClient() flipt.FliptClient { - return flipt.NewFliptClient(t.cc) +func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { + return evaluation.NewEvaluationServiceClient(t.cc) } func (t Transport) MetaClient() meta.MetadataServiceClient { diff --git a/sdk/go/http/data.sdk.gen.go b/sdk/go/http/data.sdk.gen.go index e6fbf7982b..97f732a5cc 100644 --- a/sdk/go/http/data.sdk.gen.go +++ b/sdk/go/http/data.sdk.gen.go @@ -3,15 +3,48 @@ package http import ( + context "context" + fmt "fmt" data "go.flipt.io/flipt/rpc/flipt/data" + grpc "google.golang.org/grpc" + protojson "google.golang.org/protobuf/encoding/protojson" + io "io" http "net/http" + url "net/url" ) -type DataClient struct { +type DataServiceClient struct { client *http.Client addr string } -func (t Transport) DataClient() data.DataClient { - return &DataClient{client: t.client, addr: t.addr} +func (x *DataServiceClient) SnapshotNamespace(ctx context.Context, v *data.SnapshotNamespaceRequest, _ ...grpc.CallOption) (*data.SnapshotNamespaceResponse, error) { + var body io.Reader + var values url.Values + req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/api/v1/namespaces/%v/snapshot", v.Key), body) + if err != nil { + return nil, err + } + req.URL.RawQuery = values.Encode() + resp, err := x.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var output data.SnapshotNamespaceResponse + respData, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + if err := checkResponse(resp, respData); err != nil { + return nil, err + } + if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(respData, &output); err != nil { + return nil, err + } + return &output, nil +} + +func (t Transport) DataClient() data.DataServiceClient { + return &DataServiceClient{client: t.client, addr: t.addr} } diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index 04e5ef8ed9..3cc61abba0 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -13,9 +13,9 @@ import ( type Transport interface { AuthClient() AuthClient - DataClient() data.DataClient - EvaluationClient() evaluation.EvaluationServiceClient FliptClient() flipt.FliptClient + DataClient() data.DataServiceClient + EvaluationClient() evaluation.EvaluationServiceClient MetaClient() meta.MetadataServiceClient } @@ -75,6 +75,13 @@ func (s SDK) Auth() *Auth { } } +func (s SDK) Flipt() *Flipt { + return &Flipt{ + transport: s.transport.FliptClient(), + tokenProvider: s.tokenProvider, + } +} + func (s SDK) Data() *Data { return &Data{ transport: s.transport.DataClient(), @@ -89,13 +96,6 @@ func (s SDK) Evaluation() *Evaluation { } } -func (s SDK) Flipt() *Flipt { - return &Flipt{ - transport: s.transport.FliptClient(), - tokenProvider: s.tokenProvider, - } -} - func (s SDK) Meta() *Meta { return &Meta{ transport: s.transport.MetaClient(), From cfd794e8d690c7cf2682d3166bf928d23252c206 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Thu, 2 Nov 2023 14:44:44 -0400 Subject: [PATCH 03/39] feat: finish proto server --- internal/server/data/server.go | 196 ++++-- rpc/flipt/data/data.pb.go | 1058 +++++++++++++++++++++++++++++--- rpc/flipt/data/data.pb.gw.go | 32 +- rpc/flipt/data/data.proto | 79 ++- rpc/flipt/data/data_grpc.pb.go | 30 +- rpc/flipt/flipt.yaml | 9 +- sdk/go/data.sdk.gen.go | 4 +- sdk/go/http/data.sdk.gen.go | 6 +- 8 files changed, 1215 insertions(+), 199 deletions(-) diff --git a/internal/server/data/server.go b/internal/server/data/server.go index dc92952f9a..8940954d8d 100644 --- a/internal/server/data/server.go +++ b/internal/server/data/server.go @@ -10,34 +10,37 @@ import ( "go.uber.org/zap" ) +type EvaluationStore interface { + ListFlags(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Flag], error) + storage.EvaluationStore +} + type Server struct { logger *zap.Logger - store storage.Store + store EvaluationStore - data.UnimplementedDataServer + data.UnimplementedDataServiceServer } -func NewServer(logger *zap.Logger, store storage.Store) *Server { +func NewServer(logger *zap.Logger, store EvaluationStore) *Server { return &Server{ logger: logger, store: store, } } -func (s *Server) SnapshotNamespace(ctx context.Context, r *data.SnapshotNamespaceRequest) (*data.SnapshotNamespaceResponse, error) { +func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.EvaluationNamespaceSnapshotRequest) (*data.EvaluationNamespaceSnapshot, error) { var ( namespaceKey = r.Key - resp = &data.SnapshotNamespaceResponse{ - Rules: make(map[string]*flipt.RuleList), - Rollouts: make(map[string]*flipt.RolloutList), - } - remaining = true - nextPage string + resp = &data.EvaluationNamespaceSnapshot{} + remaining = true + nextPage string + segments = make(map[string]*data.EvaluationSegment) ) // flags/variants in batches for remaining { - res, err := s.store.ListFlags( + res, err := srv.store.ListFlags( ctx, namespaceKey, storage.WithPageToken(nextPage), @@ -50,55 +53,138 @@ func (s *Server) SnapshotNamespace(ctx context.Context, r *data.SnapshotNamespac nextPage = res.NextPageToken remaining = nextPage != "" - resp.Flags = flags - for _, f := range flags { - // rules for flag - rules, err := s.store.ListRules( - ctx, - namespaceKey, - f.Key, - ) - if err != nil { - return nil, fmt.Errorf("getting rules for flag %q: %w", f.Key, err) - } - - resp.Rules[f.Key] = &flipt.RuleList{ - Rules: rules.Results, - TotalCount: int32(len(rules.Results)), + flag := &data.EvaluationFlag{ + Key: f.Key, + Name: f.Name, + Description: f.Description, + Enabled: f.Enabled, + Type: f.Type, + CreatedAt: f.CreatedAt, + UpdatedAt: f.UpdatedAt, } - rollouts, err := s.store.ListRollouts(ctx, namespaceKey, f.Key) - if err != nil { - return nil, fmt.Errorf("getting rollout rules for flag %q: %w", f.Key, err) + if f.Type == flipt.FlagType_VARIANT_FLAG_TYPE { + rules, err := srv.store.GetEvaluationRules(ctx, namespaceKey, f.Key) + if err != nil { + return nil, fmt.Errorf("getting rules for flag %q: %w", f.Key, err) + } + + for _, r := range rules { + rule := &data.EvaluationRule{ + Id: r.ID, + Rank: r.Rank, + SegmentOperator: r.SegmentOperator, + } + + for _, s := range r.Segments { + // optimization: reuse segment if already seen + if ss, ok := segments[s.SegmentKey]; ok { + rule.Segments = append(rule.Segments, ss) + } else { + + ss := &data.EvaluationSegment{ + Key: s.SegmentKey, + MatchType: s.MatchType, + } + + for _, c := range s.Constraints { + ss.Constraints = append(ss.Constraints, &data.EvaluationConstraint{ + Id: c.ID, + Type: c.Type, + Property: c.Property, + Operator: c.Operator, + Value: c.Value, + }) + } + + segments[s.SegmentKey] = ss + rule.Segments = append(rule.Segments, ss) + } + + distributions, err := srv.store.GetEvaluationDistributions(ctx, r.ID) + if err != nil { + return nil, fmt.Errorf("getting distributions for rule %q: %w", r.ID, err) + } + + // distributions for rule + for _, d := range distributions { + dist := &data.EvaluationDistribution{ + VariantId: d.VariantID, + VariantKey: d.VariantKey, + VariantAttachment: d.VariantAttachment, + Rollout: d.Rollout, + } + rule.Distributions = append(rule.Distributions, dist) + } + + flag.Rules = append(flag.Rules, rule) + } + + } + + if f.Type == flipt.FlagType_BOOLEAN_FLAG_TYPE { + rollouts, err := srv.store.GetEvaluationRollouts(ctx, namespaceKey, f.Key) + if err != nil { + return nil, fmt.Errorf("getting rollout rules for flag %q: %w", f.Key, err) + } + + for _, r := range rollouts { + rollout := &data.EvaluationRollout{ + Type: r.RolloutType, + Rank: r.Rank, + } + + switch r.RolloutType { + case flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE: + rollout.Rule = &data.EvaluationRollout_Threshold{ + Threshold: &data.EvaluationRolloutThreshold{ + Percentage: r.Threshold.Percentage, + Value: r.Threshold.Value, + }, + } + + case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: + segment := &data.EvaluationRolloutSegment{ + Value: r.Segment.Value, + SegmentOperator: r.Segment.SegmentOperator, + } + + for _, s := range r.Segment.Segments { + // optimization: reuse segment if already seen + ss, ok := segments[s.SegmentKey] + if !ok { + ss := &data.EvaluationSegment{ + Key: s.SegmentKey, + MatchType: s.MatchType, + } + + for _, c := range s.Constraints { + ss.Constraints = append(ss.Constraints, &data.EvaluationConstraint{ + Id: c.ID, + Type: c.Type, + Property: c.Property, + Operator: c.Operator, + Value: c.Value, + }) + } + + segments[s.SegmentKey] = ss + } + + segment.Segments = append(segment.Segments, ss) + } + + rollout.Rule = &data.EvaluationRollout_Segment{ + Segment: segment, + } + } + + flag.Rollouts = append(flag.Rollouts, rollout) + } + } } - - resp.Rollouts[f.Key] = &flipt.RolloutList{ - Rules: rollouts.Results, - TotalCount: int32(len(rollouts.Results)), - } - } - } - - remaining = true - nextPage = "" - - // segments/constraints in batches - for remaining { - res, err := s.store.ListSegments( - ctx, - namespaceKey, - storage.WithPageToken(nextPage), - ) - if err != nil { - return nil, fmt.Errorf("getting segments: %w", err) } - - segments := res.Results - nextPage = res.NextPageToken - remaining = nextPage != "" - - resp.Segments = append(resp.Segments, segments...) } return resp, nil diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go index 597cde106b..eca03e9c2a 100644 --- a/rpc/flipt/data/data.pb.go +++ b/rpc/flipt/data/data.pb.go @@ -10,6 +10,7 @@ import ( flipt "go.flipt.io/flipt/rpc/flipt" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -21,16 +22,21 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type SnapshotNamespaceRequest struct { +type EvaluationDistribution struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + RuleId string `protobuf:"bytes,2,opt,name=ruleId,proto3" json:"ruleId,omitempty"` + VariantId string `protobuf:"bytes,3,opt,name=variantId,proto3" json:"variantId,omitempty"` + VariantKey string `protobuf:"bytes,4,opt,name=variantKey,proto3" json:"variantKey,omitempty"` + VariantAttachment string `protobuf:"bytes,5,opt,name=variantAttachment,proto3" json:"variantAttachment,omitempty"` + Rollout float32 `protobuf:"fixed32,6,opt,name=rollout,proto3" json:"rollout,omitempty"` } -func (x *SnapshotNamespaceRequest) Reset() { - *x = SnapshotNamespaceRequest{} +func (x *EvaluationDistribution) Reset() { + *x = EvaluationDistribution{} if protoimpl.UnsafeEnabled { mi := &file_data_data_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -38,13 +44,13 @@ func (x *SnapshotNamespaceRequest) Reset() { } } -func (x *SnapshotNamespaceRequest) String() string { +func (x *EvaluationDistribution) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SnapshotNamespaceRequest) ProtoMessage() {} +func (*EvaluationDistribution) ProtoMessage() {} -func (x *SnapshotNamespaceRequest) ProtoReflect() protoreflect.Message { +func (x *EvaluationDistribution) ProtoReflect() protoreflect.Message { mi := &file_data_data_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -56,32 +62,69 @@ func (x *SnapshotNamespaceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SnapshotNamespaceRequest.ProtoReflect.Descriptor instead. -func (*SnapshotNamespaceRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use EvaluationDistribution.ProtoReflect.Descriptor instead. +func (*EvaluationDistribution) Descriptor() ([]byte, []int) { return file_data_data_proto_rawDescGZIP(), []int{0} } -func (x *SnapshotNamespaceRequest) GetKey() string { +func (x *EvaluationDistribution) GetId() string { if x != nil { - return x.Key + return x.Id + } + return "" +} + +func (x *EvaluationDistribution) GetRuleId() string { + if x != nil { + return x.RuleId + } + return "" +} + +func (x *EvaluationDistribution) GetVariantId() string { + if x != nil { + return x.VariantId + } + return "" +} + +func (x *EvaluationDistribution) GetVariantKey() string { + if x != nil { + return x.VariantKey + } + return "" +} + +func (x *EvaluationDistribution) GetVariantAttachment() string { + if x != nil { + return x.VariantAttachment } return "" } -type SnapshotNamespaceResponse struct { +func (x *EvaluationDistribution) GetRollout() float32 { + if x != nil { + return x.Rollout + } + return 0 +} + +type EvaluationRollout struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Flags []*flipt.Flag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` - Segments []*flipt.Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` - Rules map[string]*flipt.RuleList `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Rollouts map[string]*flipt.RolloutList `protobuf:"bytes,5,rep,name=rollouts,proto3" json:"rollouts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Type flipt.RolloutType `protobuf:"varint,1,opt,name=type,proto3,enum=flipt.RolloutType" json:"type,omitempty"` + Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` + // Types that are assignable to Rule: + // + // *EvaluationRollout_Segment + // *EvaluationRollout_Threshold + Rule isEvaluationRollout_Rule `protobuf_oneof:"rule"` } -func (x *SnapshotNamespaceResponse) Reset() { - *x = SnapshotNamespaceResponse{} +func (x *EvaluationRollout) Reset() { + *x = EvaluationRollout{} if protoimpl.UnsafeEnabled { mi := &file_data_data_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -89,13 +132,13 @@ func (x *SnapshotNamespaceResponse) Reset() { } } -func (x *SnapshotNamespaceResponse) String() string { +func (x *EvaluationRollout) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SnapshotNamespaceResponse) ProtoMessage() {} +func (*EvaluationRollout) ProtoMessage() {} -func (x *SnapshotNamespaceResponse) ProtoReflect() protoreflect.Message { +func (x *EvaluationRollout) ProtoReflect() protoreflect.Message { mi := &file_data_data_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -107,92 +150,790 @@ func (x *SnapshotNamespaceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SnapshotNamespaceResponse.ProtoReflect.Descriptor instead. -func (*SnapshotNamespaceResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use EvaluationRollout.ProtoReflect.Descriptor instead. +func (*EvaluationRollout) Descriptor() ([]byte, []int) { return file_data_data_proto_rawDescGZIP(), []int{1} } -func (x *SnapshotNamespaceResponse) GetKey() string { +func (x *EvaluationRollout) GetType() flipt.RolloutType { + if x != nil { + return x.Type + } + return flipt.RolloutType(0) +} + +func (x *EvaluationRollout) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (m *EvaluationRollout) GetRule() isEvaluationRollout_Rule { + if m != nil { + return m.Rule + } + return nil +} + +func (x *EvaluationRollout) GetSegment() *EvaluationRolloutSegment { + if x, ok := x.GetRule().(*EvaluationRollout_Segment); ok { + return x.Segment + } + return nil +} + +func (x *EvaluationRollout) GetThreshold() *EvaluationRolloutThreshold { + if x, ok := x.GetRule().(*EvaluationRollout_Threshold); ok { + return x.Threshold + } + return nil +} + +type isEvaluationRollout_Rule interface { + isEvaluationRollout_Rule() +} + +type EvaluationRollout_Segment struct { + Segment *EvaluationRolloutSegment `protobuf:"bytes,3,opt,name=segment,proto3,oneof"` +} + +type EvaluationRollout_Threshold struct { + Threshold *EvaluationRolloutThreshold `protobuf:"bytes,4,opt,name=threshold,proto3,oneof"` +} + +func (*EvaluationRollout_Segment) isEvaluationRollout_Rule() {} + +func (*EvaluationRollout_Threshold) isEvaluationRollout_Rule() {} + +type EvaluationRolloutThreshold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` + Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EvaluationRolloutThreshold) Reset() { + *x = EvaluationRolloutThreshold{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRolloutThreshold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRolloutThreshold) ProtoMessage() {} + +func (x *EvaluationRolloutThreshold) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRolloutThreshold.ProtoReflect.Descriptor instead. +func (*EvaluationRolloutThreshold) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{2} +} + +func (x *EvaluationRolloutThreshold) GetPercentage() float32 { + if x != nil { + return x.Percentage + } + return 0 +} + +func (x *EvaluationRolloutThreshold) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +type EvaluationRolloutSegment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segmentOperator,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` +} + +func (x *EvaluationRolloutSegment) Reset() { + *x = EvaluationRolloutSegment{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRolloutSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRolloutSegment) ProtoMessage() {} + +func (x *EvaluationRolloutSegment) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRolloutSegment.ProtoReflect.Descriptor instead. +func (*EvaluationRolloutSegment) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{3} +} + +func (x *EvaluationRolloutSegment) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +func (x *EvaluationRolloutSegment) GetSegmentOperator() flipt.SegmentOperator { + if x != nil { + return x.SegmentOperator + } + return flipt.SegmentOperator(0) +} + +func (x *EvaluationRolloutSegment) GetSegments() []*EvaluationSegment { + if x != nil { + return x.Segments + } + return nil +} + +type EvaluationSegment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + MatchType flipt.MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=flipt.MatchType" json:"match_type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Constraints []*EvaluationConstraint `protobuf:"bytes,7,rep,name=constraints,proto3" json:"constraints,omitempty"` +} + +func (x *EvaluationSegment) Reset() { + *x = EvaluationSegment{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationSegment) ProtoMessage() {} + +func (x *EvaluationSegment) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationSegment.ProtoReflect.Descriptor instead. +func (*EvaluationSegment) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{4} +} + +func (x *EvaluationSegment) GetKey() string { if x != nil { return x.Key } return "" } -func (x *SnapshotNamespaceResponse) GetFlags() []*flipt.Flag { +func (x *EvaluationSegment) GetName() string { if x != nil { - return x.Flags + return x.Name + } + return "" +} + +func (x *EvaluationSegment) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *EvaluationSegment) GetMatchType() flipt.MatchType { + if x != nil { + return x.MatchType + } + return flipt.MatchType(0) +} + +func (x *EvaluationSegment) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt } return nil } -func (x *SnapshotNamespaceResponse) GetSegments() []*flipt.Segment { +func (x *EvaluationSegment) GetUpdatedAt() *timestamppb.Timestamp { if x != nil { - return x.Segments + return x.UpdatedAt } return nil } -func (x *SnapshotNamespaceResponse) GetRules() map[string]*flipt.RuleList { +func (x *EvaluationSegment) GetConstraints() []*EvaluationConstraint { + if x != nil { + return x.Constraints + } + return nil +} + +type EvaluationFlag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` + Type flipt.FlagType `protobuf:"varint,5,opt,name=type,proto3,enum=flipt.FlagType" json:"type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Rules []*EvaluationRule `protobuf:"bytes,8,rep,name=rules,proto3" json:"rules,omitempty"` + Rollouts []*EvaluationRollout `protobuf:"bytes,9,rep,name=rollouts,proto3" json:"rollouts,omitempty"` +} + +func (x *EvaluationFlag) Reset() { + *x = EvaluationFlag{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationFlag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationFlag) ProtoMessage() {} + +func (x *EvaluationFlag) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationFlag.ProtoReflect.Descriptor instead. +func (*EvaluationFlag) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{5} +} + +func (x *EvaluationFlag) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EvaluationFlag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EvaluationFlag) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *EvaluationFlag) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *EvaluationFlag) GetType() flipt.FlagType { + if x != nil { + return x.Type + } + return flipt.FlagType(0) +} + +func (x *EvaluationFlag) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *EvaluationFlag) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *EvaluationFlag) GetRules() []*EvaluationRule { if x != nil { return x.Rules } return nil } -func (x *SnapshotNamespaceResponse) GetRollouts() map[string]*flipt.RolloutList { +func (x *EvaluationFlag) GetRollouts() []*EvaluationRollout { if x != nil { return x.Rollouts } return nil } +type EvaluationConstraint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type flipt.ComparisonType `protobuf:"varint,2,opt,name=type,proto3,enum=flipt.ComparisonType" json:"type,omitempty"` + Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"` + Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EvaluationConstraint) Reset() { + *x = EvaluationConstraint{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationConstraint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationConstraint) ProtoMessage() {} + +func (x *EvaluationConstraint) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationConstraint.ProtoReflect.Descriptor instead. +func (*EvaluationConstraint) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{6} +} + +func (x *EvaluationConstraint) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationConstraint) GetType() flipt.ComparisonType { + if x != nil { + return x.Type + } + return flipt.ComparisonType(0) +} + +func (x *EvaluationConstraint) GetProperty() string { + if x != nil { + return x.Property + } + return "" +} + +func (x *EvaluationConstraint) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *EvaluationConstraint) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type EvaluationRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,2,rep,name=segments,proto3" json:"segments,omitempty"` + Rank int32 `protobuf:"varint,3,opt,name=rank,proto3" json:"rank,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,4,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` + Distributions []*EvaluationDistribution `protobuf:"bytes,5,rep,name=distributions,proto3" json:"distributions,omitempty"` +} + +func (x *EvaluationRule) Reset() { + *x = EvaluationRule{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRule) ProtoMessage() {} + +func (x *EvaluationRule) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRule.ProtoReflect.Descriptor instead. +func (*EvaluationRule) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{7} +} + +func (x *EvaluationRule) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationRule) GetSegments() []*EvaluationSegment { + if x != nil { + return x.Segments + } + return nil +} + +func (x *EvaluationRule) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *EvaluationRule) GetSegmentOperator() flipt.SegmentOperator { + if x != nil { + return x.SegmentOperator + } + return flipt.SegmentOperator(0) +} + +func (x *EvaluationRule) GetDistributions() []*EvaluationDistribution { + if x != nil { + return x.Distributions + } + return nil +} + +type EvaluationNamespaceSnapshot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace *flipt.Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Flags []*EvaluationFlag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` +} + +func (x *EvaluationNamespaceSnapshot) Reset() { + *x = EvaluationNamespaceSnapshot{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespaceSnapshot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespaceSnapshot) ProtoMessage() {} + +func (x *EvaluationNamespaceSnapshot) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespaceSnapshot.ProtoReflect.Descriptor instead. +func (*EvaluationNamespaceSnapshot) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{8} +} + +func (x *EvaluationNamespaceSnapshot) GetNamespace() *flipt.Namespace { + if x != nil { + return x.Namespace + } + return nil +} + +func (x *EvaluationNamespaceSnapshot) GetFlags() []*EvaluationFlag { + if x != nil { + return x.Flags + } + return nil +} + +type EvaluationNamespaceSnapshotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *EvaluationNamespaceSnapshotRequest) Reset() { + *x = EvaluationNamespaceSnapshotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespaceSnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespaceSnapshotRequest) ProtoMessage() {} + +func (x *EvaluationNamespaceSnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespaceSnapshotRequest.ProtoReflect.Descriptor instead. +func (*EvaluationNamespaceSnapshotRequest) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{9} +} + +func (x *EvaluationNamespaceSnapshotRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + var File_data_data_proto protoreflect.FileDescriptor var file_data_data_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0b, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x18, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0xb1, 0x03, 0x0a, 0x19, 0x53, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x08, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x46, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x75, - 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, - 0x4f, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x33, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, - 0x1a, 0x49, 0x0a, 0x0a, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0d, 0x52, - 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x6f, 0x0a, 0x0b, - 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x11, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x22, 0x5a, - 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, - 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x16, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, + 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x11, + 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, + 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, + 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, + 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, + 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xad, 0x01, 0x0a, + 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, + 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x40, 0x0a, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xc6, 0x02, 0x0a, + 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, + 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, + 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, + 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, + 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, 0x0a, 0x0d, 0x64, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, + 0x6c, 0x61, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x32, 0x85, 0x01, 0x0a, + 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x1b, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -207,31 +948,54 @@ func file_data_data_proto_rawDescGZIP() []byte { return file_data_data_proto_rawDescData } -var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_data_data_proto_goTypes = []interface{}{ - (*SnapshotNamespaceRequest)(nil), // 0: flipt.data.SnapshotNamespaceRequest - (*SnapshotNamespaceResponse)(nil), // 1: flipt.data.SnapshotNamespaceResponse - nil, // 2: flipt.data.SnapshotNamespaceResponse.RulesEntry - nil, // 3: flipt.data.SnapshotNamespaceResponse.RolloutsEntry - (*flipt.Flag)(nil), // 4: flipt.Flag - (*flipt.Segment)(nil), // 5: flipt.Segment - (*flipt.RuleList)(nil), // 6: flipt.RuleList - (*flipt.RolloutList)(nil), // 7: flipt.RolloutList + (*EvaluationDistribution)(nil), // 0: flipt.data.EvaluationDistribution + (*EvaluationRollout)(nil), // 1: flipt.data.EvaluationRollout + (*EvaluationRolloutThreshold)(nil), // 2: flipt.data.EvaluationRolloutThreshold + (*EvaluationRolloutSegment)(nil), // 3: flipt.data.EvaluationRolloutSegment + (*EvaluationSegment)(nil), // 4: flipt.data.EvaluationSegment + (*EvaluationFlag)(nil), // 5: flipt.data.EvaluationFlag + (*EvaluationConstraint)(nil), // 6: flipt.data.EvaluationConstraint + (*EvaluationRule)(nil), // 7: flipt.data.EvaluationRule + (*EvaluationNamespaceSnapshot)(nil), // 8: flipt.data.EvaluationNamespaceSnapshot + (*EvaluationNamespaceSnapshotRequest)(nil), // 9: flipt.data.EvaluationNamespaceSnapshotRequest + (flipt.RolloutType)(0), // 10: flipt.RolloutType + (flipt.SegmentOperator)(0), // 11: flipt.SegmentOperator + (flipt.MatchType)(0), // 12: flipt.MatchType + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (flipt.FlagType)(0), // 14: flipt.FlagType + (flipt.ComparisonType)(0), // 15: flipt.ComparisonType + (*flipt.Namespace)(nil), // 16: flipt.Namespace } var file_data_data_proto_depIdxs = []int32{ - 4, // 0: flipt.data.SnapshotNamespaceResponse.flags:type_name -> flipt.Flag - 5, // 1: flipt.data.SnapshotNamespaceResponse.segments:type_name -> flipt.Segment - 2, // 2: flipt.data.SnapshotNamespaceResponse.rules:type_name -> flipt.data.SnapshotNamespaceResponse.RulesEntry - 3, // 3: flipt.data.SnapshotNamespaceResponse.rollouts:type_name -> flipt.data.SnapshotNamespaceResponse.RolloutsEntry - 6, // 4: flipt.data.SnapshotNamespaceResponse.RulesEntry.value:type_name -> flipt.RuleList - 7, // 5: flipt.data.SnapshotNamespaceResponse.RolloutsEntry.value:type_name -> flipt.RolloutList - 0, // 6: flipt.data.DataService.SnapshotNamespace:input_type -> flipt.data.SnapshotNamespaceRequest - 1, // 7: flipt.data.DataService.SnapshotNamespace:output_type -> flipt.data.SnapshotNamespaceResponse - 7, // [7:8] is the sub-list for method output_type - 6, // [6:7] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 10, // 0: flipt.data.EvaluationRollout.type:type_name -> flipt.RolloutType + 3, // 1: flipt.data.EvaluationRollout.segment:type_name -> flipt.data.EvaluationRolloutSegment + 2, // 2: flipt.data.EvaluationRollout.threshold:type_name -> flipt.data.EvaluationRolloutThreshold + 11, // 3: flipt.data.EvaluationRolloutSegment.segmentOperator:type_name -> flipt.SegmentOperator + 4, // 4: flipt.data.EvaluationRolloutSegment.segments:type_name -> flipt.data.EvaluationSegment + 12, // 5: flipt.data.EvaluationSegment.match_type:type_name -> flipt.MatchType + 13, // 6: flipt.data.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp + 13, // 7: flipt.data.EvaluationSegment.updated_at:type_name -> google.protobuf.Timestamp + 6, // 8: flipt.data.EvaluationSegment.constraints:type_name -> flipt.data.EvaluationConstraint + 14, // 9: flipt.data.EvaluationFlag.type:type_name -> flipt.FlagType + 13, // 10: flipt.data.EvaluationFlag.created_at:type_name -> google.protobuf.Timestamp + 13, // 11: flipt.data.EvaluationFlag.updated_at:type_name -> google.protobuf.Timestamp + 7, // 12: flipt.data.EvaluationFlag.rules:type_name -> flipt.data.EvaluationRule + 1, // 13: flipt.data.EvaluationFlag.rollouts:type_name -> flipt.data.EvaluationRollout + 15, // 14: flipt.data.EvaluationConstraint.type:type_name -> flipt.ComparisonType + 4, // 15: flipt.data.EvaluationRule.segments:type_name -> flipt.data.EvaluationSegment + 11, // 16: flipt.data.EvaluationRule.segment_operator:type_name -> flipt.SegmentOperator + 0, // 17: flipt.data.EvaluationRule.distributions:type_name -> flipt.data.EvaluationDistribution + 16, // 18: flipt.data.EvaluationNamespaceSnapshot.namespace:type_name -> flipt.Namespace + 5, // 19: flipt.data.EvaluationNamespaceSnapshot.flags:type_name -> flipt.data.EvaluationFlag + 9, // 20: flipt.data.DataService.EvaluationSnapshotNamespace:input_type -> flipt.data.EvaluationNamespaceSnapshotRequest + 8, // 21: flipt.data.DataService.EvaluationSnapshotNamespace:output_type -> flipt.data.EvaluationNamespaceSnapshot + 21, // [21:22] is the sub-list for method output_type + 20, // [20:21] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_data_data_proto_init() } @@ -241,7 +1005,7 @@ func file_data_data_proto_init() { } if !protoimpl.UnsafeEnabled { file_data_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SnapshotNamespaceRequest); i { + switch v := v.(*EvaluationDistribution); i { case 0: return &v.state case 1: @@ -253,7 +1017,7 @@ func file_data_data_proto_init() { } } file_data_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SnapshotNamespaceResponse); i { + switch v := v.(*EvaluationRollout); i { case 0: return &v.state case 1: @@ -264,6 +1028,106 @@ func file_data_data_proto_init() { return nil } } + file_data_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRolloutThreshold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRolloutSegment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationSegment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationFlag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationConstraint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_data_data_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*EvaluationRollout_Segment)(nil), + (*EvaluationRollout_Threshold)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -271,7 +1135,7 @@ func file_data_data_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_data_data_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/flipt/data/data.pb.gw.go b/rpc/flipt/data/data.pb.gw.go index e436fb99be..b03150d6bd 100644 --- a/rpc/flipt/data/data.pb.gw.go +++ b/rpc/flipt/data/data.pb.gw.go @@ -31,8 +31,8 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = metadata.Join -func request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SnapshotNamespaceRequest +func request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EvaluationNamespaceSnapshotRequest var metadata runtime.ServerMetadata var ( @@ -52,13 +52,13 @@ func request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runt return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) } - msg, err := client.SnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.EvaluationSnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SnapshotNamespaceRequest +func local_request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EvaluationNamespaceSnapshotRequest var metadata runtime.ServerMetadata var ( @@ -78,7 +78,7 @@ func local_request_DataService_SnapshotNamespace_0(ctx context.Context, marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) } - msg, err := server.SnapshotNamespace(ctx, &protoReq) + msg, err := server.EvaluationSnapshotNamespace(ctx, &protoReq) return msg, metadata, err } @@ -89,7 +89,7 @@ func local_request_DataService_SnapshotNamespace_0(ctx context.Context, marshale // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataServiceHandlerFromEndpoint instead. func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error { - mux.Handle("GET", pattern_DataService_SnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -97,12 +97,12 @@ func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.data.DataService/SnapshotNamespace", runtime.WithHTTPPathPattern("/api/v1/namespaces/{key}/snapshot")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.data.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_DataService_SnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -110,7 +110,7 @@ func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_DataService_SnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -155,25 +155,25 @@ func RegisterDataServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // "DataServiceClient" to call the correct interceptors. func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataServiceClient) error { - mux.Handle("GET", pattern_DataService_SnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.data.DataService/SnapshotNamespace", runtime.WithHTTPPathPattern("/api/v1/namespaces/{key}/snapshot")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.data.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_DataService_SnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_DataService_SnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -181,9 +181,9 @@ func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux } var ( - pattern_DataService_SnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "namespaces", "key", "snapshot"}, "")) + pattern_DataService_EvaluationSnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"internal", "v1", "evaluation", "snapshot", "namespace", "key"}, "")) ) var ( - forward_DataService_SnapshotNamespace_0 = runtime.ForwardResponseMessage + forward_DataService_EvaluationSnapshotNamespace_0 = runtime.ForwardResponseMessage ) diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto index 57a07ac354..57b464ef0d 100644 --- a/rpc/flipt/data/data.proto +++ b/rpc/flipt/data/data.proto @@ -3,21 +3,86 @@ syntax = "proto3"; package flipt.data; import "flipt.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "go.flipt.io/flipt/rpc/flipt/data"; -message SnapshotNamespaceRequest { +message EvaluationDistribution { + string id = 1; + string ruleId = 2; + string variantId = 3; + string variantKey = 4; + string variantAttachment = 5; + float rollout = 6; +} + +message EvaluationRollout { + flipt.RolloutType type = 1; + int32 rank = 2; + oneof rule { + EvaluationRolloutSegment segment = 3; + EvaluationRolloutThreshold threshold = 4; + } +} + +message EvaluationRolloutThreshold { + float percentage = 1; + bool value = 2; +} + +message EvaluationRolloutSegment { + bool value = 1; + flipt.SegmentOperator segmentOperator = 2; + repeated EvaluationSegment segments = 3; +} + +message EvaluationSegment { string key = 1; + string name = 2; + string description = 3; + flipt.MatchType match_type = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + repeated EvaluationConstraint constraints = 7; +} + +message EvaluationFlag { + string key = 1; + string name = 2; + string description = 3; + bool enabled = 4; + flipt.FlagType type = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; + repeated EvaluationRule rules = 8; + repeated EvaluationRollout rollouts = 9; +} + +message EvaluationConstraint { + string id = 1; + flipt.ComparisonType type = 2; + string property = 3; + string operator = 4; + string value = 5; +} + +message EvaluationRule { + string id = 1; + repeated EvaluationSegment segments = 2; + int32 rank = 3; + flipt.SegmentOperator segment_operator = 4; + repeated EvaluationDistribution distributions = 5; +} + +message EvaluationNamespaceSnapshot { + flipt.Namespace namespace = 1; + repeated EvaluationFlag flags = 2; } -message SnapshotNamespaceResponse { +message EvaluationNamespaceSnapshotRequest { string key = 1; - repeated flipt.Flag flags = 2; - repeated flipt.Segment segments = 3; - map rules = 4; - map rollouts = 5; } service DataService { - rpc SnapshotNamespace(SnapshotNamespaceRequest) returns (SnapshotNamespaceResponse); + rpc EvaluationSnapshotNamespace(EvaluationNamespaceSnapshotRequest) returns (EvaluationNamespaceSnapshot); } diff --git a/rpc/flipt/data/data_grpc.pb.go b/rpc/flipt/data/data_grpc.pb.go index 5325e6773a..ebcb431a77 100644 --- a/rpc/flipt/data/data_grpc.pb.go +++ b/rpc/flipt/data/data_grpc.pb.go @@ -19,14 +19,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - DataService_SnapshotNamespace_FullMethodName = "/flipt.data.DataService/SnapshotNamespace" + DataService_EvaluationSnapshotNamespace_FullMethodName = "/flipt.data.DataService/EvaluationSnapshotNamespace" ) // DataServiceClient is the client API for DataService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type DataServiceClient interface { - SnapshotNamespace(ctx context.Context, in *SnapshotNamespaceRequest, opts ...grpc.CallOption) (*SnapshotNamespaceResponse, error) + EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) } type dataServiceClient struct { @@ -37,9 +37,9 @@ func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient { return &dataServiceClient{cc} } -func (c *dataServiceClient) SnapshotNamespace(ctx context.Context, in *SnapshotNamespaceRequest, opts ...grpc.CallOption) (*SnapshotNamespaceResponse, error) { - out := new(SnapshotNamespaceResponse) - err := c.cc.Invoke(ctx, DataService_SnapshotNamespace_FullMethodName, in, out, opts...) +func (c *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) { + out := new(EvaluationNamespaceSnapshot) + err := c.cc.Invoke(ctx, DataService_EvaluationSnapshotNamespace_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -50,7 +50,7 @@ func (c *dataServiceClient) SnapshotNamespace(ctx context.Context, in *SnapshotN // All implementations must embed UnimplementedDataServiceServer // for forward compatibility type DataServiceServer interface { - SnapshotNamespace(context.Context, *SnapshotNamespaceRequest) (*SnapshotNamespaceResponse, error) + EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) mustEmbedUnimplementedDataServiceServer() } @@ -58,8 +58,8 @@ type DataServiceServer interface { type UnimplementedDataServiceServer struct { } -func (UnimplementedDataServiceServer) SnapshotNamespace(context.Context, *SnapshotNamespaceRequest) (*SnapshotNamespaceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SnapshotNamespace not implemented") +func (UnimplementedDataServiceServer) EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) { + return nil, status.Errorf(codes.Unimplemented, "method EvaluationSnapshotNamespace not implemented") } func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {} @@ -74,20 +74,20 @@ func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) { s.RegisterService(&DataService_ServiceDesc, srv) } -func _DataService_SnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SnapshotNamespaceRequest) +func _DataService_EvaluationSnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EvaluationNamespaceSnapshotRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServiceServer).SnapshotNamespace(ctx, in) + return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DataService_SnapshotNamespace_FullMethodName, + FullMethod: DataService_EvaluationSnapshotNamespace_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServiceServer).SnapshotNamespace(ctx, req.(*SnapshotNamespaceRequest)) + return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, req.(*EvaluationNamespaceSnapshotRequest)) } return interceptor(ctx, in, info, handler) } @@ -100,8 +100,8 @@ var DataService_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*DataServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "SnapshotNamespace", - Handler: _DataService_SnapshotNamespace_Handler, + MethodName: "EvaluationSnapshotNamespace", + Handler: _DataService_EvaluationSnapshotNamespace_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/rpc/flipt/flipt.yaml b/rpc/flipt/flipt.yaml index c0650e58a2..ebad8489a0 100644 --- a/rpc/flipt/flipt.yaml +++ b/rpc/flipt/flipt.yaml @@ -23,9 +23,6 @@ http: - selector: flipt.Flipt.DeleteNamespace delete: /api/v1/namespaces/{key} - - selector: flipt.data.DataService.SnapshotNamespace - get: /api/v1/namespaces/{key}/snapshot - # evaluation # - selector: flipt.Flipt.Evaluate @@ -313,4 +310,8 @@ http: - selector: flipt.auth.AuthenticationMethodGithubService.AuthorizeURL get: /auth/v1/method/github/authorize - selector: flipt.auth.AuthenticationMethodGithubService.Callback - get: /auth/v1/method/github/callback \ No newline at end of file + get: /auth/v1/method/github/callback + + # internal routes + - selector: flipt.data.DataService.EvaluationSnapshotNamespace + get: /internal/v1/evaluation/snapshot/namespace/{key} \ No newline at end of file diff --git a/sdk/go/data.sdk.gen.go b/sdk/go/data.sdk.gen.go index 71577f352b..81c68d3966 100644 --- a/sdk/go/data.sdk.gen.go +++ b/sdk/go/data.sdk.gen.go @@ -12,10 +12,10 @@ type Data struct { tokenProvider ClientTokenProvider } -func (x *Data) SnapshotNamespace(ctx context.Context, v *data.SnapshotNamespaceRequest) (*data.SnapshotNamespaceResponse, error) { +func (x *Data) EvaluationSnapshotNamespace(ctx context.Context, v *data.EvaluationNamespaceSnapshotRequest) (*data.EvaluationNamespaceSnapshot, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err } - return x.transport.SnapshotNamespace(ctx, v) + return x.transport.EvaluationSnapshotNamespace(ctx, v) } diff --git a/sdk/go/http/data.sdk.gen.go b/sdk/go/http/data.sdk.gen.go index 97f732a5cc..57efda9d31 100644 --- a/sdk/go/http/data.sdk.gen.go +++ b/sdk/go/http/data.sdk.gen.go @@ -18,10 +18,10 @@ type DataServiceClient struct { addr string } -func (x *DataServiceClient) SnapshotNamespace(ctx context.Context, v *data.SnapshotNamespaceRequest, _ ...grpc.CallOption) (*data.SnapshotNamespaceResponse, error) { +func (x *DataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, v *data.EvaluationNamespaceSnapshotRequest, _ ...grpc.CallOption) (*data.EvaluationNamespaceSnapshot, error) { var body io.Reader var values url.Values - req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/api/v1/namespaces/%v/snapshot", v.Key), body) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/internal/v1/evaluation/snapshot/namespace/%v", v.Key), body) if err != nil { return nil, err } @@ -31,7 +31,7 @@ func (x *DataServiceClient) SnapshotNamespace(ctx context.Context, v *data.Snaps return nil, err } defer resp.Body.Close() - var output data.SnapshotNamespaceResponse + var output data.EvaluationNamespaceSnapshot respData, err := io.ReadAll(resp.Body) if err != nil { return nil, err From 67c14001abf4d0dc9393ca7a5bd96065fa9bdbb9 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:59:57 -0400 Subject: [PATCH 04/39] chore: fix linter errors --- rpc/flipt/data/data.pb.go | 273 +++++++++++++++++++------------------- rpc/flipt/data/data.proto | 10 +- 2 files changed, 142 insertions(+), 141 deletions(-) diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go index eca03e9c2a..0f9608c8e4 100644 --- a/rpc/flipt/data/data.pb.go +++ b/rpc/flipt/data/data.pb.go @@ -28,10 +28,10 @@ type EvaluationDistribution struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - RuleId string `protobuf:"bytes,2,opt,name=ruleId,proto3" json:"ruleId,omitempty"` - VariantId string `protobuf:"bytes,3,opt,name=variantId,proto3" json:"variantId,omitempty"` - VariantKey string `protobuf:"bytes,4,opt,name=variantKey,proto3" json:"variantKey,omitempty"` - VariantAttachment string `protobuf:"bytes,5,opt,name=variantAttachment,proto3" json:"variantAttachment,omitempty"` + RuleId string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` + VariantId string `protobuf:"bytes,3,opt,name=variant_id,json=variantId,proto3" json:"variant_id,omitempty"` + VariantKey string `protobuf:"bytes,4,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` + VariantAttachment string `protobuf:"bytes,5,opt,name=variant_attachment,json=variantAttachment,proto3" json:"variant_attachment,omitempty"` Rollout float32 `protobuf:"fixed32,6,opt,name=rollout,proto3" json:"rollout,omitempty"` } @@ -267,7 +267,7 @@ type EvaluationRolloutSegment struct { unknownFields protoimpl.UnknownFields Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segmentOperator,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` } @@ -797,143 +797,144 @@ var file_data_data_proto_rawDesc = []byte{ 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0b, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x16, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x01, 0x0a, 0x16, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1c, - 0x0a, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x11, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, - 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, - 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, - 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, - 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x66, 0x6c, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, + 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x26, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, - 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xad, 0x01, 0x0a, - 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, - 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x40, 0x0a, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xc6, 0x02, 0x0a, - 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x09, + 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, + 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, + 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0xae, 0x01, 0x0a, 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0xc6, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, - 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, + 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x0e, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, - 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, - 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, + 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, 0x0a, 0x0d, 0x64, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, - 0x6c, 0x61, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x32, 0x85, 0x01, 0x0a, - 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x1b, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x08, + 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x08, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, + 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, + 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x32, 0x85, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x76, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x2e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, + 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -972,7 +973,7 @@ var file_data_data_proto_depIdxs = []int32{ 10, // 0: flipt.data.EvaluationRollout.type:type_name -> flipt.RolloutType 3, // 1: flipt.data.EvaluationRollout.segment:type_name -> flipt.data.EvaluationRolloutSegment 2, // 2: flipt.data.EvaluationRollout.threshold:type_name -> flipt.data.EvaluationRolloutThreshold - 11, // 3: flipt.data.EvaluationRolloutSegment.segmentOperator:type_name -> flipt.SegmentOperator + 11, // 3: flipt.data.EvaluationRolloutSegment.segment_operator:type_name -> flipt.SegmentOperator 4, // 4: flipt.data.EvaluationRolloutSegment.segments:type_name -> flipt.data.EvaluationSegment 12, // 5: flipt.data.EvaluationSegment.match_type:type_name -> flipt.MatchType 13, // 6: flipt.data.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto index 57b464ef0d..e275ae318a 100644 --- a/rpc/flipt/data/data.proto +++ b/rpc/flipt/data/data.proto @@ -9,10 +9,10 @@ option go_package = "go.flipt.io/flipt/rpc/flipt/data"; message EvaluationDistribution { string id = 1; - string ruleId = 2; - string variantId = 3; - string variantKey = 4; - string variantAttachment = 5; + string rule_id = 2; + string variant_id = 3; + string variant_key = 4; + string variant_attachment = 5; float rollout = 6; } @@ -32,7 +32,7 @@ message EvaluationRolloutThreshold { message EvaluationRolloutSegment { bool value = 1; - flipt.SegmentOperator segmentOperator = 2; + flipt.SegmentOperator segment_operator = 2; repeated EvaluationSegment segments = 3; } From 4e25e7f24eb4c834c575ce958adda5ae5e348fb2 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:01:10 -0400 Subject: [PATCH 05/39] chore: move --- internal/cmd/grpc.go | 3 + .../server/{ => evaluation}/data/server.go | 42 +- rpc/flipt/data/data.pb.go | 1151 ------------- rpc/flipt/data/data.pb.gw.go | 189 --- rpc/flipt/data/data.proto | 88 - rpc/flipt/data/data_grpc.pb.go | 109 -- rpc/flipt/evaluation/evaluation.pb.go | 1426 +++++++++++++++-- rpc/flipt/evaluation/evaluation.pb.gw.go | 157 ++ rpc/flipt/evaluation/evaluation.proto | 81 + rpc/flipt/evaluation/evaluation_grpc.pb.go | 90 ++ rpc/flipt/flipt.yaml | 4 +- sdk/go/evaluation.sdk.gen.go | 41 +- sdk/go/grpc/grpc.sdk.gen.go | 15 +- sdk/go/http/evaluation.sdk.gen.go | 59 +- sdk/go/sdk.gen.go | 12 +- 15 files changed, 1708 insertions(+), 1759 deletions(-) rename internal/server/{ => evaluation}/data/server.go (76%) delete mode 100644 rpc/flipt/data/data.pb.go delete mode 100644 rpc/flipt/data/data.pb.gw.go delete mode 100644 rpc/flipt/data/data.proto delete mode 100644 rpc/flipt/data/data_grpc.pb.go diff --git a/internal/cmd/grpc.go b/internal/cmd/grpc.go index 7cfcd07202..084241e84e 100644 --- a/internal/cmd/grpc.go +++ b/internal/cmd/grpc.go @@ -26,6 +26,7 @@ import ( "go.flipt.io/flipt/internal/server/audit/webhook" "go.flipt.io/flipt/internal/server/auth" "go.flipt.io/flipt/internal/server/evaluation" + evaluationdata "go.flipt.io/flipt/internal/server/evaluation/data" "go.flipt.io/flipt/internal/server/metadata" middlewaregrpc "go.flipt.io/flipt/internal/server/middleware/grpc" "go.flipt.io/flipt/internal/storage" @@ -285,6 +286,7 @@ func NewGRPCServer( fliptsrv = fliptserver.New(logger, store) metasrv = metadata.New(cfg, info) evalsrv = evaluation.New(logger, store) + evalDataSrv = evaluationdata.New(logger, store) authOpts = []containers.Option[auth.InterceptorOptions]{} skipAuthIfExcluded = func(server any, excluded bool) { if excluded { @@ -332,6 +334,7 @@ func NewGRPCServer( register.Add(fliptsrv) register.Add(metasrv) register.Add(evalsrv) + register.Add(evalDataSrv) // forward internal gRPC logging to zap grpcLogLevel, err := zapcore.ParseLevel(cfg.Log.GRPCLevel) diff --git a/internal/server/data/server.go b/internal/server/evaluation/data/server.go similarity index 76% rename from internal/server/data/server.go rename to internal/server/evaluation/data/server.go index 8940954d8d..22ad7139d3 100644 --- a/internal/server/data/server.go +++ b/internal/server/evaluation/data/server.go @@ -6,8 +6,9 @@ import ( "go.flipt.io/flipt/internal/storage" "go.flipt.io/flipt/rpc/flipt" - "go.flipt.io/flipt/rpc/flipt/data" + "go.flipt.io/flipt/rpc/flipt/evaluation" "go.uber.org/zap" + "google.golang.org/grpc" ) type EvaluationStore interface { @@ -19,23 +20,28 @@ type Server struct { logger *zap.Logger store EvaluationStore - data.UnimplementedDataServiceServer + evaluation.UnimplementedDataServiceServer } -func NewServer(logger *zap.Logger, store EvaluationStore) *Server { +func New(logger *zap.Logger, store EvaluationStore) *Server { return &Server{ logger: logger, store: store, } } -func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.EvaluationNamespaceSnapshotRequest) (*data.EvaluationNamespaceSnapshot, error) { +// RegisterGRPC registers the *Server onto the provided grpc Server. +func (srv *Server) RegisterGRPC(server *grpc.Server) { + evaluation.RegisterDataServiceServer(server, srv) +} + +func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluation.EvaluationNamespaceSnapshotRequest) (*evaluation.EvaluationNamespaceSnapshot, error) { var ( namespaceKey = r.Key - resp = &data.EvaluationNamespaceSnapshot{} + resp = &evaluation.EvaluationNamespaceSnapshot{} remaining = true nextPage string - segments = make(map[string]*data.EvaluationSegment) + segments = make(map[string]*evaluation.EvaluationSegment) ) // flags/variants in batches @@ -54,7 +60,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval remaining = nextPage != "" for _, f := range flags { - flag := &data.EvaluationFlag{ + flag := &evaluation.EvaluationFlag{ Key: f.Key, Name: f.Name, Description: f.Description, @@ -71,7 +77,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval } for _, r := range rules { - rule := &data.EvaluationRule{ + rule := &evaluation.EvaluationRule{ Id: r.ID, Rank: r.Rank, SegmentOperator: r.SegmentOperator, @@ -83,13 +89,13 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval rule.Segments = append(rule.Segments, ss) } else { - ss := &data.EvaluationSegment{ + ss := &evaluation.EvaluationSegment{ Key: s.SegmentKey, MatchType: s.MatchType, } for _, c := range s.Constraints { - ss.Constraints = append(ss.Constraints, &data.EvaluationConstraint{ + ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ Id: c.ID, Type: c.Type, Property: c.Property, @@ -109,7 +115,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval // distributions for rule for _, d := range distributions { - dist := &data.EvaluationDistribution{ + dist := &evaluation.EvaluationDistribution{ VariantId: d.VariantID, VariantKey: d.VariantKey, VariantAttachment: d.VariantAttachment, @@ -130,22 +136,22 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval } for _, r := range rollouts { - rollout := &data.EvaluationRollout{ + rollout := &evaluation.EvaluationRollout{ Type: r.RolloutType, Rank: r.Rank, } switch r.RolloutType { case flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE: - rollout.Rule = &data.EvaluationRollout_Threshold{ - Threshold: &data.EvaluationRolloutThreshold{ + rollout.Rule = &evaluation.EvaluationRollout_Threshold{ + Threshold: &evaluation.EvaluationRolloutThreshold{ Percentage: r.Threshold.Percentage, Value: r.Threshold.Value, }, } case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: - segment := &data.EvaluationRolloutSegment{ + segment := &evaluation.EvaluationRolloutSegment{ Value: r.Segment.Value, SegmentOperator: r.Segment.SegmentOperator, } @@ -154,13 +160,13 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval // optimization: reuse segment if already seen ss, ok := segments[s.SegmentKey] if !ok { - ss := &data.EvaluationSegment{ + ss := &evaluation.EvaluationSegment{ Key: s.SegmentKey, MatchType: s.MatchType, } for _, c := range s.Constraints { - ss.Constraints = append(ss.Constraints, &data.EvaluationConstraint{ + ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ Id: c.ID, Type: c.Type, Property: c.Property, @@ -175,7 +181,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval segment.Segments = append(segment.Segments, ss) } - rollout.Rule = &data.EvaluationRollout_Segment{ + rollout.Rule = &evaluation.EvaluationRollout_Segment{ Segment: segment, } } diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go deleted file mode 100644 index 0f9608c8e4..0000000000 --- a/rpc/flipt/data/data.pb.go +++ /dev/null @@ -1,1151 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: data/data.proto - -package data - -import ( - flipt "go.flipt.io/flipt/rpc/flipt" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type EvaluationDistribution struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - RuleId string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` - VariantId string `protobuf:"bytes,3,opt,name=variant_id,json=variantId,proto3" json:"variant_id,omitempty"` - VariantKey string `protobuf:"bytes,4,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` - VariantAttachment string `protobuf:"bytes,5,opt,name=variant_attachment,json=variantAttachment,proto3" json:"variant_attachment,omitempty"` - Rollout float32 `protobuf:"fixed32,6,opt,name=rollout,proto3" json:"rollout,omitempty"` -} - -func (x *EvaluationDistribution) Reset() { - *x = EvaluationDistribution{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationDistribution) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationDistribution) ProtoMessage() {} - -func (x *EvaluationDistribution) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationDistribution.ProtoReflect.Descriptor instead. -func (*EvaluationDistribution) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{0} -} - -func (x *EvaluationDistribution) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EvaluationDistribution) GetRuleId() string { - if x != nil { - return x.RuleId - } - return "" -} - -func (x *EvaluationDistribution) GetVariantId() string { - if x != nil { - return x.VariantId - } - return "" -} - -func (x *EvaluationDistribution) GetVariantKey() string { - if x != nil { - return x.VariantKey - } - return "" -} - -func (x *EvaluationDistribution) GetVariantAttachment() string { - if x != nil { - return x.VariantAttachment - } - return "" -} - -func (x *EvaluationDistribution) GetRollout() float32 { - if x != nil { - return x.Rollout - } - return 0 -} - -type EvaluationRollout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type flipt.RolloutType `protobuf:"varint,1,opt,name=type,proto3,enum=flipt.RolloutType" json:"type,omitempty"` - Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` - // Types that are assignable to Rule: - // - // *EvaluationRollout_Segment - // *EvaluationRollout_Threshold - Rule isEvaluationRollout_Rule `protobuf_oneof:"rule"` -} - -func (x *EvaluationRollout) Reset() { - *x = EvaluationRollout{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationRollout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationRollout) ProtoMessage() {} - -func (x *EvaluationRollout) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationRollout.ProtoReflect.Descriptor instead. -func (*EvaluationRollout) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{1} -} - -func (x *EvaluationRollout) GetType() flipt.RolloutType { - if x != nil { - return x.Type - } - return flipt.RolloutType(0) -} - -func (x *EvaluationRollout) GetRank() int32 { - if x != nil { - return x.Rank - } - return 0 -} - -func (m *EvaluationRollout) GetRule() isEvaluationRollout_Rule { - if m != nil { - return m.Rule - } - return nil -} - -func (x *EvaluationRollout) GetSegment() *EvaluationRolloutSegment { - if x, ok := x.GetRule().(*EvaluationRollout_Segment); ok { - return x.Segment - } - return nil -} - -func (x *EvaluationRollout) GetThreshold() *EvaluationRolloutThreshold { - if x, ok := x.GetRule().(*EvaluationRollout_Threshold); ok { - return x.Threshold - } - return nil -} - -type isEvaluationRollout_Rule interface { - isEvaluationRollout_Rule() -} - -type EvaluationRollout_Segment struct { - Segment *EvaluationRolloutSegment `protobuf:"bytes,3,opt,name=segment,proto3,oneof"` -} - -type EvaluationRollout_Threshold struct { - Threshold *EvaluationRolloutThreshold `protobuf:"bytes,4,opt,name=threshold,proto3,oneof"` -} - -func (*EvaluationRollout_Segment) isEvaluationRollout_Rule() {} - -func (*EvaluationRollout_Threshold) isEvaluationRollout_Rule() {} - -type EvaluationRolloutThreshold struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` - Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *EvaluationRolloutThreshold) Reset() { - *x = EvaluationRolloutThreshold{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationRolloutThreshold) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationRolloutThreshold) ProtoMessage() {} - -func (x *EvaluationRolloutThreshold) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationRolloutThreshold.ProtoReflect.Descriptor instead. -func (*EvaluationRolloutThreshold) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{2} -} - -func (x *EvaluationRolloutThreshold) GetPercentage() float32 { - if x != nil { - return x.Percentage - } - return 0 -} - -func (x *EvaluationRolloutThreshold) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - -type EvaluationRolloutSegment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` - Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` -} - -func (x *EvaluationRolloutSegment) Reset() { - *x = EvaluationRolloutSegment{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationRolloutSegment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationRolloutSegment) ProtoMessage() {} - -func (x *EvaluationRolloutSegment) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationRolloutSegment.ProtoReflect.Descriptor instead. -func (*EvaluationRolloutSegment) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{3} -} - -func (x *EvaluationRolloutSegment) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - -func (x *EvaluationRolloutSegment) GetSegmentOperator() flipt.SegmentOperator { - if x != nil { - return x.SegmentOperator - } - return flipt.SegmentOperator(0) -} - -func (x *EvaluationRolloutSegment) GetSegments() []*EvaluationSegment { - if x != nil { - return x.Segments - } - return nil -} - -type EvaluationSegment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - MatchType flipt.MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=flipt.MatchType" json:"match_type,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Constraints []*EvaluationConstraint `protobuf:"bytes,7,rep,name=constraints,proto3" json:"constraints,omitempty"` -} - -func (x *EvaluationSegment) Reset() { - *x = EvaluationSegment{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationSegment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationSegment) ProtoMessage() {} - -func (x *EvaluationSegment) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationSegment.ProtoReflect.Descriptor instead. -func (*EvaluationSegment) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{4} -} - -func (x *EvaluationSegment) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *EvaluationSegment) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *EvaluationSegment) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *EvaluationSegment) GetMatchType() flipt.MatchType { - if x != nil { - return x.MatchType - } - return flipt.MatchType(0) -} - -func (x *EvaluationSegment) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *EvaluationSegment) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *EvaluationSegment) GetConstraints() []*EvaluationConstraint { - if x != nil { - return x.Constraints - } - return nil -} - -type EvaluationFlag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - Type flipt.FlagType `protobuf:"varint,5,opt,name=type,proto3,enum=flipt.FlagType" json:"type,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Rules []*EvaluationRule `protobuf:"bytes,8,rep,name=rules,proto3" json:"rules,omitempty"` - Rollouts []*EvaluationRollout `protobuf:"bytes,9,rep,name=rollouts,proto3" json:"rollouts,omitempty"` -} - -func (x *EvaluationFlag) Reset() { - *x = EvaluationFlag{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationFlag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationFlag) ProtoMessage() {} - -func (x *EvaluationFlag) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationFlag.ProtoReflect.Descriptor instead. -func (*EvaluationFlag) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{5} -} - -func (x *EvaluationFlag) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *EvaluationFlag) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *EvaluationFlag) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *EvaluationFlag) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *EvaluationFlag) GetType() flipt.FlagType { - if x != nil { - return x.Type - } - return flipt.FlagType(0) -} - -func (x *EvaluationFlag) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *EvaluationFlag) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *EvaluationFlag) GetRules() []*EvaluationRule { - if x != nil { - return x.Rules - } - return nil -} - -func (x *EvaluationFlag) GetRollouts() []*EvaluationRollout { - if x != nil { - return x.Rollouts - } - return nil -} - -type EvaluationConstraint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type flipt.ComparisonType `protobuf:"varint,2,opt,name=type,proto3,enum=flipt.ComparisonType" json:"type,omitempty"` - Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"` - Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator,omitempty"` - Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *EvaluationConstraint) Reset() { - *x = EvaluationConstraint{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationConstraint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationConstraint) ProtoMessage() {} - -func (x *EvaluationConstraint) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationConstraint.ProtoReflect.Descriptor instead. -func (*EvaluationConstraint) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{6} -} - -func (x *EvaluationConstraint) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EvaluationConstraint) GetType() flipt.ComparisonType { - if x != nil { - return x.Type - } - return flipt.ComparisonType(0) -} - -func (x *EvaluationConstraint) GetProperty() string { - if x != nil { - return x.Property - } - return "" -} - -func (x *EvaluationConstraint) GetOperator() string { - if x != nil { - return x.Operator - } - return "" -} - -func (x *EvaluationConstraint) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type EvaluationRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Segments []*EvaluationSegment `protobuf:"bytes,2,rep,name=segments,proto3" json:"segments,omitempty"` - Rank int32 `protobuf:"varint,3,opt,name=rank,proto3" json:"rank,omitempty"` - SegmentOperator flipt.SegmentOperator `protobuf:"varint,4,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` - Distributions []*EvaluationDistribution `protobuf:"bytes,5,rep,name=distributions,proto3" json:"distributions,omitempty"` -} - -func (x *EvaluationRule) Reset() { - *x = EvaluationRule{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationRule) ProtoMessage() {} - -func (x *EvaluationRule) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationRule.ProtoReflect.Descriptor instead. -func (*EvaluationRule) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{7} -} - -func (x *EvaluationRule) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EvaluationRule) GetSegments() []*EvaluationSegment { - if x != nil { - return x.Segments - } - return nil -} - -func (x *EvaluationRule) GetRank() int32 { - if x != nil { - return x.Rank - } - return 0 -} - -func (x *EvaluationRule) GetSegmentOperator() flipt.SegmentOperator { - if x != nil { - return x.SegmentOperator - } - return flipt.SegmentOperator(0) -} - -func (x *EvaluationRule) GetDistributions() []*EvaluationDistribution { - if x != nil { - return x.Distributions - } - return nil -} - -type EvaluationNamespaceSnapshot struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace *flipt.Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Flags []*EvaluationFlag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` -} - -func (x *EvaluationNamespaceSnapshot) Reset() { - *x = EvaluationNamespaceSnapshot{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationNamespaceSnapshot) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationNamespaceSnapshot) ProtoMessage() {} - -func (x *EvaluationNamespaceSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationNamespaceSnapshot.ProtoReflect.Descriptor instead. -func (*EvaluationNamespaceSnapshot) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{8} -} - -func (x *EvaluationNamespaceSnapshot) GetNamespace() *flipt.Namespace { - if x != nil { - return x.Namespace - } - return nil -} - -func (x *EvaluationNamespaceSnapshot) GetFlags() []*EvaluationFlag { - if x != nil { - return x.Flags - } - return nil -} - -type EvaluationNamespaceSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *EvaluationNamespaceSnapshotRequest) Reset() { - *x = EvaluationNamespaceSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationNamespaceSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationNamespaceSnapshotRequest) ProtoMessage() {} - -func (x *EvaluationNamespaceSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationNamespaceSnapshotRequest.ProtoReflect.Descriptor instead. -func (*EvaluationNamespaceSnapshotRequest) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{9} -} - -func (x *EvaluationNamespaceSnapshotRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -var File_data_data_proto protoreflect.FileDescriptor - -var file_data_data_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0b, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x01, 0x0a, 0x16, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, - 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, - 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, - 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, - 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x26, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x09, - 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, - 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, - 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, - 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0xae, 0x01, 0x0a, 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x22, 0xc6, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x2f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, - 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x0e, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, - 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, - 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x08, - 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, - 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x08, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, - 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, - 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x32, 0x85, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x76, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x2e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_data_data_proto_rawDescOnce sync.Once - file_data_data_proto_rawDescData = file_data_data_proto_rawDesc -) - -func file_data_data_proto_rawDescGZIP() []byte { - file_data_data_proto_rawDescOnce.Do(func() { - file_data_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_data_data_proto_rawDescData) - }) - return file_data_data_proto_rawDescData -} - -var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_data_data_proto_goTypes = []interface{}{ - (*EvaluationDistribution)(nil), // 0: flipt.data.EvaluationDistribution - (*EvaluationRollout)(nil), // 1: flipt.data.EvaluationRollout - (*EvaluationRolloutThreshold)(nil), // 2: flipt.data.EvaluationRolloutThreshold - (*EvaluationRolloutSegment)(nil), // 3: flipt.data.EvaluationRolloutSegment - (*EvaluationSegment)(nil), // 4: flipt.data.EvaluationSegment - (*EvaluationFlag)(nil), // 5: flipt.data.EvaluationFlag - (*EvaluationConstraint)(nil), // 6: flipt.data.EvaluationConstraint - (*EvaluationRule)(nil), // 7: flipt.data.EvaluationRule - (*EvaluationNamespaceSnapshot)(nil), // 8: flipt.data.EvaluationNamespaceSnapshot - (*EvaluationNamespaceSnapshotRequest)(nil), // 9: flipt.data.EvaluationNamespaceSnapshotRequest - (flipt.RolloutType)(0), // 10: flipt.RolloutType - (flipt.SegmentOperator)(0), // 11: flipt.SegmentOperator - (flipt.MatchType)(0), // 12: flipt.MatchType - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (flipt.FlagType)(0), // 14: flipt.FlagType - (flipt.ComparisonType)(0), // 15: flipt.ComparisonType - (*flipt.Namespace)(nil), // 16: flipt.Namespace -} -var file_data_data_proto_depIdxs = []int32{ - 10, // 0: flipt.data.EvaluationRollout.type:type_name -> flipt.RolloutType - 3, // 1: flipt.data.EvaluationRollout.segment:type_name -> flipt.data.EvaluationRolloutSegment - 2, // 2: flipt.data.EvaluationRollout.threshold:type_name -> flipt.data.EvaluationRolloutThreshold - 11, // 3: flipt.data.EvaluationRolloutSegment.segment_operator:type_name -> flipt.SegmentOperator - 4, // 4: flipt.data.EvaluationRolloutSegment.segments:type_name -> flipt.data.EvaluationSegment - 12, // 5: flipt.data.EvaluationSegment.match_type:type_name -> flipt.MatchType - 13, // 6: flipt.data.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp - 13, // 7: flipt.data.EvaluationSegment.updated_at:type_name -> google.protobuf.Timestamp - 6, // 8: flipt.data.EvaluationSegment.constraints:type_name -> flipt.data.EvaluationConstraint - 14, // 9: flipt.data.EvaluationFlag.type:type_name -> flipt.FlagType - 13, // 10: flipt.data.EvaluationFlag.created_at:type_name -> google.protobuf.Timestamp - 13, // 11: flipt.data.EvaluationFlag.updated_at:type_name -> google.protobuf.Timestamp - 7, // 12: flipt.data.EvaluationFlag.rules:type_name -> flipt.data.EvaluationRule - 1, // 13: flipt.data.EvaluationFlag.rollouts:type_name -> flipt.data.EvaluationRollout - 15, // 14: flipt.data.EvaluationConstraint.type:type_name -> flipt.ComparisonType - 4, // 15: flipt.data.EvaluationRule.segments:type_name -> flipt.data.EvaluationSegment - 11, // 16: flipt.data.EvaluationRule.segment_operator:type_name -> flipt.SegmentOperator - 0, // 17: flipt.data.EvaluationRule.distributions:type_name -> flipt.data.EvaluationDistribution - 16, // 18: flipt.data.EvaluationNamespaceSnapshot.namespace:type_name -> flipt.Namespace - 5, // 19: flipt.data.EvaluationNamespaceSnapshot.flags:type_name -> flipt.data.EvaluationFlag - 9, // 20: flipt.data.DataService.EvaluationSnapshotNamespace:input_type -> flipt.data.EvaluationNamespaceSnapshotRequest - 8, // 21: flipt.data.DataService.EvaluationSnapshotNamespace:output_type -> flipt.data.EvaluationNamespaceSnapshot - 21, // [21:22] is the sub-list for method output_type - 20, // [20:21] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name -} - -func init() { file_data_data_proto_init() } -func file_data_data_proto_init() { - if File_data_data_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_data_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationDistribution); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationRollout); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationRolloutThreshold); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationRolloutSegment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationSegment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationFlag); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationConstraint); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationNamespaceSnapshot); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationNamespaceSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_data_data_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*EvaluationRollout_Segment)(nil), - (*EvaluationRollout_Threshold)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_data_data_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_data_data_proto_goTypes, - DependencyIndexes: file_data_data_proto_depIdxs, - MessageInfos: file_data_data_proto_msgTypes, - }.Build() - File_data_data_proto = out.File - file_data_data_proto_rawDesc = nil - file_data_data_proto_goTypes = nil - file_data_data_proto_depIdxs = nil -} diff --git a/rpc/flipt/data/data.pb.gw.go b/rpc/flipt/data/data.pb.gw.go deleted file mode 100644 index b03150d6bd..0000000000 --- a/rpc/flipt/data/data.pb.gw.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: data/data.proto - -/* -Package data is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package data - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join - -func request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq EvaluationNamespaceSnapshotRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["key"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") - } - - protoReq.Key, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) - } - - msg, err := client.EvaluationSnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq EvaluationNamespaceSnapshotRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["key"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") - } - - protoReq.Key, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) - } - - msg, err := server.EvaluationSnapshotNamespace(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterDataServiceHandlerServer registers the http handlers for service DataService to "mux". -// UnaryRPC :call DataServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataServiceHandlerFromEndpoint instead. -func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error { - - mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.data.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterDataServiceHandlerFromEndpoint is same as RegisterDataServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterDataServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterDataServiceHandler(ctx, mux, conn) -} - -// RegisterDataServiceHandler registers the http handlers for service DataService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterDataServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterDataServiceHandlerClient(ctx, mux, NewDataServiceClient(conn)) -} - -// RegisterDataServiceHandlerClient registers the http handlers for service DataService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DataServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DataServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "DataServiceClient" to call the correct interceptors. -func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataServiceClient) error { - - mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.data.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_DataService_EvaluationSnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"internal", "v1", "evaluation", "snapshot", "namespace", "key"}, "")) -) - -var ( - forward_DataService_EvaluationSnapshotNamespace_0 = runtime.ForwardResponseMessage -) diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto deleted file mode 100644 index e275ae318a..0000000000 --- a/rpc/flipt/data/data.proto +++ /dev/null @@ -1,88 +0,0 @@ -syntax = "proto3"; - -package flipt.data; - -import "flipt.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "go.flipt.io/flipt/rpc/flipt/data"; - -message EvaluationDistribution { - string id = 1; - string rule_id = 2; - string variant_id = 3; - string variant_key = 4; - string variant_attachment = 5; - float rollout = 6; -} - -message EvaluationRollout { - flipt.RolloutType type = 1; - int32 rank = 2; - oneof rule { - EvaluationRolloutSegment segment = 3; - EvaluationRolloutThreshold threshold = 4; - } -} - -message EvaluationRolloutThreshold { - float percentage = 1; - bool value = 2; -} - -message EvaluationRolloutSegment { - bool value = 1; - flipt.SegmentOperator segment_operator = 2; - repeated EvaluationSegment segments = 3; -} - -message EvaluationSegment { - string key = 1; - string name = 2; - string description = 3; - flipt.MatchType match_type = 4; - google.protobuf.Timestamp created_at = 5; - google.protobuf.Timestamp updated_at = 6; - repeated EvaluationConstraint constraints = 7; -} - -message EvaluationFlag { - string key = 1; - string name = 2; - string description = 3; - bool enabled = 4; - flipt.FlagType type = 5; - google.protobuf.Timestamp created_at = 6; - google.protobuf.Timestamp updated_at = 7; - repeated EvaluationRule rules = 8; - repeated EvaluationRollout rollouts = 9; -} - -message EvaluationConstraint { - string id = 1; - flipt.ComparisonType type = 2; - string property = 3; - string operator = 4; - string value = 5; -} - -message EvaluationRule { - string id = 1; - repeated EvaluationSegment segments = 2; - int32 rank = 3; - flipt.SegmentOperator segment_operator = 4; - repeated EvaluationDistribution distributions = 5; -} - -message EvaluationNamespaceSnapshot { - flipt.Namespace namespace = 1; - repeated EvaluationFlag flags = 2; -} - -message EvaluationNamespaceSnapshotRequest { - string key = 1; -} - -service DataService { - rpc EvaluationSnapshotNamespace(EvaluationNamespaceSnapshotRequest) returns (EvaluationNamespaceSnapshot); -} diff --git a/rpc/flipt/data/data_grpc.pb.go b/rpc/flipt/data/data_grpc.pb.go deleted file mode 100644 index ebcb431a77..0000000000 --- a/rpc/flipt/data/data_grpc.pb.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: data/data.proto - -package data - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - DataService_EvaluationSnapshotNamespace_FullMethodName = "/flipt.data.DataService/EvaluationSnapshotNamespace" -) - -// DataServiceClient is the client API for DataService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DataServiceClient interface { - EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) -} - -type dataServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient { - return &dataServiceClient{cc} -} - -func (c *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) { - out := new(EvaluationNamespaceSnapshot) - err := c.cc.Invoke(ctx, DataService_EvaluationSnapshotNamespace_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DataServiceServer is the server API for DataService service. -// All implementations must embed UnimplementedDataServiceServer -// for forward compatibility -type DataServiceServer interface { - EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) - mustEmbedUnimplementedDataServiceServer() -} - -// UnimplementedDataServiceServer must be embedded to have forward compatible implementations. -type UnimplementedDataServiceServer struct { -} - -func (UnimplementedDataServiceServer) EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) { - return nil, status.Errorf(codes.Unimplemented, "method EvaluationSnapshotNamespace not implemented") -} -func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {} - -// UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DataServiceServer will -// result in compilation errors. -type UnsafeDataServiceServer interface { - mustEmbedUnimplementedDataServiceServer() -} - -func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) { - s.RegisterService(&DataService_ServiceDesc, srv) -} - -func _DataService_EvaluationSnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EvaluationNamespaceSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DataService_EvaluationSnapshotNamespace_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, req.(*EvaluationNamespaceSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// DataService_ServiceDesc is the grpc.ServiceDesc for DataService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var DataService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "flipt.data.DataService", - HandlerType: (*DataServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EvaluationSnapshotNamespace", - Handler: _DataService_EvaluationSnapshotNamespace_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "data/data.proto", -} diff --git a/rpc/flipt/evaluation/evaluation.pb.go b/rpc/flipt/evaluation/evaluation.pb.go index e58e037923..68560fc048 100644 --- a/rpc/flipt/evaluation/evaluation.pb.go +++ b/rpc/flipt/evaluation/evaluation.pb.go @@ -7,6 +7,7 @@ package evaluation import ( + flipt "go.flipt.io/flipt/rpc/flipt" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -729,6 +730,774 @@ func (x *ErrorEvaluationResponse) GetReason() ErrorEvaluationReason { return ErrorEvaluationReason_UNKNOWN_ERROR_EVALUATION_REASON } +type EvaluationDistribution struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + RuleId string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` + VariantId string `protobuf:"bytes,3,opt,name=variant_id,json=variantId,proto3" json:"variant_id,omitempty"` + VariantKey string `protobuf:"bytes,4,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` + VariantAttachment string `protobuf:"bytes,5,opt,name=variant_attachment,json=variantAttachment,proto3" json:"variant_attachment,omitempty"` + Rollout float32 `protobuf:"fixed32,6,opt,name=rollout,proto3" json:"rollout,omitempty"` +} + +func (x *EvaluationDistribution) Reset() { + *x = EvaluationDistribution{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationDistribution) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationDistribution) ProtoMessage() {} + +func (x *EvaluationDistribution) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationDistribution.ProtoReflect.Descriptor instead. +func (*EvaluationDistribution) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{7} +} + +func (x *EvaluationDistribution) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationDistribution) GetRuleId() string { + if x != nil { + return x.RuleId + } + return "" +} + +func (x *EvaluationDistribution) GetVariantId() string { + if x != nil { + return x.VariantId + } + return "" +} + +func (x *EvaluationDistribution) GetVariantKey() string { + if x != nil { + return x.VariantKey + } + return "" +} + +func (x *EvaluationDistribution) GetVariantAttachment() string { + if x != nil { + return x.VariantAttachment + } + return "" +} + +func (x *EvaluationDistribution) GetRollout() float32 { + if x != nil { + return x.Rollout + } + return 0 +} + +type EvaluationRollout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type flipt.RolloutType `protobuf:"varint,1,opt,name=type,proto3,enum=flipt.RolloutType" json:"type,omitempty"` + Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` + // Types that are assignable to Rule: + // + // *EvaluationRollout_Segment + // *EvaluationRollout_Threshold + Rule isEvaluationRollout_Rule `protobuf_oneof:"rule"` +} + +func (x *EvaluationRollout) Reset() { + *x = EvaluationRollout{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRollout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRollout) ProtoMessage() {} + +func (x *EvaluationRollout) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRollout.ProtoReflect.Descriptor instead. +func (*EvaluationRollout) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{8} +} + +func (x *EvaluationRollout) GetType() flipt.RolloutType { + if x != nil { + return x.Type + } + return flipt.RolloutType(0) +} + +func (x *EvaluationRollout) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (m *EvaluationRollout) GetRule() isEvaluationRollout_Rule { + if m != nil { + return m.Rule + } + return nil +} + +func (x *EvaluationRollout) GetSegment() *EvaluationRolloutSegment { + if x, ok := x.GetRule().(*EvaluationRollout_Segment); ok { + return x.Segment + } + return nil +} + +func (x *EvaluationRollout) GetThreshold() *EvaluationRolloutThreshold { + if x, ok := x.GetRule().(*EvaluationRollout_Threshold); ok { + return x.Threshold + } + return nil +} + +type isEvaluationRollout_Rule interface { + isEvaluationRollout_Rule() +} + +type EvaluationRollout_Segment struct { + Segment *EvaluationRolloutSegment `protobuf:"bytes,3,opt,name=segment,proto3,oneof"` +} + +type EvaluationRollout_Threshold struct { + Threshold *EvaluationRolloutThreshold `protobuf:"bytes,4,opt,name=threshold,proto3,oneof"` +} + +func (*EvaluationRollout_Segment) isEvaluationRollout_Rule() {} + +func (*EvaluationRollout_Threshold) isEvaluationRollout_Rule() {} + +type EvaluationRolloutThreshold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` + Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EvaluationRolloutThreshold) Reset() { + *x = EvaluationRolloutThreshold{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRolloutThreshold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRolloutThreshold) ProtoMessage() {} + +func (x *EvaluationRolloutThreshold) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRolloutThreshold.ProtoReflect.Descriptor instead. +func (*EvaluationRolloutThreshold) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{9} +} + +func (x *EvaluationRolloutThreshold) GetPercentage() float32 { + if x != nil { + return x.Percentage + } + return 0 +} + +func (x *EvaluationRolloutThreshold) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +type EvaluationRolloutSegment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` +} + +func (x *EvaluationRolloutSegment) Reset() { + *x = EvaluationRolloutSegment{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRolloutSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRolloutSegment) ProtoMessage() {} + +func (x *EvaluationRolloutSegment) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRolloutSegment.ProtoReflect.Descriptor instead. +func (*EvaluationRolloutSegment) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{10} +} + +func (x *EvaluationRolloutSegment) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +func (x *EvaluationRolloutSegment) GetSegmentOperator() flipt.SegmentOperator { + if x != nil { + return x.SegmentOperator + } + return flipt.SegmentOperator(0) +} + +func (x *EvaluationRolloutSegment) GetSegments() []*EvaluationSegment { + if x != nil { + return x.Segments + } + return nil +} + +type EvaluationSegment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + MatchType flipt.MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=flipt.MatchType" json:"match_type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Constraints []*EvaluationConstraint `protobuf:"bytes,7,rep,name=constraints,proto3" json:"constraints,omitempty"` +} + +func (x *EvaluationSegment) Reset() { + *x = EvaluationSegment{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationSegment) ProtoMessage() {} + +func (x *EvaluationSegment) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationSegment.ProtoReflect.Descriptor instead. +func (*EvaluationSegment) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{11} +} + +func (x *EvaluationSegment) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EvaluationSegment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EvaluationSegment) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *EvaluationSegment) GetMatchType() flipt.MatchType { + if x != nil { + return x.MatchType + } + return flipt.MatchType(0) +} + +func (x *EvaluationSegment) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *EvaluationSegment) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *EvaluationSegment) GetConstraints() []*EvaluationConstraint { + if x != nil { + return x.Constraints + } + return nil +} + +type EvaluationFlag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` + Type flipt.FlagType `protobuf:"varint,5,opt,name=type,proto3,enum=flipt.FlagType" json:"type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Rules []*EvaluationRule `protobuf:"bytes,8,rep,name=rules,proto3" json:"rules,omitempty"` + Rollouts []*EvaluationRollout `protobuf:"bytes,9,rep,name=rollouts,proto3" json:"rollouts,omitempty"` +} + +func (x *EvaluationFlag) Reset() { + *x = EvaluationFlag{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationFlag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationFlag) ProtoMessage() {} + +func (x *EvaluationFlag) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationFlag.ProtoReflect.Descriptor instead. +func (*EvaluationFlag) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{12} +} + +func (x *EvaluationFlag) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EvaluationFlag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EvaluationFlag) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *EvaluationFlag) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *EvaluationFlag) GetType() flipt.FlagType { + if x != nil { + return x.Type + } + return flipt.FlagType(0) +} + +func (x *EvaluationFlag) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *EvaluationFlag) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *EvaluationFlag) GetRules() []*EvaluationRule { + if x != nil { + return x.Rules + } + return nil +} + +func (x *EvaluationFlag) GetRollouts() []*EvaluationRollout { + if x != nil { + return x.Rollouts + } + return nil +} + +type EvaluationConstraint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type flipt.ComparisonType `protobuf:"varint,2,opt,name=type,proto3,enum=flipt.ComparisonType" json:"type,omitempty"` + Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"` + Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EvaluationConstraint) Reset() { + *x = EvaluationConstraint{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationConstraint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationConstraint) ProtoMessage() {} + +func (x *EvaluationConstraint) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationConstraint.ProtoReflect.Descriptor instead. +func (*EvaluationConstraint) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{13} +} + +func (x *EvaluationConstraint) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationConstraint) GetType() flipt.ComparisonType { + if x != nil { + return x.Type + } + return flipt.ComparisonType(0) +} + +func (x *EvaluationConstraint) GetProperty() string { + if x != nil { + return x.Property + } + return "" +} + +func (x *EvaluationConstraint) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *EvaluationConstraint) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type EvaluationRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,2,rep,name=segments,proto3" json:"segments,omitempty"` + Rank int32 `protobuf:"varint,3,opt,name=rank,proto3" json:"rank,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,4,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` + Distributions []*EvaluationDistribution `protobuf:"bytes,5,rep,name=distributions,proto3" json:"distributions,omitempty"` +} + +func (x *EvaluationRule) Reset() { + *x = EvaluationRule{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRule) ProtoMessage() {} + +func (x *EvaluationRule) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRule.ProtoReflect.Descriptor instead. +func (*EvaluationRule) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{14} +} + +func (x *EvaluationRule) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationRule) GetSegments() []*EvaluationSegment { + if x != nil { + return x.Segments + } + return nil +} + +func (x *EvaluationRule) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *EvaluationRule) GetSegmentOperator() flipt.SegmentOperator { + if x != nil { + return x.SegmentOperator + } + return flipt.SegmentOperator(0) +} + +func (x *EvaluationRule) GetDistributions() []*EvaluationDistribution { + if x != nil { + return x.Distributions + } + return nil +} + +type EvaluationNamespaceSnapshot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace *flipt.Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Flags []*EvaluationFlag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` +} + +func (x *EvaluationNamespaceSnapshot) Reset() { + *x = EvaluationNamespaceSnapshot{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespaceSnapshot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespaceSnapshot) ProtoMessage() {} + +func (x *EvaluationNamespaceSnapshot) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespaceSnapshot.ProtoReflect.Descriptor instead. +func (*EvaluationNamespaceSnapshot) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{15} +} + +func (x *EvaluationNamespaceSnapshot) GetNamespace() *flipt.Namespace { + if x != nil { + return x.Namespace + } + return nil +} + +func (x *EvaluationNamespaceSnapshot) GetFlags() []*EvaluationFlag { + if x != nil { + return x.Flags + } + return nil +} + +type EvaluationNamespaceSnapshotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *EvaluationNamespaceSnapshotRequest) Reset() { + *x = EvaluationNamespaceSnapshotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespaceSnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespaceSnapshotRequest) ProtoMessage() {} + +func (x *EvaluationNamespaceSnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespaceSnapshotRequest.ProtoReflect.Descriptor instead. +func (*EvaluationNamespaceSnapshotRequest) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{16} +} + +func (x *EvaluationNamespaceSnapshotRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + var File_evaluation_evaluation_proto protoreflect.FileDescriptor var file_evaluation_evaluation_proto_rawDesc = []byte{ @@ -737,165 +1506,304 @@ var file_evaluation_evaluation_proto_rawDesc = []byte{ 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x97, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, - 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, - 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x3a, - 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x78, 0x0a, 0x16, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, - 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, + 0x1a, 0x0b, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x02, + 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, + 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, + 0x4a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x3a, 0x0a, 0x0c, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x78, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, + 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, + 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0xe6, 0x02, 0x0a, 0x12, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x58, 0x0a, + 0x10, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, + 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x76, 0x61, 0x72, 0x69, 0x61, + 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, + 0x52, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x19, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, + 0x79, 0x22, 0x8c, 0x03, 0x0a, 0x19, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, + 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, + 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0xe6, 0x02, 0x0a, 0x12, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x58, 0x0a, 0x10, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, - 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, - 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x76, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x66, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, + 0x22, 0x9a, 0x01, 0x0a, 0x17, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x3f, 0x0a, 0x06, + 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x19, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x06, - 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, - 0x69, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, - 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xca, 0x01, + 0x0a, 0x16, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, + 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, + 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xed, 0x01, 0x0a, 0x11, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, + 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x46, 0x0a, 0x07, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, + 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb4, + 0x01, 0x0a, 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, + 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xcc, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x63, 0x6f, + 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, + 0x69, 0x6e, 0x74, 0x73, 0x22, 0x86, 0x03, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, - 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, - 0x67, 0x4b, 0x65, 0x79, 0x22, 0x8c, 0x03, 0x0a, 0x19, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, - 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, - 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, - 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, - 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, - 0x4b, 0x65, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x17, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, - 0x3f, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x2a, 0x92, 0x01, 0x0a, 0x10, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x19, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, - 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x44, 0x49, 0x53, - 0x41, 0x42, 0x4c, 0x45, 0x44, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x41, 0x54, - 0x43, 0x48, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, - 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, - 0x54, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, - 0x53, 0x4f, 0x4e, 0x10, 0x03, 0x2a, 0x63, 0x0a, 0x15, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x23, - 0x0a, 0x1f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x36, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, + 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, + 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x22, 0x9f, 0x01, + 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, + 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x88, 0x02, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, + 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0d, 0x64, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1b, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x66, 0x6c, + 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, + 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x2a, 0x92, 0x01, 0x0a, 0x10, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, + 0x1d, 0x0a, 0x19, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x23, + 0x0a, 0x1f, 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, - 0x4e, 0x10, 0x00, 0x12, 0x25, 0x0a, 0x21, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, - 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x01, 0x2a, 0x88, 0x01, 0x0a, 0x16, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x20, 0x56, 0x41, 0x52, 0x49, 0x41, 0x4e, 0x54, - 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, - 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x24, 0x0a, 0x20, 0x42, - 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, - 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, + 0x4e, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x45, 0x56, 0x41, + 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x02, + 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x45, 0x56, 0x41, 0x4c, + 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x03, 0x2a, + 0x63, 0x0a, 0x15, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x1f, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x25, 0x0a, + 0x21, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, + 0x4f, 0x4e, 0x10, 0x01, 0x2a, 0x88, 0x01, 0x0a, 0x16, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x24, 0x0a, 0x20, 0x56, 0x41, 0x52, 0x49, 0x41, 0x4e, 0x54, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x10, 0x02, 0x32, 0xb1, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x07, 0x42, - 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x07, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x05, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x12, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, + 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x24, 0x0a, 0x20, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, + 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, + 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x45, + 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x02, 0x32, + 0xb1, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x07, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, + 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x07, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, + 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x32, 0x92, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x34, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, + 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -911,23 +1819,39 @@ func file_evaluation_evaluation_proto_rawDescGZIP() []byte { } var file_evaluation_evaluation_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_evaluation_evaluation_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_evaluation_evaluation_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_evaluation_evaluation_proto_goTypes = []interface{}{ - (EvaluationReason)(0), // 0: flipt.evaluation.EvaluationReason - (ErrorEvaluationReason)(0), // 1: flipt.evaluation.ErrorEvaluationReason - (EvaluationResponseType)(0), // 2: flipt.evaluation.EvaluationResponseType - (*EvaluationRequest)(nil), // 3: flipt.evaluation.EvaluationRequest - (*BatchEvaluationRequest)(nil), // 4: flipt.evaluation.BatchEvaluationRequest - (*BatchEvaluationResponse)(nil), // 5: flipt.evaluation.BatchEvaluationResponse - (*EvaluationResponse)(nil), // 6: flipt.evaluation.EvaluationResponse - (*BooleanEvaluationResponse)(nil), // 7: flipt.evaluation.BooleanEvaluationResponse - (*VariantEvaluationResponse)(nil), // 8: flipt.evaluation.VariantEvaluationResponse - (*ErrorEvaluationResponse)(nil), // 9: flipt.evaluation.ErrorEvaluationResponse - nil, // 10: flipt.evaluation.EvaluationRequest.ContextEntry - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (EvaluationReason)(0), // 0: flipt.evaluation.EvaluationReason + (ErrorEvaluationReason)(0), // 1: flipt.evaluation.ErrorEvaluationReason + (EvaluationResponseType)(0), // 2: flipt.evaluation.EvaluationResponseType + (*EvaluationRequest)(nil), // 3: flipt.evaluation.EvaluationRequest + (*BatchEvaluationRequest)(nil), // 4: flipt.evaluation.BatchEvaluationRequest + (*BatchEvaluationResponse)(nil), // 5: flipt.evaluation.BatchEvaluationResponse + (*EvaluationResponse)(nil), // 6: flipt.evaluation.EvaluationResponse + (*BooleanEvaluationResponse)(nil), // 7: flipt.evaluation.BooleanEvaluationResponse + (*VariantEvaluationResponse)(nil), // 8: flipt.evaluation.VariantEvaluationResponse + (*ErrorEvaluationResponse)(nil), // 9: flipt.evaluation.ErrorEvaluationResponse + (*EvaluationDistribution)(nil), // 10: flipt.evaluation.EvaluationDistribution + (*EvaluationRollout)(nil), // 11: flipt.evaluation.EvaluationRollout + (*EvaluationRolloutThreshold)(nil), // 12: flipt.evaluation.EvaluationRolloutThreshold + (*EvaluationRolloutSegment)(nil), // 13: flipt.evaluation.EvaluationRolloutSegment + (*EvaluationSegment)(nil), // 14: flipt.evaluation.EvaluationSegment + (*EvaluationFlag)(nil), // 15: flipt.evaluation.EvaluationFlag + (*EvaluationConstraint)(nil), // 16: flipt.evaluation.EvaluationConstraint + (*EvaluationRule)(nil), // 17: flipt.evaluation.EvaluationRule + (*EvaluationNamespaceSnapshot)(nil), // 18: flipt.evaluation.EvaluationNamespaceSnapshot + (*EvaluationNamespaceSnapshotRequest)(nil), // 19: flipt.evaluation.EvaluationNamespaceSnapshotRequest + nil, // 20: flipt.evaluation.EvaluationRequest.ContextEntry + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp + (flipt.RolloutType)(0), // 22: flipt.RolloutType + (flipt.SegmentOperator)(0), // 23: flipt.SegmentOperator + (flipt.MatchType)(0), // 24: flipt.MatchType + (flipt.FlagType)(0), // 25: flipt.FlagType + (flipt.ComparisonType)(0), // 26: flipt.ComparisonType + (*flipt.Namespace)(nil), // 27: flipt.Namespace } var file_evaluation_evaluation_proto_depIdxs = []int32{ - 10, // 0: flipt.evaluation.EvaluationRequest.context:type_name -> flipt.evaluation.EvaluationRequest.ContextEntry + 20, // 0: flipt.evaluation.EvaluationRequest.context:type_name -> flipt.evaluation.EvaluationRequest.ContextEntry 3, // 1: flipt.evaluation.BatchEvaluationRequest.requests:type_name -> flipt.evaluation.EvaluationRequest 6, // 2: flipt.evaluation.BatchEvaluationResponse.responses:type_name -> flipt.evaluation.EvaluationResponse 2, // 3: flipt.evaluation.EvaluationResponse.type:type_name -> flipt.evaluation.EvaluationResponseType @@ -935,21 +1859,43 @@ var file_evaluation_evaluation_proto_depIdxs = []int32{ 8, // 5: flipt.evaluation.EvaluationResponse.variant_response:type_name -> flipt.evaluation.VariantEvaluationResponse 9, // 6: flipt.evaluation.EvaluationResponse.error_response:type_name -> flipt.evaluation.ErrorEvaluationResponse 0, // 7: flipt.evaluation.BooleanEvaluationResponse.reason:type_name -> flipt.evaluation.EvaluationReason - 11, // 8: flipt.evaluation.BooleanEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp + 21, // 8: flipt.evaluation.BooleanEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp 0, // 9: flipt.evaluation.VariantEvaluationResponse.reason:type_name -> flipt.evaluation.EvaluationReason - 11, // 10: flipt.evaluation.VariantEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp + 21, // 10: flipt.evaluation.VariantEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp 1, // 11: flipt.evaluation.ErrorEvaluationResponse.reason:type_name -> flipt.evaluation.ErrorEvaluationReason - 3, // 12: flipt.evaluation.EvaluationService.Boolean:input_type -> flipt.evaluation.EvaluationRequest - 3, // 13: flipt.evaluation.EvaluationService.Variant:input_type -> flipt.evaluation.EvaluationRequest - 4, // 14: flipt.evaluation.EvaluationService.Batch:input_type -> flipt.evaluation.BatchEvaluationRequest - 7, // 15: flipt.evaluation.EvaluationService.Boolean:output_type -> flipt.evaluation.BooleanEvaluationResponse - 8, // 16: flipt.evaluation.EvaluationService.Variant:output_type -> flipt.evaluation.VariantEvaluationResponse - 5, // 17: flipt.evaluation.EvaluationService.Batch:output_type -> flipt.evaluation.BatchEvaluationResponse - 15, // [15:18] is the sub-list for method output_type - 12, // [12:15] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 22, // 12: flipt.evaluation.EvaluationRollout.type:type_name -> flipt.RolloutType + 13, // 13: flipt.evaluation.EvaluationRollout.segment:type_name -> flipt.evaluation.EvaluationRolloutSegment + 12, // 14: flipt.evaluation.EvaluationRollout.threshold:type_name -> flipt.evaluation.EvaluationRolloutThreshold + 23, // 15: flipt.evaluation.EvaluationRolloutSegment.segment_operator:type_name -> flipt.SegmentOperator + 14, // 16: flipt.evaluation.EvaluationRolloutSegment.segments:type_name -> flipt.evaluation.EvaluationSegment + 24, // 17: flipt.evaluation.EvaluationSegment.match_type:type_name -> flipt.MatchType + 21, // 18: flipt.evaluation.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp + 21, // 19: flipt.evaluation.EvaluationSegment.updated_at:type_name -> google.protobuf.Timestamp + 16, // 20: flipt.evaluation.EvaluationSegment.constraints:type_name -> flipt.evaluation.EvaluationConstraint + 25, // 21: flipt.evaluation.EvaluationFlag.type:type_name -> flipt.FlagType + 21, // 22: flipt.evaluation.EvaluationFlag.created_at:type_name -> google.protobuf.Timestamp + 21, // 23: flipt.evaluation.EvaluationFlag.updated_at:type_name -> google.protobuf.Timestamp + 17, // 24: flipt.evaluation.EvaluationFlag.rules:type_name -> flipt.evaluation.EvaluationRule + 11, // 25: flipt.evaluation.EvaluationFlag.rollouts:type_name -> flipt.evaluation.EvaluationRollout + 26, // 26: flipt.evaluation.EvaluationConstraint.type:type_name -> flipt.ComparisonType + 14, // 27: flipt.evaluation.EvaluationRule.segments:type_name -> flipt.evaluation.EvaluationSegment + 23, // 28: flipt.evaluation.EvaluationRule.segment_operator:type_name -> flipt.SegmentOperator + 10, // 29: flipt.evaluation.EvaluationRule.distributions:type_name -> flipt.evaluation.EvaluationDistribution + 27, // 30: flipt.evaluation.EvaluationNamespaceSnapshot.namespace:type_name -> flipt.Namespace + 15, // 31: flipt.evaluation.EvaluationNamespaceSnapshot.flags:type_name -> flipt.evaluation.EvaluationFlag + 3, // 32: flipt.evaluation.EvaluationService.Boolean:input_type -> flipt.evaluation.EvaluationRequest + 3, // 33: flipt.evaluation.EvaluationService.Variant:input_type -> flipt.evaluation.EvaluationRequest + 4, // 34: flipt.evaluation.EvaluationService.Batch:input_type -> flipt.evaluation.BatchEvaluationRequest + 19, // 35: flipt.evaluation.DataService.EvaluationSnapshotNamespace:input_type -> flipt.evaluation.EvaluationNamespaceSnapshotRequest + 7, // 36: flipt.evaluation.EvaluationService.Boolean:output_type -> flipt.evaluation.BooleanEvaluationResponse + 8, // 37: flipt.evaluation.EvaluationService.Variant:output_type -> flipt.evaluation.VariantEvaluationResponse + 5, // 38: flipt.evaluation.EvaluationService.Batch:output_type -> flipt.evaluation.BatchEvaluationResponse + 18, // 39: flipt.evaluation.DataService.EvaluationSnapshotNamespace:output_type -> flipt.evaluation.EvaluationNamespaceSnapshot + 36, // [36:40] is the sub-list for method output_type + 32, // [32:36] is the sub-list for method input_type + 32, // [32:32] is the sub-list for extension type_name + 32, // [32:32] is the sub-list for extension extendee + 0, // [0:32] is the sub-list for field type_name } func init() { file_evaluation_evaluation_proto_init() } @@ -1042,21 +1988,145 @@ func file_evaluation_evaluation_proto_init() { return nil } } + file_evaluation_evaluation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationDistribution); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRollout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRolloutThreshold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRolloutSegment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationSegment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationFlag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationConstraint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_evaluation_evaluation_proto_msgTypes[3].OneofWrappers = []interface{}{ (*EvaluationResponse_BooleanResponse)(nil), (*EvaluationResponse_VariantResponse)(nil), (*EvaluationResponse_ErrorResponse)(nil), } + file_evaluation_evaluation_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*EvaluationRollout_Segment)(nil), + (*EvaluationRollout_Threshold)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_evaluation_evaluation_proto_rawDesc, NumEnums: 3, - NumMessages: 8, + NumMessages: 18, NumExtensions: 0, - NumServices: 1, + NumServices: 2, }, GoTypes: file_evaluation_evaluation_proto_goTypes, DependencyIndexes: file_evaluation_evaluation_proto_depIdxs, diff --git a/rpc/flipt/evaluation/evaluation.pb.gw.go b/rpc/flipt/evaluation/evaluation.pb.gw.go index 97ed19b3cc..fe26054cf4 100644 --- a/rpc/flipt/evaluation/evaluation.pb.gw.go +++ b/rpc/flipt/evaluation/evaluation.pb.gw.go @@ -133,6 +133,58 @@ func local_request_EvaluationService_Batch_0(ctx context.Context, marshaler runt } +func request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EvaluationNamespaceSnapshotRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + msg, err := client.EvaluationSnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EvaluationNamespaceSnapshotRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + msg, err := server.EvaluationSnapshotNamespace(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterEvaluationServiceHandlerServer registers the http handlers for service EvaluationService to "mux". // UnaryRPC :call EvaluationServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -217,6 +269,40 @@ func RegisterEvaluationServiceHandlerServer(ctx context.Context, mux *runtime.Se return nil } +// RegisterDataServiceHandlerServer registers the http handlers for service DataService to "mux". +// UnaryRPC :call DataServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataServiceHandlerFromEndpoint instead. +func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error { + + mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.evaluation.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + // RegisterEvaluationServiceHandlerFromEndpoint is same as RegisterEvaluationServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterEvaluationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { @@ -339,3 +425,74 @@ var ( forward_EvaluationService_Batch_0 = runtime.ForwardResponseMessage ) + +// RegisterDataServiceHandlerFromEndpoint is same as RegisterDataServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterDataServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterDataServiceHandler(ctx, mux, conn) +} + +// RegisterDataServiceHandler registers the http handlers for service DataService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterDataServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterDataServiceHandlerClient(ctx, mux, NewDataServiceClient(conn)) +} + +// RegisterDataServiceHandlerClient registers the http handlers for service DataService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DataServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DataServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "DataServiceClient" to call the correct interceptors. +func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataServiceClient) error { + + mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.evaluation.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_DataService_EvaluationSnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"internal", "v1", "evaluation", "snapshot", "namespace", "key"}, "")) +) + +var ( + forward_DataService_EvaluationSnapshotNamespace_0 = runtime.ForwardResponseMessage +) diff --git a/rpc/flipt/evaluation/evaluation.proto b/rpc/flipt/evaluation/evaluation.proto index bb72d10196..df97420fe2 100644 --- a/rpc/flipt/evaluation/evaluation.proto +++ b/rpc/flipt/evaluation/evaluation.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package flipt.evaluation; import "google/protobuf/timestamp.proto"; +import "flipt.proto"; option go_package = "go.flipt.io/flipt/rpc/flipt/evaluation"; @@ -84,3 +85,83 @@ service EvaluationService { rpc Variant(EvaluationRequest) returns (VariantEvaluationResponse) {} rpc Batch(BatchEvaluationRequest) returns (BatchEvaluationResponse) {} } + +message EvaluationDistribution { + string id = 1; + string rule_id = 2; + string variant_id = 3; + string variant_key = 4; + string variant_attachment = 5; + float rollout = 6; +} + +message EvaluationRollout { + flipt.RolloutType type = 1; + int32 rank = 2; + oneof rule { + EvaluationRolloutSegment segment = 3; + EvaluationRolloutThreshold threshold = 4; + } +} + +message EvaluationRolloutThreshold { + float percentage = 1; + bool value = 2; +} + +message EvaluationRolloutSegment { + bool value = 1; + flipt.SegmentOperator segment_operator = 2; + repeated EvaluationSegment segments = 3; +} + +message EvaluationSegment { + string key = 1; + string name = 2; + string description = 3; + flipt.MatchType match_type = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + repeated EvaluationConstraint constraints = 7; +} + +message EvaluationFlag { + string key = 1; + string name = 2; + string description = 3; + bool enabled = 4; + flipt.FlagType type = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; + repeated EvaluationRule rules = 8; + repeated EvaluationRollout rollouts = 9; +} + +message EvaluationConstraint { + string id = 1; + flipt.ComparisonType type = 2; + string property = 3; + string operator = 4; + string value = 5; +} + +message EvaluationRule { + string id = 1; + repeated EvaluationSegment segments = 2; + int32 rank = 3; + flipt.SegmentOperator segment_operator = 4; + repeated EvaluationDistribution distributions = 5; +} + +message EvaluationNamespaceSnapshot { + flipt.Namespace namespace = 1; + repeated EvaluationFlag flags = 2; +} + +message EvaluationNamespaceSnapshotRequest { + string key = 1; +} + +service DataService { + rpc EvaluationSnapshotNamespace(EvaluationNamespaceSnapshotRequest) returns (EvaluationNamespaceSnapshot); +} diff --git a/rpc/flipt/evaluation/evaluation_grpc.pb.go b/rpc/flipt/evaluation/evaluation_grpc.pb.go index 2aff45684e..537d680e50 100644 --- a/rpc/flipt/evaluation/evaluation_grpc.pb.go +++ b/rpc/flipt/evaluation/evaluation_grpc.pb.go @@ -181,3 +181,93 @@ var EvaluationService_ServiceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "evaluation/evaluation.proto", } + +const ( + DataService_EvaluationSnapshotNamespace_FullMethodName = "/flipt.evaluation.DataService/EvaluationSnapshotNamespace" +) + +// DataServiceClient is the client API for DataService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DataServiceClient interface { + EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) +} + +type dataServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient { + return &dataServiceClient{cc} +} + +func (c *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) { + out := new(EvaluationNamespaceSnapshot) + err := c.cc.Invoke(ctx, DataService_EvaluationSnapshotNamespace_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DataServiceServer is the server API for DataService service. +// All implementations must embed UnimplementedDataServiceServer +// for forward compatibility +type DataServiceServer interface { + EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) + mustEmbedUnimplementedDataServiceServer() +} + +// UnimplementedDataServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDataServiceServer struct { +} + +func (UnimplementedDataServiceServer) EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) { + return nil, status.Errorf(codes.Unimplemented, "method EvaluationSnapshotNamespace not implemented") +} +func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {} + +// UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DataServiceServer will +// result in compilation errors. +type UnsafeDataServiceServer interface { + mustEmbedUnimplementedDataServiceServer() +} + +func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) { + s.RegisterService(&DataService_ServiceDesc, srv) +} + +func _DataService_EvaluationSnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EvaluationNamespaceSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DataService_EvaluationSnapshotNamespace_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, req.(*EvaluationNamespaceSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// DataService_ServiceDesc is the grpc.ServiceDesc for DataService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DataService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipt.evaluation.DataService", + HandlerType: (*DataServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EvaluationSnapshotNamespace", + Handler: _DataService_EvaluationSnapshotNamespace_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "evaluation/evaluation.proto", +} diff --git a/rpc/flipt/flipt.yaml b/rpc/flipt/flipt.yaml index ebad8489a0..8535049bab 100644 --- a/rpc/flipt/flipt.yaml +++ b/rpc/flipt/flipt.yaml @@ -313,5 +313,5 @@ http: get: /auth/v1/method/github/callback # internal routes - - selector: flipt.data.DataService.EvaluationSnapshotNamespace - get: /internal/v1/evaluation/snapshot/namespace/{key} \ No newline at end of file + - selector: flipt.evaluation.DataService.EvaluationSnapshotNamespace + get: /internal/v1/evaluation/snapshot/namespace/{key} diff --git a/sdk/go/evaluation.sdk.gen.go b/sdk/go/evaluation.sdk.gen.go index 2a1c894f75..ed57289df5 100644 --- a/sdk/go/evaluation.sdk.gen.go +++ b/sdk/go/evaluation.sdk.gen.go @@ -7,12 +7,28 @@ import ( evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" ) +type EvaluationClient interface { + EvaluationServiceClient() evaluation.EvaluationServiceClient + DataServiceClient() evaluation.DataServiceClient +} + type Evaluation struct { + transport EvaluationClient + tokenProvider ClientTokenProvider +} + +type EvaluationService struct { transport evaluation.EvaluationServiceClient tokenProvider ClientTokenProvider } -func (x *Evaluation) Boolean(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.BooleanEvaluationResponse, error) { +func (s Evaluation) EvaluationService() *EvaluationService { + return &EvaluationService{ + transport: s.transport.EvaluationServiceClient(), + tokenProvider: s.tokenProvider, + } +} +func (x *EvaluationService) Boolean(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.BooleanEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err @@ -20,7 +36,7 @@ func (x *Evaluation) Boolean(ctx context.Context, v *evaluation.EvaluationReques return x.transport.Boolean(ctx, v) } -func (x *Evaluation) Variant(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.VariantEvaluationResponse, error) { +func (x *EvaluationService) Variant(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.VariantEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err @@ -28,10 +44,29 @@ func (x *Evaluation) Variant(ctx context.Context, v *evaluation.EvaluationReques return x.transport.Variant(ctx, v) } -func (x *Evaluation) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest) (*evaluation.BatchEvaluationResponse, error) { +func (x *EvaluationService) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest) (*evaluation.BatchEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err } return x.transport.Batch(ctx, v) } + +type DataService struct { + transport evaluation.DataServiceClient + tokenProvider ClientTokenProvider +} + +func (s Evaluation) DataService() *DataService { + return &DataService{ + transport: s.transport.DataServiceClient(), + tokenProvider: s.tokenProvider, + } +} +func (x *DataService) EvaluationSnapshotNamespace(ctx context.Context, v *evaluation.EvaluationNamespaceSnapshotRequest) (*evaluation.EvaluationNamespaceSnapshot, error) { + ctx, err := authenticate(ctx, x.tokenProvider) + if err != nil { + return nil, err + } + return x.transport.EvaluationSnapshotNamespace(ctx, v) +} diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index 757b836741..b1387c99a0 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -5,7 +5,6 @@ package grpc import ( flipt "go.flipt.io/flipt/rpc/flipt" auth "go.flipt.io/flipt/rpc/flipt/auth" - data "go.flipt.io/flipt/rpc/flipt/data" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" _go "go.flipt.io/flipt/sdk/go" @@ -58,14 +57,22 @@ func (t Transport) FliptClient() flipt.FliptClient { return flipt.NewFliptClient(t.cc) } -func (t Transport) DataClient() data.DataServiceClient { - return data.NewDataServiceClient(t.cc) +type evaluationClient struct { + cc grpc.ClientConnInterface } -func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { +func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationServiceClient { return evaluation.NewEvaluationServiceClient(t.cc) } +func (t evaluationClient) DataServiceClient() evaluation.DataServiceClient { + return evaluation.NewDataServiceClient(t.cc) +} + +func (t Transport) EvaluationClient() _go.EvaluationClient { + return evaluationClient{cc: t.cc} +} + func (t Transport) MetaClient() meta.MetadataServiceClient { return meta.NewMetadataServiceClient(t.cc) } diff --git a/sdk/go/http/evaluation.sdk.gen.go b/sdk/go/http/evaluation.sdk.gen.go index ac6c812053..1a4bfb1da4 100644 --- a/sdk/go/http/evaluation.sdk.gen.go +++ b/sdk/go/http/evaluation.sdk.gen.go @@ -5,7 +5,9 @@ package http import ( bytes "bytes" context "context" + fmt "fmt" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" + _go "go.flipt.io/flipt/sdk/go" grpc "google.golang.org/grpc" protojson "google.golang.org/protobuf/encoding/protojson" io "io" @@ -13,12 +15,21 @@ import ( url "net/url" ) -type EvaluationServiceClient struct { +type evaluationClient struct { client *http.Client addr string } -func (x *EvaluationServiceClient) Boolean(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.BooleanEvaluationResponse, error) { +func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationServiceClient { + return &evaluationServiceClient{client: t.client, addr: t.addr} +} + +type evaluationServiceClient struct { + client *http.Client + addr string +} + +func (x *evaluationServiceClient) Boolean(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.BooleanEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -50,7 +61,7 @@ func (x *EvaluationServiceClient) Boolean(ctx context.Context, v *evaluation.Eva return &output, nil } -func (x *EvaluationServiceClient) Variant(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.VariantEvaluationResponse, error) { +func (x *evaluationServiceClient) Variant(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.VariantEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -82,7 +93,7 @@ func (x *EvaluationServiceClient) Variant(ctx context.Context, v *evaluation.Eva return &output, nil } -func (x *EvaluationServiceClient) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest, _ ...grpc.CallOption) (*evaluation.BatchEvaluationResponse, error) { +func (x *evaluationServiceClient) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest, _ ...grpc.CallOption) (*evaluation.BatchEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -114,6 +125,42 @@ func (x *EvaluationServiceClient) Batch(ctx context.Context, v *evaluation.Batch return &output, nil } -func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { - return &EvaluationServiceClient{client: t.client, addr: t.addr} +func (t evaluationClient) DataServiceClient() evaluation.DataServiceClient { + return &dataServiceClient{client: t.client, addr: t.addr} +} + +type dataServiceClient struct { + client *http.Client + addr string +} + +func (x *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, v *evaluation.EvaluationNamespaceSnapshotRequest, _ ...grpc.CallOption) (*evaluation.EvaluationNamespaceSnapshot, error) { + var body io.Reader + var values url.Values + req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/internal/v1/evaluation/snapshot/namespace/%v", v.Key), body) + if err != nil { + return nil, err + } + req.URL.RawQuery = values.Encode() + resp, err := x.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var output evaluation.EvaluationNamespaceSnapshot + respData, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + if err := checkResponse(resp, respData); err != nil { + return nil, err + } + if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(respData, &output); err != nil { + return nil, err + } + return &output, nil +} + +func (t Transport) EvaluationClient() _go.EvaluationClient { + return evaluationClient{client: t.client, addr: t.addr} } diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index 3cc61abba0..a50383b193 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -5,8 +5,6 @@ package sdk import ( context "context" flipt "go.flipt.io/flipt/rpc/flipt" - data "go.flipt.io/flipt/rpc/flipt/data" - evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" metadata "google.golang.org/grpc/metadata" ) @@ -14,8 +12,7 @@ import ( type Transport interface { AuthClient() AuthClient FliptClient() flipt.FliptClient - DataClient() data.DataServiceClient - EvaluationClient() evaluation.EvaluationServiceClient + EvaluationClient() EvaluationClient MetaClient() meta.MetadataServiceClient } @@ -82,13 +79,6 @@ func (s SDK) Flipt() *Flipt { } } -func (s SDK) Data() *Data { - return &Data{ - transport: s.transport.DataClient(), - tokenProvider: s.tokenProvider, - } -} - func (s SDK) Evaluation() *Evaluation { return &Evaluation{ transport: s.transport.EvaluationClient(), From eff5b410a6e4cb8f2951a079101dfe0730e7048a Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:47:28 -0400 Subject: [PATCH 06/39] chore: fix build --- sdk/go/data.sdk.gen.go | 21 ---------------- sdk/go/http/data.sdk.gen.go | 50 ------------------------------------- 2 files changed, 71 deletions(-) delete mode 100644 sdk/go/data.sdk.gen.go delete mode 100644 sdk/go/http/data.sdk.gen.go diff --git a/sdk/go/data.sdk.gen.go b/sdk/go/data.sdk.gen.go deleted file mode 100644 index 81c68d3966..0000000000 --- a/sdk/go/data.sdk.gen.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by protoc-gen-go-flipt-sdk. DO NOT EDIT. - -package sdk - -import ( - context "context" - data "go.flipt.io/flipt/rpc/flipt/data" -) - -type Data struct { - transport data.DataServiceClient - tokenProvider ClientTokenProvider -} - -func (x *Data) EvaluationSnapshotNamespace(ctx context.Context, v *data.EvaluationNamespaceSnapshotRequest) (*data.EvaluationNamespaceSnapshot, error) { - ctx, err := authenticate(ctx, x.tokenProvider) - if err != nil { - return nil, err - } - return x.transport.EvaluationSnapshotNamespace(ctx, v) -} diff --git a/sdk/go/http/data.sdk.gen.go b/sdk/go/http/data.sdk.gen.go deleted file mode 100644 index 57efda9d31..0000000000 --- a/sdk/go/http/data.sdk.gen.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by protoc-gen-go-flipt-sdk. DO NOT EDIT. - -package http - -import ( - context "context" - fmt "fmt" - data "go.flipt.io/flipt/rpc/flipt/data" - grpc "google.golang.org/grpc" - protojson "google.golang.org/protobuf/encoding/protojson" - io "io" - http "net/http" - url "net/url" -) - -type DataServiceClient struct { - client *http.Client - addr string -} - -func (x *DataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, v *data.EvaluationNamespaceSnapshotRequest, _ ...grpc.CallOption) (*data.EvaluationNamespaceSnapshot, error) { - var body io.Reader - var values url.Values - req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/internal/v1/evaluation/snapshot/namespace/%v", v.Key), body) - if err != nil { - return nil, err - } - req.URL.RawQuery = values.Encode() - resp, err := x.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - var output data.EvaluationNamespaceSnapshot - respData, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - if err := checkResponse(resp, respData); err != nil { - return nil, err - } - if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(respData, &output); err != nil { - return nil, err - } - return &output, nil -} - -func (t Transport) DataClient() data.DataServiceClient { - return &DataServiceClient{client: t.client, addr: t.addr} -} From 528a402ad7876ebf5ea9ed47e40fc6a36420f5f5 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:19:00 -0400 Subject: [PATCH 07/39] chore: add ability to skip generating sdks --- internal/cmd/protoc-gen-go-flipt-sdk/grpc.go | 15 ++++++++ internal/cmd/protoc-gen-go-flipt-sdk/http.go | 14 ++++++++ internal/cmd/protoc-gen-go-flipt-sdk/main.go | 10 ++++++ rpc/flipt/evaluation/evaluation.proto | 1 + sdk/go/evaluation.sdk.gen.go | 19 ---------- sdk/go/grpc/grpc.sdk.gen.go | 4 --- sdk/go/http/evaluation.sdk.gen.go | 37 -------------------- 7 files changed, 40 insertions(+), 60 deletions(-) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go index 63bd613487..f3fe0fb46f 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go @@ -36,6 +36,14 @@ func generateGRPC(gen *protogen.Plugin) { ) if len(file.Services) < 2 { + srv := file.Services[0] + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + returnType := file.Services[0].GoName + "Client" g.P("func (t Transport) ", method, "() ", relativeImport(g, file, returnType), "{") g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)") @@ -52,6 +60,13 @@ func generateGRPC(gen *protogen.Plugin) { g.P("}\n") for _, srv := range file.Services { + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + returnType := srv.GoName + "Client" g.P("func (t ", groupType, ") ", returnType, "() ", relativeImport(g, file, returnType), " {") g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)") diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/http.go b/internal/cmd/protoc-gen-go-flipt-sdk/http.go index a15656dae6..5ee1f5d930 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/http.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/http.go @@ -141,6 +141,13 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { if len(file.Services) < 2 { srv := file.Services[0] + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + returnType := srv.GoName + "Client" g.P("type ", returnType, " struct {") @@ -168,6 +175,13 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { g.P("}\n") for _, srv := range file.Services { + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + var ( returnType = srv.GoName + "Client" unexportedReturnType = unexport(returnType) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/main.go b/internal/cmd/protoc-gen-go-flipt-sdk/main.go index dfb7e663c4..9a78c5fcc6 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/main.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/main.go @@ -13,6 +13,8 @@ import ( const ( importPath = "go.flipt.io/flipt/sdk/go" emptyImport = "google.golang.org/protobuf/types/known/emptypb" + + ignoreDecl = "flipt:sdk:ignore" ) func main() { @@ -30,6 +32,7 @@ func main() { // warning. gen.SupportedFeatures |= uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) for _, f := range gen.Files { + if !f.Generate { continue } @@ -129,6 +132,13 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri } for _, srv := range file.Services { + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + serviceName := srv.GoName if oneServicePackage { serviceName = typ diff --git a/rpc/flipt/evaluation/evaluation.proto b/rpc/flipt/evaluation/evaluation.proto index df97420fe2..8b5b2c7599 100644 --- a/rpc/flipt/evaluation/evaluation.proto +++ b/rpc/flipt/evaluation/evaluation.proto @@ -162,6 +162,7 @@ message EvaluationNamespaceSnapshotRequest { string key = 1; } +// flipt:sdk:ignore service DataService { rpc EvaluationSnapshotNamespace(EvaluationNamespaceSnapshotRequest) returns (EvaluationNamespaceSnapshot); } diff --git a/sdk/go/evaluation.sdk.gen.go b/sdk/go/evaluation.sdk.gen.go index ed57289df5..0dac688afd 100644 --- a/sdk/go/evaluation.sdk.gen.go +++ b/sdk/go/evaluation.sdk.gen.go @@ -51,22 +51,3 @@ func (x *EvaluationService) Batch(ctx context.Context, v *evaluation.BatchEvalua } return x.transport.Batch(ctx, v) } - -type DataService struct { - transport evaluation.DataServiceClient - tokenProvider ClientTokenProvider -} - -func (s Evaluation) DataService() *DataService { - return &DataService{ - transport: s.transport.DataServiceClient(), - tokenProvider: s.tokenProvider, - } -} -func (x *DataService) EvaluationSnapshotNamespace(ctx context.Context, v *evaluation.EvaluationNamespaceSnapshotRequest) (*evaluation.EvaluationNamespaceSnapshot, error) { - ctx, err := authenticate(ctx, x.tokenProvider) - if err != nil { - return nil, err - } - return x.transport.EvaluationSnapshotNamespace(ctx, v) -} diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index b1387c99a0..1cefb6f63e 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -65,10 +65,6 @@ func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationService return evaluation.NewEvaluationServiceClient(t.cc) } -func (t evaluationClient) DataServiceClient() evaluation.DataServiceClient { - return evaluation.NewDataServiceClient(t.cc) -} - func (t Transport) EvaluationClient() _go.EvaluationClient { return evaluationClient{cc: t.cc} } diff --git a/sdk/go/http/evaluation.sdk.gen.go b/sdk/go/http/evaluation.sdk.gen.go index 1a4bfb1da4..ed9dbadee7 100644 --- a/sdk/go/http/evaluation.sdk.gen.go +++ b/sdk/go/http/evaluation.sdk.gen.go @@ -5,7 +5,6 @@ package http import ( bytes "bytes" context "context" - fmt "fmt" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" _go "go.flipt.io/flipt/sdk/go" grpc "google.golang.org/grpc" @@ -125,42 +124,6 @@ func (x *evaluationServiceClient) Batch(ctx context.Context, v *evaluation.Batch return &output, nil } -func (t evaluationClient) DataServiceClient() evaluation.DataServiceClient { - return &dataServiceClient{client: t.client, addr: t.addr} -} - -type dataServiceClient struct { - client *http.Client - addr string -} - -func (x *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, v *evaluation.EvaluationNamespaceSnapshotRequest, _ ...grpc.CallOption) (*evaluation.EvaluationNamespaceSnapshot, error) { - var body io.Reader - var values url.Values - req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/internal/v1/evaluation/snapshot/namespace/%v", v.Key), body) - if err != nil { - return nil, err - } - req.URL.RawQuery = values.Encode() - resp, err := x.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - var output evaluation.EvaluationNamespaceSnapshot - respData, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - if err := checkResponse(resp, respData); err != nil { - return nil, err - } - if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(respData, &output); err != nil { - return nil, err - } - return &output, nil -} - func (t Transport) EvaluationClient() _go.EvaluationClient { return evaluationClient{client: t.client, addr: t.addr} } From f043c4e022667f2c123ed7a5cb240764582d93ee Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:31:58 -0400 Subject: [PATCH 08/39] chore: dont generate interface method --- internal/cmd/protoc-gen-go-flipt-sdk/grpc.go | 14 ++++---------- internal/cmd/protoc-gen-go-flipt-sdk/http.go | 14 ++++---------- internal/cmd/protoc-gen-go-flipt-sdk/main.go | 19 ++++++++++++++----- sdk/go/evaluation.sdk.gen.go | 1 - 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go index f3fe0fb46f..f3878c2efa 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go @@ -37,11 +37,8 @@ func generateGRPC(gen *protogen.Plugin) { if len(file.Services) < 2 { srv := file.Services[0] - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } returnType := file.Services[0].GoName + "Client" @@ -60,11 +57,8 @@ func generateGRPC(gen *protogen.Plugin) { g.P("}\n") for _, srv := range file.Services { - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } returnType := srv.GoName + "Client" diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/http.go b/internal/cmd/protoc-gen-go-flipt-sdk/http.go index 5ee1f5d930..e2c310c8eb 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/http.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/http.go @@ -141,11 +141,8 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { if len(file.Services) < 2 { srv := file.Services[0] - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } returnType := srv.GoName + "Client" @@ -175,11 +172,8 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { g.P("}\n") for _, srv := range file.Services { - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } var ( diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/main.go b/internal/cmd/protoc-gen-go-flipt-sdk/main.go index 9a78c5fcc6..8c7b9dfcd0 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/main.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/main.go @@ -121,6 +121,10 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri g.P("type ", typ, "Client interface {") for _, srv := range file.Services { + if shouldIgnoreService(srv) { + continue + } + g.P(srv.GoName+"Client", "()", relativeImport(g, file, srv.GoName+"Client")) } g.P("}\n") @@ -132,11 +136,8 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri } for _, srv := range file.Services { - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } serviceName := srv.GoName @@ -271,3 +272,11 @@ func New(t Transport, opts ...Option) SDK { return sdk }` + +func shouldIgnoreService(srv *protogen.Service) bool { + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + return strings.TrimSpace(leading) == ignoreDecl + } + return false +} diff --git a/sdk/go/evaluation.sdk.gen.go b/sdk/go/evaluation.sdk.gen.go index 0dac688afd..208f23986c 100644 --- a/sdk/go/evaluation.sdk.gen.go +++ b/sdk/go/evaluation.sdk.gen.go @@ -9,7 +9,6 @@ import ( type EvaluationClient interface { EvaluationServiceClient() evaluation.EvaluationServiceClient - DataServiceClient() evaluation.DataServiceClient } type Evaluation struct { From e82cea9c2b545c5f86845ca1a703ec98d30a0d04 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:25:23 -0400 Subject: [PATCH 09/39] chore: fix build --- internal/cmd/protoc-gen-go-flipt-sdk/grpc.go | 9 -------- internal/cmd/protoc-gen-go-flipt-sdk/http.go | 8 ------- internal/cmd/protoc-gen-go-flipt-sdk/main.go | 12 +++-------- sdk/go/evaluation.sdk.gen.go | 21 +++---------------- sdk/go/grpc/grpc.sdk.gen.go | 10 +-------- sdk/go/http/evaluation.sdk.gen.go | 22 ++++++-------------- sdk/go/sdk.gen.go | 3 ++- 7 files changed, 15 insertions(+), 70 deletions(-) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go index f3878c2efa..63bd613487 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go @@ -36,11 +36,6 @@ func generateGRPC(gen *protogen.Plugin) { ) if len(file.Services) < 2 { - srv := file.Services[0] - if shouldIgnoreService(srv) { - continue - } - returnType := file.Services[0].GoName + "Client" g.P("func (t Transport) ", method, "() ", relativeImport(g, file, returnType), "{") g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)") @@ -57,10 +52,6 @@ func generateGRPC(gen *protogen.Plugin) { g.P("}\n") for _, srv := range file.Services { - if shouldIgnoreService(srv) { - continue - } - returnType := srv.GoName + "Client" g.P("func (t ", groupType, ") ", returnType, "() ", relativeImport(g, file, returnType), " {") g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)") diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/http.go b/internal/cmd/protoc-gen-go-flipt-sdk/http.go index e2c310c8eb..a15656dae6 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/http.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/http.go @@ -141,10 +141,6 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { if len(file.Services) < 2 { srv := file.Services[0] - if shouldIgnoreService(srv) { - continue - } - returnType := srv.GoName + "Client" g.P("type ", returnType, " struct {") @@ -172,10 +168,6 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { g.P("}\n") for _, srv := range file.Services { - if shouldIgnoreService(srv) { - continue - } - var ( returnType = srv.GoName + "Client" unexportedReturnType = unexport(returnType) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/main.go b/internal/cmd/protoc-gen-go-flipt-sdk/main.go index 8c7b9dfcd0..2f8a468135 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/main.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/main.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" "os" + "slices" "strings" "google.golang.org/protobuf/compiler/protogen" @@ -32,11 +33,12 @@ func main() { // warning. gen.SupportedFeatures |= uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) for _, f := range gen.Files { - if !f.Generate { continue } + f.Services = slices.DeleteFunc(f.Services, shouldIgnoreService) + generateSubSDK(gen, f) } @@ -121,10 +123,6 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri g.P("type ", typ, "Client interface {") for _, srv := range file.Services { - if shouldIgnoreService(srv) { - continue - } - g.P(srv.GoName+"Client", "()", relativeImport(g, file, srv.GoName+"Client")) } g.P("}\n") @@ -136,10 +134,6 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri } for _, srv := range file.Services { - if shouldIgnoreService(srv) { - continue - } - serviceName := srv.GoName if oneServicePackage { serviceName = typ diff --git a/sdk/go/evaluation.sdk.gen.go b/sdk/go/evaluation.sdk.gen.go index 208f23986c..2a1c894f75 100644 --- a/sdk/go/evaluation.sdk.gen.go +++ b/sdk/go/evaluation.sdk.gen.go @@ -7,27 +7,12 @@ import ( evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" ) -type EvaluationClient interface { - EvaluationServiceClient() evaluation.EvaluationServiceClient -} - type Evaluation struct { - transport EvaluationClient - tokenProvider ClientTokenProvider -} - -type EvaluationService struct { transport evaluation.EvaluationServiceClient tokenProvider ClientTokenProvider } -func (s Evaluation) EvaluationService() *EvaluationService { - return &EvaluationService{ - transport: s.transport.EvaluationServiceClient(), - tokenProvider: s.tokenProvider, - } -} -func (x *EvaluationService) Boolean(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.BooleanEvaluationResponse, error) { +func (x *Evaluation) Boolean(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.BooleanEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err @@ -35,7 +20,7 @@ func (x *EvaluationService) Boolean(ctx context.Context, v *evaluation.Evaluatio return x.transport.Boolean(ctx, v) } -func (x *EvaluationService) Variant(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.VariantEvaluationResponse, error) { +func (x *Evaluation) Variant(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.VariantEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err @@ -43,7 +28,7 @@ func (x *EvaluationService) Variant(ctx context.Context, v *evaluation.Evaluatio return x.transport.Variant(ctx, v) } -func (x *EvaluationService) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest) (*evaluation.BatchEvaluationResponse, error) { +func (x *Evaluation) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest) (*evaluation.BatchEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index 1cefb6f63e..d586e1138d 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -57,18 +57,10 @@ func (t Transport) FliptClient() flipt.FliptClient { return flipt.NewFliptClient(t.cc) } -type evaluationClient struct { - cc grpc.ClientConnInterface -} - -func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationServiceClient { +func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { return evaluation.NewEvaluationServiceClient(t.cc) } -func (t Transport) EvaluationClient() _go.EvaluationClient { - return evaluationClient{cc: t.cc} -} - func (t Transport) MetaClient() meta.MetadataServiceClient { return meta.NewMetadataServiceClient(t.cc) } diff --git a/sdk/go/http/evaluation.sdk.gen.go b/sdk/go/http/evaluation.sdk.gen.go index ed9dbadee7..ac6c812053 100644 --- a/sdk/go/http/evaluation.sdk.gen.go +++ b/sdk/go/http/evaluation.sdk.gen.go @@ -6,7 +6,6 @@ import ( bytes "bytes" context "context" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" - _go "go.flipt.io/flipt/sdk/go" grpc "google.golang.org/grpc" protojson "google.golang.org/protobuf/encoding/protojson" io "io" @@ -14,21 +13,12 @@ import ( url "net/url" ) -type evaluationClient struct { +type EvaluationServiceClient struct { client *http.Client addr string } -func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationServiceClient { - return &evaluationServiceClient{client: t.client, addr: t.addr} -} - -type evaluationServiceClient struct { - client *http.Client - addr string -} - -func (x *evaluationServiceClient) Boolean(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.BooleanEvaluationResponse, error) { +func (x *EvaluationServiceClient) Boolean(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.BooleanEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -60,7 +50,7 @@ func (x *evaluationServiceClient) Boolean(ctx context.Context, v *evaluation.Eva return &output, nil } -func (x *evaluationServiceClient) Variant(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.VariantEvaluationResponse, error) { +func (x *EvaluationServiceClient) Variant(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.VariantEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -92,7 +82,7 @@ func (x *evaluationServiceClient) Variant(ctx context.Context, v *evaluation.Eva return &output, nil } -func (x *evaluationServiceClient) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest, _ ...grpc.CallOption) (*evaluation.BatchEvaluationResponse, error) { +func (x *EvaluationServiceClient) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest, _ ...grpc.CallOption) (*evaluation.BatchEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -124,6 +114,6 @@ func (x *evaluationServiceClient) Batch(ctx context.Context, v *evaluation.Batch return &output, nil } -func (t Transport) EvaluationClient() _go.EvaluationClient { - return evaluationClient{client: t.client, addr: t.addr} +func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { + return &EvaluationServiceClient{client: t.client, addr: t.addr} } diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index a50383b193..ac80f31de7 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -5,6 +5,7 @@ package sdk import ( context "context" flipt "go.flipt.io/flipt/rpc/flipt" + evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" metadata "google.golang.org/grpc/metadata" ) @@ -12,7 +13,7 @@ import ( type Transport interface { AuthClient() AuthClient FliptClient() flipt.FliptClient - EvaluationClient() EvaluationClient + EvaluationClient() evaluation.EvaluationServiceClient MetaClient() meta.MetadataServiceClient } From 3b30b45a0a530d08afbdfd5ad10755c35774fb37 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:07:13 -0400 Subject: [PATCH 10/39] chore: refactor internal storage types to use proto types --- internal/server/evaluation/data/server.go | 38 +- internal/server/evaluation/evaluation.go | 21 +- internal/server/evaluation/evaluation_test.go | 263 +++---- .../server/evaluation/legacy_evaluator.go | 16 +- .../evaluation/legacy_evaluator_test.go | 639 +++++++++--------- .../server/middleware/grpc/middleware_test.go | 96 +-- internal/storage/cache/cache_test.go | 4 +- internal/storage/fs/snapshot.go | 66 +- internal/storage/fs/snapshot_test.go | 36 +- internal/storage/sql/common/evaluation.go | 101 +-- internal/storage/sql/evaluation_test.go | 156 ++--- internal/storage/storage.go | 56 +- 12 files changed, 716 insertions(+), 776 deletions(-) diff --git a/internal/server/evaluation/data/server.go b/internal/server/evaluation/data/server.go index 22ad7139d3..a9475f9aa9 100644 --- a/internal/server/evaluation/data/server.go +++ b/internal/server/evaluation/data/server.go @@ -78,25 +78,25 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio for _, r := range rules { rule := &evaluation.EvaluationRule{ - Id: r.ID, + Id: r.Id, Rank: r.Rank, SegmentOperator: r.SegmentOperator, } for _, s := range r.Segments { // optimization: reuse segment if already seen - if ss, ok := segments[s.SegmentKey]; ok { + if ss, ok := segments[s.Key]; ok { rule.Segments = append(rule.Segments, ss) } else { ss := &evaluation.EvaluationSegment{ - Key: s.SegmentKey, + Key: s.Key, MatchType: s.MatchType, } for _, c := range s.Constraints { ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ - Id: c.ID, + Id: c.Id, Type: c.Type, Property: c.Property, Operator: c.Operator, @@ -104,19 +104,19 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio }) } - segments[s.SegmentKey] = ss + segments[s.Key] = ss rule.Segments = append(rule.Segments, ss) } - distributions, err := srv.store.GetEvaluationDistributions(ctx, r.ID) + distributions, err := srv.store.GetEvaluationDistributions(ctx, r.Id) if err != nil { - return nil, fmt.Errorf("getting distributions for rule %q: %w", r.ID, err) + return nil, fmt.Errorf("getting distributions for rule %q: %w", r.Id, err) } // distributions for rule for _, d := range distributions { dist := &evaluation.EvaluationDistribution{ - VariantId: d.VariantID, + VariantId: d.VariantId, VariantKey: d.VariantKey, VariantAttachment: d.VariantAttachment, Rollout: d.Rollout, @@ -137,37 +137,37 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio for _, r := range rollouts { rollout := &evaluation.EvaluationRollout{ - Type: r.RolloutType, + Type: r.Type, Rank: r.Rank, } - switch r.RolloutType { + switch r.Type { case flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE: rollout.Rule = &evaluation.EvaluationRollout_Threshold{ Threshold: &evaluation.EvaluationRolloutThreshold{ - Percentage: r.Threshold.Percentage, - Value: r.Threshold.Value, + Percentage: r.GetThreshold().Percentage, + Value: r.GetThreshold().Value, }, } case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: segment := &evaluation.EvaluationRolloutSegment{ - Value: r.Segment.Value, - SegmentOperator: r.Segment.SegmentOperator, + Value: r.GetSegment().Value, + SegmentOperator: r.GetSegment().SegmentOperator, } - for _, s := range r.Segment.Segments { + for _, s := range r.GetSegment().Segments { // optimization: reuse segment if already seen - ss, ok := segments[s.SegmentKey] + ss, ok := segments[s.Key] if !ok { ss := &evaluation.EvaluationSegment{ - Key: s.SegmentKey, + Key: s.Key, MatchType: s.MatchType, } for _, c := range s.Constraints { ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ - Id: c.ID, + Id: c.Id, Type: c.Type, Property: c.Property, Operator: c.Operator, @@ -175,7 +175,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio }) } - segments[s.SegmentKey] = ss + segments[s.Key] = ss } segment.Segments = append(segment.Segments, ss) diff --git a/internal/server/evaluation/evaluation.go b/internal/server/evaluation/evaluation.go index 4c7c52a5c0..176c0922d3 100644 --- a/internal/server/evaluation/evaluation.go +++ b/internal/server/evaluation/evaluation.go @@ -183,29 +183,32 @@ func (s *Server) boolean(ctx context.Context, flag *flipt.Flag, r *rpcevaluation lastRank = rollout.Rank - if rollout.Threshold != nil { + if rollout.GetThreshold() != nil { // consistent hashing based on the entity id and flag key. hash := crc32.ChecksumIEEE([]byte(r.EntityId + r.FlagKey)) normalizedValue := float32(int(hash) % 100) // if this case does not hold, fall through to the next rollout. - if normalizedValue < rollout.Threshold.Percentage { - resp.Enabled = rollout.Threshold.Value + if normalizedValue < rollout.GetThreshold().Percentage { + resp.Enabled = rollout.GetThreshold().Value resp.Reason = rpcevaluation.EvaluationReason_MATCH_EVALUATION_REASON resp.FlagKey = flag.Key s.logger.Debug("threshold based matched", zap.Int("rank", int(rollout.Rank)), zap.String("rollout_type", "threshold")) return resp, nil } - } else if rollout.Segment != nil { + continue + } + + if rollout.GetSegment() != nil { var ( segmentMatches = 0 segmentKeys = []string{} ) - for k, v := range rollout.Segment.Segments { - segmentKeys = append(segmentKeys, k) + for _, v := range rollout.GetSegment().Segments { + segmentKeys = append(segmentKeys, v.Key) matched, reason, err := matchConstraints(r.Context, v.Constraints, v.MatchType) if err != nil { return nil, err @@ -218,20 +221,20 @@ func (s *Server) boolean(ctx context.Context, flag *flipt.Flag, r *rpcevaluation } } - switch rollout.Segment.SegmentOperator { + switch rollout.GetSegment().SegmentOperator { case flipt.SegmentOperator_OR_SEGMENT_OPERATOR: if segmentMatches < 1 { s.logger.Debug("did not match ANY segments") continue } case flipt.SegmentOperator_AND_SEGMENT_OPERATOR: - if len(rollout.Segment.Segments) != segmentMatches { + if len(rollout.GetSegment().Segments) != segmentMatches { s.logger.Debug("did not match ALL segments") continue } } - resp.Enabled = rollout.Segment.Value + resp.Enabled = rollout.GetSegment().Value resp.Reason = rpcevaluation.EvaluationReason_MATCH_EVALUATION_REASON resp.FlagKey = flag.Key diff --git a/internal/server/evaluation/evaluation_test.go b/internal/server/evaluation/evaluation_test.go index 91910427ad..be61490211 100644 --- a/internal/server/evaluation/evaluation_test.go +++ b/internal/server/evaluation/evaluation_test.go @@ -153,16 +153,15 @@ func TestVariant_Success(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, namespaceKey, flagKey).Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: flagKey, - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "hello", Operator: flipt.OpEQ, @@ -301,12 +300,13 @@ func TestBoolean_DefaultRuleFallthrough_WithPercentageRollout(t *testing.T) { store.On("GetEvaluationRollouts", mock.Anything, namespaceKey, flagKey).Return([]*storage.EvaluationRollout{ { - NamespaceKey: namespaceKey, - Rank: 1, - RolloutType: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, - Threshold: &storage.RolloutThreshold{ - Percentage: 5, - Value: false, + Rank: 1, + Type: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, + Rule: &rpcevaluation.EvaluationRollout_Threshold{ + Threshold: &storage.RolloutThreshold{ + Percentage: 5, + Value: false, + }, }, }, }, nil) @@ -345,12 +345,13 @@ func TestBoolean_PercentageRuleMatch(t *testing.T) { store.On("GetEvaluationRollouts", mock.Anything, namespaceKey, flagKey).Return([]*storage.EvaluationRollout{ { - NamespaceKey: namespaceKey, - Rank: 1, - RolloutType: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, - Threshold: &storage.RolloutThreshold{ - Percentage: 70, - Value: false, + Rank: 1, + Type: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, + Rule: &rpcevaluation.EvaluationRollout_Threshold{ + Threshold: &storage.RolloutThreshold{ + Percentage: 70, + Value: false, + }, }, }, }, nil) @@ -389,31 +390,33 @@ func TestBoolean_PercentageRuleFallthrough_SegmentMatch(t *testing.T) { store.On("GetEvaluationRollouts", mock.Anything, namespaceKey, flagKey).Return([]*storage.EvaluationRollout{ { - NamespaceKey: namespaceKey, - Rank: 1, - RolloutType: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, - Threshold: &storage.RolloutThreshold{ - Percentage: 5, - Value: false, + Rank: 1, + Type: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, + Rule: &rpcevaluation.EvaluationRollout_Threshold{ + Threshold: &storage.RolloutThreshold{ + Percentage: 5, + Value: false, + }, }, }, { - NamespaceKey: namespaceKey, - RolloutType: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, - Rank: 2, - Segment: &storage.RolloutSegment{ - Value: true, - SegmentOperator: flipt.SegmentOperator_OR_SEGMENT_OPERATOR, - Segments: map[string]*storage.EvaluationSegment{ - "test-segment": { - SegmentKey: "test-segment", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ - { - Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, - Property: "hello", - Operator: flipt.OpEQ, - Value: "world", + Type: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, + Rank: 2, + Rule: &rpcevaluation.EvaluationRollout_Segment{ + Segment: &storage.RolloutSegment{ + Value: true, + SegmentOperator: flipt.SegmentOperator_OR_SEGMENT_OPERATOR, + Segments: []*storage.EvaluationSegment{ + { + Key: "test-segment", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ + { + Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, + Property: "hello", + Operator: flipt.OpEQ, + Value: "world", + }, }, }, }, @@ -457,28 +460,29 @@ func TestBoolean_SegmentMatch_MultipleConstraints(t *testing.T) { store.On("GetEvaluationRollouts", mock.Anything, namespaceKey, flagKey).Return([]*storage.EvaluationRollout{ { - NamespaceKey: namespaceKey, - RolloutType: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, - Rank: 1, - Segment: &storage.RolloutSegment{ - Value: true, - SegmentOperator: flipt.SegmentOperator_OR_SEGMENT_OPERATOR, - Segments: map[string]*storage.EvaluationSegment{ - "test-segment": { - SegmentKey: "test-segment", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ - { - Type: flipt.ComparisonType_NUMBER_COMPARISON_TYPE, - Property: "pitimes100", - Operator: flipt.OpEQ, - Value: "314", - }, - { - Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, - Property: "hello", - Operator: flipt.OpEQ, - Value: "world", + Type: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, + Rank: 1, + Rule: &rpcevaluation.EvaluationRollout_Segment{ + Segment: &storage.RolloutSegment{ + Value: true, + SegmentOperator: flipt.SegmentOperator_OR_SEGMENT_OPERATOR, + Segments: []*storage.EvaluationSegment{ + { + Key: "test-segment", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ + { + Type: flipt.ComparisonType_NUMBER_COMPARISON_TYPE, + Property: "pitimes100", + Operator: flipt.OpEQ, + Value: "314", + }, + { + Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, + Property: "hello", + Operator: flipt.OpEQ, + Value: "world", + }, }, }, }, @@ -522,34 +526,35 @@ func TestBoolean_SegmentMatch_MultipleSegments_WithAnd(t *testing.T) { store.On("GetEvaluationRollouts", mock.Anything, namespaceKey, flagKey).Return([]*storage.EvaluationRollout{ { - NamespaceKey: namespaceKey, - RolloutType: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, - Rank: 1, - Segment: &storage.RolloutSegment{ - Value: true, - SegmentOperator: flipt.SegmentOperator_AND_SEGMENT_OPERATOR, - Segments: map[string]*storage.EvaluationSegment{ - "test-segment": { - SegmentKey: "test-segment", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ - { - Type: flipt.ComparisonType_NUMBER_COMPARISON_TYPE, - Property: "pitimes100", - Operator: flipt.OpEQ, - Value: "314", + Type: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, + Rank: 1, + Rule: &rpcevaluation.EvaluationRollout_Segment{ + Segment: &storage.RolloutSegment{ + Value: true, + SegmentOperator: flipt.SegmentOperator_AND_SEGMENT_OPERATOR, + Segments: []*storage.EvaluationSegment{ + { + Key: "test-segment", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ + { + Type: flipt.ComparisonType_NUMBER_COMPARISON_TYPE, + Property: "pitimes100", + Operator: flipt.OpEQ, + Value: "314", + }, }, }, - }, - "another-segment": { - SegmentKey: "another-segment", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ - { - Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, - Property: "hello", - Operator: flipt.OpEQ, - Value: "world", + { + Key: "another-segment", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ + { + Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, + Property: "hello", + Operator: flipt.OpEQ, + Value: "world", + }, }, }, }, @@ -594,31 +599,33 @@ func TestBoolean_RulesOutOfOrder(t *testing.T) { store.On("GetEvaluationRollouts", mock.Anything, namespaceKey, flagKey).Return([]*storage.EvaluationRollout{ { - NamespaceKey: namespaceKey, - Rank: 1, - RolloutType: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, - Threshold: &storage.RolloutThreshold{ - Percentage: 5, - Value: false, + Rank: 1, + Type: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, + Rule: &rpcevaluation.EvaluationRollout_Threshold{ + Threshold: &storage.RolloutThreshold{ + Percentage: 5, + Value: false, + }, }, }, { - NamespaceKey: namespaceKey, - RolloutType: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, - Rank: 0, - Segment: &storage.RolloutSegment{ - Value: true, - SegmentOperator: flipt.SegmentOperator_OR_SEGMENT_OPERATOR, - Segments: map[string]*storage.EvaluationSegment{ - "test-segment": { - SegmentKey: "test-segment", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ - { - Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, - Property: "hello", - Operator: flipt.OpEQ, - Value: "world", + Type: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, + Rank: 0, + Rule: &rpcevaluation.EvaluationRollout_Segment{ + Segment: &storage.RolloutSegment{ + Value: true, + SegmentOperator: flipt.SegmentOperator_OR_SEGMENT_OPERATOR, + Segments: []*storage.EvaluationSegment{ + { + Key: "test-segment", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ + { + Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, + Property: "hello", + Operator: flipt.OpEQ, + Value: "world", + }, }, }, }, @@ -735,12 +742,13 @@ func TestBatch_Success(t *testing.T) { store.On("GetEvaluationRollouts", mock.Anything, namespaceKey, flagKey).Return([]*storage.EvaluationRollout{ { - NamespaceKey: namespaceKey, - Rank: 1, - RolloutType: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, - Threshold: &storage.RolloutThreshold{ - Percentage: 80, - Value: true, + Rank: 1, + Type: flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE, + Rule: &rpcevaluation.EvaluationRollout_Threshold{ + Threshold: &storage.RolloutThreshold{ + Percentage: 80, + Value: true, + }, }, }, }, nil) @@ -748,16 +756,15 @@ func TestBatch_Success(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, namespaceKey, variantFlagKey).Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: variantFlagKey, - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "hello", Operator: flipt.OpEQ, diff --git a/internal/server/evaluation/legacy_evaluator.go b/internal/server/evaluation/legacy_evaluator.go index 53a66c9fe4..f803c8bf9e 100644 --- a/internal/server/evaluation/legacy_evaluator.go +++ b/internal/server/evaluation/legacy_evaluator.go @@ -119,7 +119,7 @@ func (e *Evaluator) Evaluate(ctx context.Context, flag *flipt.Flag, r *flipt.Eva segmentKeys := make([]string, 0, len(rule.Segments)) segmentMatches := 0 - for k, v := range rule.Segments { + for _, v := range rule.Segments { matched, reason, err := matchConstraints(r.Context, v.Constraints, v.MatchType) if err != nil { resp.Reason = flipt.EvaluationReason_ERROR_EVALUATION_REASON @@ -128,7 +128,7 @@ func (e *Evaluator) Evaluate(ctx context.Context, flag *flipt.Flag, r *flipt.Eva if matched { e.logger.Debug(reason) - segmentKeys = append(segmentKeys, k) + segmentKeys = append(segmentKeys, v.Key) segmentMatches++ } } @@ -155,7 +155,7 @@ func (e *Evaluator) Evaluate(ctx context.Context, flag *flipt.Flag, r *flipt.Eva resp.SegmentKeys = segmentKeys } - distributions, err := e.store.GetEvaluationDistributions(ctx, rule.ID) + distributions, err := e.store.GetEvaluationDistributions(ctx, rule.Id) if err != nil { resp.Reason = flipt.EvaluationReason_ERROR_EVALUATION_REASON return resp, err @@ -219,7 +219,7 @@ func (e *Evaluator) Evaluate(ctx context.Context, flag *flipt.Flag, r *flipt.Eva // matchConstraints is a utility function that will return if all or any constraints have matched for a segment depending // on the match type. -func matchConstraints(evalCtx map[string]string, constraints []storage.EvaluationConstraint, segmentMatchType flipt.MatchType) (bool, string, error) { +func matchConstraints(evalCtx map[string]string, constraints []*storage.EvaluationConstraint, segmentMatchType flipt.MatchType) (bool, string, error) { constraintMatches := 0 var reason string @@ -309,7 +309,7 @@ const ( percentMultiplier float32 = float32(totalBucketNum) / 100 ) -func matchesString(c storage.EvaluationConstraint, v string) bool { +func matchesString(c *storage.EvaluationConstraint, v string) bool { switch c.Operator { case flipt.OpEmpty: return len(strings.TrimSpace(v)) == 0 @@ -337,7 +337,7 @@ func matchesString(c storage.EvaluationConstraint, v string) bool { return false } -func matchesNumber(c storage.EvaluationConstraint, v string) (bool, error) { +func matchesNumber(c *storage.EvaluationConstraint, v string) (bool, error) { switch c.Operator { case flipt.OpNotPresent: return len(strings.TrimSpace(v)) == 0, nil @@ -379,7 +379,7 @@ func matchesNumber(c storage.EvaluationConstraint, v string) (bool, error) { return false, nil } -func matchesBool(c storage.EvaluationConstraint, v string) (bool, error) { +func matchesBool(c *storage.EvaluationConstraint, v string) (bool, error) { switch c.Operator { case flipt.OpNotPresent: return len(strings.TrimSpace(v)) == 0, nil @@ -407,7 +407,7 @@ func matchesBool(c storage.EvaluationConstraint, v string) (bool, error) { return false, nil } -func matchesDateTime(c storage.EvaluationConstraint, v string) (bool, error) { +func matchesDateTime(c *storage.EvaluationConstraint, v string) (bool, error) { switch c.Operator { case flipt.OpNotPresent: return len(strings.TrimSpace(v)) == 0, nil diff --git a/internal/server/evaluation/legacy_evaluator_test.go b/internal/server/evaluation/legacy_evaluator_test.go index 0478304089..f857f594a9 100644 --- a/internal/server/evaluation/legacy_evaluator_test.go +++ b/internal/server/evaluation/legacy_evaluator_test.go @@ -17,13 +17,13 @@ import ( func Test_matchesString(t *testing.T) { tests := []struct { name string - constraint storage.EvaluationConstraint + constraint *storage.EvaluationConstraint value string wantMatch bool }{ { name: "eq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "bar", @@ -33,7 +33,7 @@ func Test_matchesString(t *testing.T) { }, { name: "negative eq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "bar", @@ -42,7 +42,7 @@ func Test_matchesString(t *testing.T) { }, { name: "neq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "neq", Value: "bar", @@ -52,7 +52,7 @@ func Test_matchesString(t *testing.T) { }, { name: "negative neq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "neq", Value: "bar", @@ -61,7 +61,7 @@ func Test_matchesString(t *testing.T) { }, { name: "empty", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "empty", }, @@ -70,7 +70,7 @@ func Test_matchesString(t *testing.T) { }, { name: "negative empty", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "empty", }, @@ -78,7 +78,7 @@ func Test_matchesString(t *testing.T) { }, { name: "not empty", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "notempty", }, @@ -87,7 +87,7 @@ func Test_matchesString(t *testing.T) { }, { name: "negative not empty", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "notempty", }, @@ -95,7 +95,7 @@ func Test_matchesString(t *testing.T) { }, { name: "unknown operator", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "foo", Value: "bar", @@ -104,7 +104,7 @@ func Test_matchesString(t *testing.T) { }, { name: "prefix", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "prefix", Value: "ba", @@ -114,7 +114,7 @@ func Test_matchesString(t *testing.T) { }, { name: "negative prefix", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "prefix", Value: "bar", @@ -123,7 +123,7 @@ func Test_matchesString(t *testing.T) { }, { name: "suffix", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "suffix", Value: "ar", @@ -133,7 +133,7 @@ func Test_matchesString(t *testing.T) { }, { name: "negative suffix", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "suffix", Value: "bar", @@ -158,14 +158,14 @@ func Test_matchesString(t *testing.T) { func Test_matchesNumber(t *testing.T) { tests := []struct { name string - constraint storage.EvaluationConstraint + constraint *storage.EvaluationConstraint value string wantMatch bool wantErr bool }{ { name: "present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "present", }, @@ -174,14 +174,14 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "present", }, }, { name: "not present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "notpresent", }, @@ -189,7 +189,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative notpresent", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "notpresent", }, @@ -197,7 +197,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "NAN constraint value", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "bar", @@ -207,7 +207,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "NAN context value", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "5", @@ -217,7 +217,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "eq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "42.0", @@ -227,7 +227,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative eq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "42.0", @@ -236,7 +236,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "neq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "neq", Value: "42.0", @@ -246,7 +246,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative neq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "neq", Value: "42.0", @@ -255,7 +255,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "lt", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "lt", Value: "42.0", @@ -265,7 +265,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative lt", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "lt", Value: "42.0", @@ -274,7 +274,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "lte", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "lte", Value: "42.0", @@ -284,7 +284,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative lte", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "lte", Value: "42.0", @@ -293,7 +293,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "gt", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "gt", Value: "10.11", @@ -303,7 +303,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative gt", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "gt", Value: "10.11", @@ -312,7 +312,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "gte", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "gte", Value: "10.11", @@ -322,7 +322,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative gte", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "gte", Value: "10.11", @@ -331,7 +331,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "empty value", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "0.11", @@ -339,7 +339,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "unknown operator", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "foo", Value: "0.11", @@ -348,7 +348,7 @@ func Test_matchesNumber(t *testing.T) { }, { name: "negative suffix empty value", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "suffix", Value: "bar", @@ -383,14 +383,14 @@ func Test_matchesNumber(t *testing.T) { func Test_matchesBool(t *testing.T) { tests := []struct { name string - constraint storage.EvaluationConstraint + constraint *storage.EvaluationConstraint value string wantMatch bool wantErr bool }{ { name: "present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "present", }, @@ -399,14 +399,14 @@ func Test_matchesBool(t *testing.T) { }, { name: "negative present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "present", }, }, { name: "not present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "notpresent", }, @@ -414,7 +414,7 @@ func Test_matchesBool(t *testing.T) { }, { name: "negative notpresent", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "notpresent", }, @@ -422,7 +422,7 @@ func Test_matchesBool(t *testing.T) { }, { name: "not a bool", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "true", }, @@ -431,7 +431,7 @@ func Test_matchesBool(t *testing.T) { }, { name: "is true", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "true", }, @@ -440,7 +440,7 @@ func Test_matchesBool(t *testing.T) { }, { name: "negative is true", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "true", }, @@ -448,7 +448,7 @@ func Test_matchesBool(t *testing.T) { }, { name: "is false", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "false", }, @@ -457,7 +457,7 @@ func Test_matchesBool(t *testing.T) { }, { name: "negative is false", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "false", }, @@ -465,14 +465,14 @@ func Test_matchesBool(t *testing.T) { }, { name: "empty value", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "false", }, }, { name: "unknown operator", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "foo", }, @@ -507,14 +507,14 @@ func Test_matchesBool(t *testing.T) { func Test_matchesDateTime(t *testing.T) { tests := []struct { name string - constraint storage.EvaluationConstraint + constraint *storage.EvaluationConstraint value string wantMatch bool wantErr bool }{ { name: "present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "present", }, @@ -523,14 +523,14 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "present", }, }, { name: "not present", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "notpresent", }, @@ -538,7 +538,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative notpresent", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "notpresent", }, @@ -546,7 +546,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "not a datetime constraint value", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "bar", @@ -556,7 +556,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "not a datetime context value", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "2006-01-02T15:04:05Z", @@ -566,7 +566,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "eq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "2006-01-02T15:04:05Z", @@ -576,7 +576,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "eq date only", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "2006-01-02", @@ -586,7 +586,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative eq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "2006-01-02T15:04:05Z", @@ -595,7 +595,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "neq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "neq", Value: "2006-01-02T15:04:05Z", @@ -605,7 +605,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative neq", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "neq", Value: "2006-01-02T15:04:05Z", @@ -614,7 +614,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative neq date only", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "neq", Value: "2006-01-02", @@ -623,7 +623,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "lt", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "lt", Value: "2006-01-02T15:04:05Z", @@ -633,7 +633,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative lt", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "lt", Value: "2005-01-02T15:04:05Z", @@ -642,7 +642,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "lte", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "lte", Value: "2006-01-02T15:04:05Z", @@ -652,7 +652,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative lte", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "lte", Value: "2006-01-02T15:04:05Z", @@ -661,7 +661,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "gt", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "gt", Value: "2006-01-02T15:04:05Z", @@ -671,7 +671,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative gt", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "gt", Value: "2007-01-02T15:04:05Z", @@ -680,7 +680,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "gte", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "gte", Value: "2006-01-02T15:04:05Z", @@ -690,7 +690,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "negative gte", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "gte", Value: "2006-01-02T15:04:05Z", @@ -699,7 +699,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "empty value", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "eq", Value: "2006-01-02T15:04:05Z", @@ -707,7 +707,7 @@ func Test_matchesDateTime(t *testing.T) { }, { name: "unknown operator", - constraint: storage.EvaluationConstraint{ + constraint: &storage.EvaluationConstraint{ Property: "foo", Operator: "foo", Value: "2006-01-02T15:04:05Z", @@ -849,16 +849,15 @@ func TestEvaluator_RulesOutOfOrder(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 1, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 1, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -869,16 +868,15 @@ func TestEvaluator_RulesOutOfOrder(t *testing.T) { }, }, { - ID: "2", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "2", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -914,16 +912,15 @@ func TestEvaluator_ErrorParsingNumber(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 1, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 1, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_NUMBER_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -958,16 +955,15 @@ func TestEvaluator_ErrorParsingDateTime(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 1, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 1, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_DATETIME_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1003,16 +999,15 @@ func TestEvaluator_ErrorGettingDistributions(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1050,16 +1045,15 @@ func TestEvaluator_MatchAll_NoVariants_NoDistributions(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1138,17 +1132,16 @@ func TestEvaluator_MatchAll_MultipleSegments(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", + Id: "1", Rank: 0, SegmentOperator: flipt.SegmentOperator_AND_SEGMENT_OPERATOR, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1156,12 +1149,12 @@ func TestEvaluator_MatchAll_MultipleSegments(t *testing.T) { }, }, }, - "foo": { - SegmentKey: "foo", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + { + Key: "foo", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "company", Operator: flipt.OpEQ, @@ -1244,17 +1237,16 @@ func TestEvaluator_DistributionNotMatched(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1262,7 +1254,7 @@ func TestEvaluator_DistributionNotMatched(t *testing.T) { }, // constraint: admin (bool) == true { - ID: "3", + Id: "3", Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, Property: "admin", Operator: flipt.OpTrue, @@ -1276,9 +1268,9 @@ func TestEvaluator_DistributionNotMatched(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 10, VariantKey: "boz", VariantAttachment: `{"key":"value"}`, @@ -1311,17 +1303,16 @@ func TestEvaluator_MatchAll_SingleVariantDistribution(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1329,7 +1320,7 @@ func TestEvaluator_MatchAll_SingleVariantDistribution(t *testing.T) { }, // constraint: admin (bool) == true { - ID: "3", + Id: "3", Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, Property: "admin", Operator: flipt.OpTrue, @@ -1343,9 +1334,9 @@ func TestEvaluator_MatchAll_SingleVariantDistribution(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 100, VariantKey: "boz", VariantAttachment: `{"key":"value"}`, @@ -1440,17 +1431,16 @@ func TestEvaluator_MatchAll_RolloutDistribution(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1465,16 +1455,16 @@ func TestEvaluator_MatchAll_RolloutDistribution(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 50, VariantKey: "boz", }, { - ID: "6", - RuleID: "1", - VariantID: "7", + Id: "6", + RuleId: "1", + VariantId: "7", Rollout: 50, VariantKey: "booz", }, @@ -1560,17 +1550,16 @@ func TestEvaluator_MatchAll_RolloutDistribution_MultiRule(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "subscribers": { - SegmentKey: "subscribers", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "subscribers", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: premium_user (bool) == true { - ID: "2", + Id: "2", Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, Property: "premium_user", Operator: flipt.OpTrue, @@ -1580,13 +1569,12 @@ func TestEvaluator_MatchAll_RolloutDistribution_MultiRule(t *testing.T) { }, }, { - ID: "2", - FlagKey: "foo", - Rank: 1, - Segments: map[string]*storage.EvaluationSegment{ - "all_users": { - SegmentKey: "all_users", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Id: "2", + Rank: 1, + Segments: []*storage.EvaluationSegment{ + { + Key: "all_users", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, }, }, }, @@ -1595,16 +1583,16 @@ func TestEvaluator_MatchAll_RolloutDistribution_MultiRule(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 50, VariantKey: "released", }, { - ID: "6", - RuleID: "1", - VariantID: "7", + Id: "6", + RuleId: "1", + VariantId: "7", Rollout: 50, VariantKey: "unreleased", }, @@ -1638,13 +1626,12 @@ func TestEvaluator_MatchAll_NoConstraints(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, }, }, }, @@ -1653,16 +1640,16 @@ func TestEvaluator_MatchAll_NoConstraints(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 50, VariantKey: "boz", }, { - ID: "6", - RuleID: "1", - VariantID: "7", + Id: "6", + RuleId: "1", + VariantId: "7", Rollout: 50, VariantKey: "moz", }, @@ -1748,16 +1735,15 @@ func TestEvaluator_MatchAny_NoVariants_NoDistributions(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1836,17 +1822,16 @@ func TestEvaluator_MatchAny_SingleVariantDistribution(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -1854,7 +1839,7 @@ func TestEvaluator_MatchAny_SingleVariantDistribution(t *testing.T) { }, // constraint: admin (bool) == true { - ID: "3", + Id: "3", Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, Property: "admin", Operator: flipt.OpTrue, @@ -1868,9 +1853,9 @@ func TestEvaluator_MatchAny_SingleVariantDistribution(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 100, VariantKey: "boz", }, @@ -1997,17 +1982,16 @@ func TestEvaluator_MatchAny_RolloutDistribution(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -2022,16 +2006,16 @@ func TestEvaluator_MatchAny_RolloutDistribution(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 50, VariantKey: "boz", }, { - ID: "6", - RuleID: "1", - VariantID: "7", + Id: "6", + RuleId: "1", + VariantId: "7", Rollout: 50, VariantKey: "booz", }, @@ -2117,17 +2101,16 @@ func TestEvaluator_MatchAny_RolloutDistribution_MultiRule(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "subscribers": { - SegmentKey: "subscribers", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "subscribers", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: premium_user (bool) == true { - ID: "2", + Id: "2", Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, Property: "premium_user", Operator: flipt.OpTrue, @@ -2137,17 +2120,16 @@ func TestEvaluator_MatchAny_RolloutDistribution_MultiRule(t *testing.T) { }, }, { - ID: "2", - FlagKey: "foo", - Rank: 1, - Segments: map[string]*storage.EvaluationSegment{ - "all_users": { - SegmentKey: "all_users", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "2", + Rank: 1, + Segments: []*storage.EvaluationSegment{ + { + Key: "all_users", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: premium_user (bool) == true { - ID: "2", + Id: "2", Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, Property: "premium_user", Operator: flipt.OpTrue, @@ -2161,16 +2143,16 @@ func TestEvaluator_MatchAny_RolloutDistribution_MultiRule(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 50, VariantKey: "released", }, { - ID: "6", - RuleID: "1", - VariantID: "7", + Id: "6", + RuleId: "1", + VariantId: "7", Rollout: 50, VariantKey: "unreleased", }, @@ -2204,13 +2186,12 @@ func TestEvaluator_MatchAny_NoConstraints(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, }, }, }, @@ -2219,16 +2200,16 @@ func TestEvaluator_MatchAny_NoConstraints(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 50, VariantKey: "boz", }, { - ID: "6", - RuleID: "1", - VariantID: "7", + Id: "6", + RuleId: "1", + VariantId: "7", Rollout: 50, VariantKey: "moz", }, @@ -2314,17 +2295,16 @@ func TestEvaluator_FirstRolloutRuleIsZero(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ANY_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ANY_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -2339,16 +2319,16 @@ func TestEvaluator_FirstRolloutRuleIsZero(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 0, VariantKey: "boz", }, { - ID: "6", - RuleID: "1", - VariantID: "7", + Id: "6", + RuleId: "1", + VariantId: "7", Rollout: 100, VariantKey: "booz", }, @@ -2413,17 +2393,16 @@ func TestEvaluator_MultipleZeroRolloutDistributions(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -2438,44 +2417,44 @@ func TestEvaluator_MultipleZeroRolloutDistributions(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "1", - RuleID: "1", - VariantID: "1", + Id: "1", + RuleId: "1", + VariantId: "1", VariantKey: "1", Rollout: 0, }, { - ID: "2", - RuleID: "1", - VariantID: "2", + Id: "2", + RuleId: "1", + VariantId: "2", VariantKey: "2", Rollout: 0, }, { - ID: "3", - RuleID: "1", - VariantID: "3", + Id: "3", + RuleId: "1", + VariantId: "3", VariantKey: "3", Rollout: 50, }, { - ID: "4", - RuleID: "4", - VariantID: "4", + Id: "4", + RuleId: "4", + VariantId: "4", VariantKey: "4", Rollout: 0, }, { - ID: "5", - RuleID: "1", - VariantID: "5", + Id: "5", + RuleId: "1", + VariantId: "5", VariantKey: "5", Rollout: 0, }, { - ID: "6", - RuleID: "1", - VariantID: "6", + Id: "6", + RuleId: "1", + VariantId: "6", VariantKey: "6", Rollout: 50, }, diff --git a/internal/server/middleware/grpc/middleware_test.go b/internal/server/middleware/grpc/middleware_test.go index 3dd5f9bbe4..1a96f95485 100644 --- a/internal/server/middleware/grpc/middleware_test.go +++ b/internal/server/middleware/grpc/middleware_test.go @@ -642,17 +642,16 @@ func TestCacheUnaryInterceptor_Evaluate(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -660,7 +659,7 @@ func TestCacheUnaryInterceptor_Evaluate(t *testing.T) { }, // constraint: admin (bool) == true { - ID: "3", + Id: "3", Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, Property: "admin", Operator: flipt.OpTrue, @@ -674,9 +673,9 @@ func TestCacheUnaryInterceptor_Evaluate(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 100, VariantKey: "boz", VariantAttachment: `{"key":"value"}`, @@ -798,17 +797,16 @@ func TestCacheUnaryInterceptor_Evaluation_Variant(t *testing.T) { store.On("GetEvaluationRules", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRule{ { - ID: "1", - FlagKey: "foo", - Rank: 0, - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ + Id: "1", + Rank: 0, + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ // constraint: bar (string) == baz { - ID: "2", + Id: "2", Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, Property: "bar", Operator: flipt.OpEQ, @@ -816,7 +814,7 @@ func TestCacheUnaryInterceptor_Evaluation_Variant(t *testing.T) { }, // constraint: admin (bool) == true { - ID: "3", + Id: "3", Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, Property: "admin", Operator: flipt.OpTrue, @@ -830,9 +828,9 @@ func TestCacheUnaryInterceptor_Evaluation_Variant(t *testing.T) { store.On("GetEvaluationDistributions", mock.Anything, "1").Return( []*storage.EvaluationDistribution{ { - ID: "4", - RuleID: "1", - VariantID: "5", + Id: "4", + RuleId: "1", + VariantId: "5", Rollout: 100, VariantKey: "boz", VariantAttachment: `{"key":"value"}`, @@ -952,32 +950,34 @@ func TestCacheUnaryInterceptor_Evaluation_Boolean(t *testing.T) { store.On("GetEvaluationRollouts", mock.Anything, mock.Anything, "foo").Return( []*storage.EvaluationRollout{ { - RolloutType: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, - Segment: &storage.RolloutSegment{ - Segments: map[string]*storage.EvaluationSegment{ - "bar": { - SegmentKey: "bar", - MatchType: flipt.MatchType_ALL_MATCH_TYPE, - Constraints: []storage.EvaluationConstraint{ - // constraint: bar (string) == baz - { - ID: "2", - Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, - Property: "bar", - Operator: flipt.OpEQ, - Value: "baz", - }, - // constraint: admin (bool) == true - { - ID: "3", - Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, - Property: "admin", - Operator: flipt.OpTrue, + Type: flipt.RolloutType_SEGMENT_ROLLOUT_TYPE, + Rule: &evaluation.EvaluationRollout_Segment{ + Segment: &storage.RolloutSegment{ + Segments: []*storage.EvaluationSegment{ + { + Key: "bar", + MatchType: flipt.MatchType_ALL_MATCH_TYPE, + Constraints: []*storage.EvaluationConstraint{ + // constraint: bar (string) == baz + { + Id: "2", + Type: flipt.ComparisonType_STRING_COMPARISON_TYPE, + Property: "bar", + Operator: flipt.OpEQ, + Value: "baz", + }, + // constraint: admin (bool) == true + { + Id: "3", + Type: flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE, + Property: "admin", + Operator: flipt.OpTrue, + }, }, }, }, + Value: true, }, - Value: true, }, Rank: 1, }, diff --git a/internal/storage/cache/cache_test.go b/internal/storage/cache/cache_test.go index d69db2660c..2ed5dad3ad 100644 --- a/internal/storage/cache/cache_test.go +++ b/internal/storage/cache/cache_test.go @@ -54,7 +54,7 @@ func TestGetHandleUnmarshalError(t *testing.T) { func TestGetEvaluationRules(t *testing.T) { var ( - expectedRules = []*storage.EvaluationRule{{ID: "123"}} + expectedRules = []*storage.EvaluationRule{{Id: "123"}} store = &common.StoreMock{} ) @@ -78,7 +78,7 @@ func TestGetEvaluationRules(t *testing.T) { func TestGetEvaluationRulesCached(t *testing.T) { var ( - expectedRules = []*storage.EvaluationRule{{ID: "123"}} + expectedRules = []*storage.EvaluationRule{{Id: "123"}} store = &common.StoreMock{} ) diff --git a/internal/storage/fs/snapshot.go b/internal/storage/fs/snapshot.go index 02586176e6..ce1e20056b 100644 --- a/internal/storage/fs/snapshot.go +++ b/internal/storage/fs/snapshot.go @@ -18,6 +18,7 @@ import ( "go.flipt.io/flipt/internal/ext" "go.flipt.io/flipt/internal/storage" "go.flipt.io/flipt/rpc/flipt" + "go.flipt.io/flipt/rpc/flipt/evaluation" "go.uber.org/zap" "google.golang.org/protobuf/types/known/timestamppb" "gopkg.in/yaml.v3" @@ -341,10 +342,8 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { } evalRule := &storage.EvaluationRule{ - NamespaceKey: doc.Namespace, - FlagKey: f.Key, - ID: rule.Id, - Rank: rank, + Id: rule.Id, + Rank: rank, } switch s := r.Segment.IsSegment.(type) { @@ -359,7 +358,7 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { var ( segmentKeys = []string{} - segments = make(map[string]*storage.EvaluationSegment) + segments = []*storage.EvaluationSegment{} ) if rule.SegmentKey != "" { @@ -374,9 +373,9 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { return errs.ErrInvalidf("flag %s/%s rule %d references unknown segment %q", doc.Namespace, flag.Key, rank, segmentKey) } - evc := make([]storage.EvaluationConstraint, 0, len(segment.Constraints)) + evc := make([]*storage.EvaluationConstraint, 0, len(segment.Constraints)) for _, constraint := range segment.Constraints { - evc = append(evc, storage.EvaluationConstraint{ + evc = append(evc, &storage.EvaluationConstraint{ Operator: constraint.Operator, Property: constraint.Property, Type: constraint.Type, @@ -384,11 +383,11 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { }) } - segments[segmentKey] = &storage.EvaluationSegment{ - SegmentKey: segmentKey, + segments = append(segments, &storage.EvaluationSegment{ + Key: segmentKey, MatchType: segment.MatchType, Constraints: evc, - } + }) } if rule.SegmentOperator == flipt.SegmentOperator_AND_SEGMENT_OPERATOR { @@ -415,10 +414,10 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { UpdatedAt: ss.now, }) - evalDists[evalRule.ID] = append(evalDists[evalRule.ID], &storage.EvaluationDistribution{ - ID: id, + evalDists[evalRule.Id] = append(evalDists[evalRule.Id], &storage.EvaluationDistribution{ + Id: id, Rollout: d.Rollout, - VariantID: variant.Id, + VariantId: variant.Id, VariantKey: variant.Key, VariantAttachment: variant.Attachment, }) @@ -433,8 +432,7 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { for i, rollout := range f.Rollouts { rank := int32(i + 1) s := &storage.EvaluationRollout{ - NamespaceKey: doc.Namespace, - Rank: rank, + Rank: rank, } flagRollout := &flipt.Rollout{ @@ -447,13 +445,15 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { } if rollout.Threshold != nil { - s.Threshold = &storage.RolloutThreshold{ - Percentage: rollout.Threshold.Percentage, - Value: rollout.Threshold.Value, + s.Rule = &evaluation.EvaluationRollout_Threshold{ + Threshold: &storage.RolloutThreshold{ + Percentage: rollout.Threshold.Percentage, + Value: rollout.Threshold.Value, + }, } - s.RolloutType = flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE + s.Type = flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE - flagRollout.Type = s.RolloutType + flagRollout.Type = s.Type flagRollout.Rule = &flipt.Rollout_Threshold{ Threshold: &flipt.RolloutThreshold{ Percentage: rollout.Threshold.Percentage, @@ -463,7 +463,7 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { } else if rollout.Segment != nil { var ( segmentKeys = []string{} - segments = make(map[string]*storage.EvaluationSegment) + segments = []*storage.EvaluationSegment{} ) if rollout.Segment.Key != "" { @@ -478,9 +478,9 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { return errs.ErrInvalidf("flag %s/%s rule %d references unknown segment %q", doc.Namespace, flag.Key, rank, segmentKey) } - constraints := make([]storage.EvaluationConstraint, 0, len(segment.Constraints)) + constraints := make([]*storage.EvaluationConstraint, 0, len(segment.Constraints)) for _, c := range segment.Constraints { - constraints = append(constraints, storage.EvaluationConstraint{ + constraints = append(constraints, &storage.EvaluationConstraint{ Operator: c.Operator, Property: c.Property, Type: c.Type, @@ -488,22 +488,24 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { }) } - segments[segmentKey] = &storage.EvaluationSegment{ - SegmentKey: segmentKey, + segments = append(segments, &storage.EvaluationSegment{ + Key: segmentKey, MatchType: segment.MatchType, Constraints: constraints, - } + }) } segmentOperator := flipt.SegmentOperator_value[rollout.Segment.Operator] - s.Segment = &storage.RolloutSegment{ - Segments: segments, - SegmentOperator: flipt.SegmentOperator(segmentOperator), - Value: rollout.Segment.Value, + s.Rule = &evaluation.EvaluationRollout_Segment{ + Segment: &storage.RolloutSegment{ + Segments: segments, + SegmentOperator: flipt.SegmentOperator(segmentOperator), + Value: rollout.Segment.Value, + }, } - s.RolloutType = flipt.RolloutType_SEGMENT_ROLLOUT_TYPE + s.Type = flipt.RolloutType_SEGMENT_ROLLOUT_TYPE frs := &flipt.RolloutSegment{ Value: rollout.Segment.Value, @@ -516,7 +518,7 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { frs.SegmentKeys = segmentKeys } - flagRollout.Type = s.RolloutType + flagRollout.Type = s.Type flagRollout.Rule = &flipt.Rollout_Segment{ Segment: frs, } diff --git a/internal/storage/fs/snapshot_test.go b/internal/storage/fs/snapshot_test.go index 29da18f24f..8b4b0f02b7 100644 --- a/internal/storage/fs/snapshot_test.go +++ b/internal/storage/fs/snapshot_test.go @@ -413,19 +413,17 @@ func (fis *FSIndexSuite) TestGetEvaluationRollouts() { assert.Len(t, rollouts, 2) - assert.Equal(t, tc.namespace, rollouts[0].NamespaceKey) assert.Equal(t, int32(1), rollouts[0].Rank) - require.NotNil(t, rollouts[0].Segment) - assert.Contains(t, rollouts[0].Segment.Segments, "segment1") - assert.True(t, rollouts[0].Segment.Value, "segment value should be true") + require.NotNil(t, rollouts[0].GetSegment()) + assert.Contains(t, rollouts[0].GetSegment().Segments, "segment1") + assert.True(t, rollouts[0].GetSegment().Value, "segment value should be true") - assert.Equal(t, tc.namespace, rollouts[1].NamespaceKey) assert.Equal(t, int32(2), rollouts[1].Rank) - require.NotNil(t, rollouts[1].Threshold) - assert.Equal(t, float32(50), rollouts[1].Threshold.Percentage) - assert.True(t, rollouts[1].Threshold.Value, "threshold value should be true") + require.NotNil(t, rollouts[1].GetThreshold()) + assert.Equal(t, float32(50), rollouts[1].GetThreshold().Percentage) + assert.True(t, rollouts[1].GetThreshold().Value, "threshold value should be true") }) } } @@ -494,14 +492,12 @@ func (fis *FSIndexSuite) TestGetEvaluationRules() { assert.Len(t, rules, 1) - assert.Equal(t, tc.namespace, rules[0].NamespaceKey) - assert.Equal(t, tc.flagKey, rules[0].FlagKey) assert.Equal(t, int32(1), rules[0].Rank) assert.Contains(t, rules[0].Segments, "segment1") for i := 0; i < len(tc.constraints); i++ { fc := tc.constraints[i] - c := rules[0].Segments[fc.SegmentKey].Constraints[i] + c := rules[0].Segments[0].Constraints[i] assert.Equal(t, fc.Type, c.Type) assert.Equal(t, fc.Property, c.Property) @@ -1301,19 +1297,17 @@ func (fis *FSWithoutIndexSuite) TestGetEvaluationRollouts() { assert.Len(t, rollouts, 2) - assert.Equal(t, tc.namespace, rollouts[0].NamespaceKey) assert.Equal(t, int32(1), rollouts[0].Rank) - require.NotNil(t, rollouts[0].Segment) - assert.Contains(t, rollouts[0].Segment.Segments, "segment1") - assert.True(t, rollouts[0].Segment.Value, "segment value should be true") + require.NotNil(t, rollouts[0].GetSegment()) + assert.Contains(t, rollouts[0].GetSegment().Segments, "segment1") + assert.True(t, rollouts[0].GetSegment().Value, "segment value should be true") - assert.Equal(t, tc.namespace, rollouts[1].NamespaceKey) assert.Equal(t, int32(2), rollouts[1].Rank) - require.NotNil(t, rollouts[1].Threshold) - assert.Equal(t, float32(50), rollouts[1].Threshold.Percentage) - assert.True(t, rollouts[1].Threshold.Value, "threshold value should be true") + require.NotNil(t, rollouts[1].GetThreshold()) + assert.Equal(t, float32(50), rollouts[1].GetThreshold().Percentage) + assert.True(t, rollouts[1].GetThreshold().Value, "threshold value should be true") }) } } @@ -1405,14 +1399,12 @@ func (fis *FSWithoutIndexSuite) TestGetEvaluationRules() { assert.Len(t, rules, 1) - assert.Equal(t, tc.namespace, rules[0].NamespaceKey) - assert.Equal(t, tc.flagKey, rules[0].FlagKey) assert.Equal(t, int32(1), rules[0].Rank) assert.Contains(t, rules[0].Segments, "segment1") for i := 0; i < len(tc.constraints); i++ { fc := tc.constraints[i] - c := rules[0].Segments[fc.SegmentKey].Constraints[i] + c := rules[0].Segments[0].Constraints[i] assert.Equal(t, fc.Type, c.Type) assert.Equal(t, fc.Property, c.Property) diff --git a/internal/storage/sql/common/evaluation.go b/internal/storage/sql/common/evaluation.go index d3a92f2561..6915d767d6 100644 --- a/internal/storage/sql/common/evaluation.go +++ b/internal/storage/sql/common/evaluation.go @@ -8,6 +8,7 @@ import ( sq "github.com/Masterminds/squirrel" "go.flipt.io/flipt/internal/storage" flipt "go.flipt.io/flipt/rpc/flipt" + "go.flipt.io/flipt/rpc/flipt/evaluation" ) func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey string) (_ []*storage.EvaluationRule, err error) { @@ -84,8 +85,11 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st }() var ( + // ruleID -> rule uniqueRules = make(map[string]*storage.EvaluationRule) - rules = []*storage.EvaluationRule{} + // ruleID -> segmentKey -> segment + uniqueRuleSegments = make(map[string]map[string]*storage.EvaluationSegment) + rules = []*storage.EvaluationRule{} ) for rows.Next() { @@ -121,11 +125,12 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st intermediateStorageRule.Rank = rm.Rank intermediateStorageRule.SegmentOperator = rm.SegmentOperator - if existingRule, ok := uniqueRules[intermediateStorageRule.ID]; ok { + // check if we've seen this rule before + if _, ok := uniqueRules[intermediateStorageRule.ID]; ok { var constraint *storage.EvaluationConstraint if optionalConstraint.Id.Valid { constraint = &storage.EvaluationConstraint{ - ID: optionalConstraint.Id.String, + Id: optionalConstraint.Id.String, Type: flipt.ComparisonType(optionalConstraint.Type.Int32), Property: optionalConstraint.Property.String, Operator: optionalConstraint.Operator.String, @@ -133,36 +138,35 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st } } - segment, ok := existingRule.Segments[intermediateStorageRule.SegmentKey] + // check if we've seen this segment before for this rule + segment, ok := uniqueRuleSegments[intermediateStorageRule.ID][intermediateStorageRule.SegmentKey] if !ok { ses := &storage.EvaluationSegment{ - SegmentKey: intermediateStorageRule.SegmentKey, - MatchType: intermediateStorageRule.SegmentMatchType, + Key: intermediateStorageRule.SegmentKey, + MatchType: intermediateStorageRule.SegmentMatchType, } if constraint != nil { - ses.Constraints = []storage.EvaluationConstraint{*constraint} + ses.Constraints = []*storage.EvaluationConstraint{constraint} } - existingRule.Segments[intermediateStorageRule.SegmentKey] = ses + uniqueRuleSegments[intermediateStorageRule.ID][intermediateStorageRule.SegmentKey] = ses } else if constraint != nil { - segment.Constraints = append(segment.Constraints, *constraint) + segment.Constraints = append(segment.Constraints, constraint) } } else { // haven't seen this rule before newRule := &storage.EvaluationRule{ - ID: intermediateStorageRule.ID, - NamespaceKey: intermediateStorageRule.NamespaceKey, - FlagKey: intermediateStorageRule.FlagKey, + Id: intermediateStorageRule.ID, Rank: intermediateStorageRule.Rank, SegmentOperator: intermediateStorageRule.SegmentOperator, - Segments: make(map[string]*storage.EvaluationSegment), + Segments: []*storage.EvaluationSegment{}, } var constraint *storage.EvaluationConstraint if optionalConstraint.Id.Valid { constraint = &storage.EvaluationConstraint{ - ID: optionalConstraint.Id.String, + Id: optionalConstraint.Id.String, Type: flipt.ComparisonType(optionalConstraint.Type.Int32), Property: optionalConstraint.Property.String, Operator: optionalConstraint.Operator.String, @@ -171,17 +175,17 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st } ses := &storage.EvaluationSegment{ - SegmentKey: intermediateStorageRule.SegmentKey, - MatchType: intermediateStorageRule.SegmentMatchType, + Key: intermediateStorageRule.SegmentKey, + MatchType: intermediateStorageRule.SegmentMatchType, } if constraint != nil { - ses.Constraints = []storage.EvaluationConstraint{*constraint} + ses.Constraints = []*storage.EvaluationConstraint{constraint} } - newRule.Segments[intermediateStorageRule.SegmentKey] = ses + newRule.Segments = append(newRule.Segments, ses) - uniqueRules[newRule.ID] = newRule + uniqueRules[newRule.Id] = newRule rules = append(rules, newRule) } } @@ -227,7 +231,7 @@ func (s *Store) GetEvaluationDistributions(ctx context.Context, ruleID string) ( ) if err := rows.Scan( - &d.ID, &d.RuleID, &d.VariantID, &d.Rollout, &d.VariantKey, &attachment, + &d.Id, &d.RuleId, &d.VariantId, &d.Rollout, &d.VariantKey, &attachment, ); err != nil { return distributions, err } @@ -261,7 +265,6 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey rows, err := s.builder.Select(` r.id, - r.namespace_key, r."type", r."rank", rt.percentage, @@ -308,8 +311,11 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey }() var ( + // rolloutId -> rollout uniqueSegmentedRollouts = make(map[string]*storage.EvaluationRollout) - rollouts = []*storage.EvaluationRollout{} + // rolloutId -> segmentKey -> segment + uniqueRolloutSegments = make(map[string]map[string]*storage.EvaluationSegment) + rollouts = []*storage.EvaluationRollout{} ) for rows.Next() { @@ -327,8 +333,7 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey if err := rows.Scan( &rolloutId, - &evaluationRollout.NamespaceKey, - &evaluationRollout.RolloutType, + &evaluationRollout.Type, &evaluationRollout.Rank, &rtPercentageNumber, &rtPercentageValue, @@ -345,20 +350,21 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey } if rtPercentageNumber.Valid && rtPercentageValue.Valid { - storageThreshold := &storage.RolloutThreshold{ - Percentage: float32(rtPercentageNumber.Float64), - Value: rtPercentageValue.Bool, + evaluationRollout.Rule = &evaluation.EvaluationRollout_Threshold{ + Threshold: &storage.RolloutThreshold{ + Percentage: float32(rtPercentageNumber.Float64), + Value: rtPercentageValue.Bool, + }, } - evaluationRollout.Threshold = storageThreshold } else if rsSegmentKey.Valid && rsSegmentValue.Valid && rsSegmentOperator.Valid && rsMatchType.Valid { - var c *storage.EvaluationConstraint + var constraint *storage.EvaluationConstraint if optionalConstraint.Type.Valid { - c = &storage.EvaluationConstraint{ + constraint = &storage.EvaluationConstraint{ Type: flipt.ComparisonType(optionalConstraint.Type.Int32), Property: optionalConstraint.Property.String, Operator: optionalConstraint.Operator.String, @@ -366,26 +372,25 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey } } - if existingRolloutSegment, ok := uniqueSegmentedRollouts[rolloutId]; ok { + if _, ok := uniqueSegmentedRollouts[rolloutId]; ok { // check if segment exists and either append constraints to an already existing segment, // or add another segment to the map. - es, innerOk := existingRolloutSegment.Segment.Segments[rsSegmentKey.String] + es, innerOk := uniqueRolloutSegments[rolloutId][rsSegmentKey.String] if innerOk { - if c != nil { - es.Constraints = append(es.Constraints, *c) + if constraint != nil { + es.Constraints = append(es.Constraints, constraint) } } else { - ses := &storage.EvaluationSegment{ - SegmentKey: rsSegmentKey.String, - MatchType: flipt.MatchType(rsMatchType.Int32), + Key: rsSegmentKey.String, + MatchType: flipt.MatchType(rsMatchType.Int32), } - if c != nil { - ses.Constraints = []storage.EvaluationConstraint{*c} + if constraint != nil { + ses.Constraints = []*storage.EvaluationConstraint{constraint} } - existingRolloutSegment.Segment.Segments[rsSegmentKey.String] = ses + uniqueRolloutSegments[rolloutId][rsSegmentKey.String] = ses } continue @@ -394,21 +399,23 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey storageSegment := &storage.RolloutSegment{ Value: rsSegmentValue.Bool, SegmentOperator: flipt.SegmentOperator(rsSegmentOperator.Int32), - Segments: make(map[string]*storage.EvaluationSegment), + Segments: []*storage.EvaluationSegment{}, } ses := &storage.EvaluationSegment{ - SegmentKey: rsSegmentKey.String, - MatchType: flipt.MatchType(rsMatchType.Int32), + Key: rsSegmentKey.String, + MatchType: flipt.MatchType(rsMatchType.Int32), } - if c != nil { - ses.Constraints = []storage.EvaluationConstraint{*c} + if constraint != nil { + ses.Constraints = []*storage.EvaluationConstraint{constraint} } - storageSegment.Segments[rsSegmentKey.String] = ses + storageSegment.Segments = append(storageSegment.Segments, ses) - evaluationRollout.Segment = storageSegment + evaluationRollout.Rule = &evaluation.EvaluationRollout_Segment{ + Segment: storageSegment, + } uniqueSegmentedRollouts[rolloutId] = &evaluationRollout } diff --git a/internal/storage/sql/evaluation_test.go b/internal/storage/sql/evaluation_test.go index 3074aa717a..8b363d0944 100644 --- a/internal/storage/sql/evaluation_test.go +++ b/internal/storage/sql/evaluation_test.go @@ -87,23 +87,19 @@ func (s *DBTestSuite) TestGetEvaluationRules() { assert.NotEmpty(t, evaluationRules) assert.Equal(t, 2, len(evaluationRules)) - assert.Equal(t, rule1.Id, evaluationRules[0].ID) - assert.Equal(t, storage.DefaultNamespace, evaluationRules[0].NamespaceKey) - assert.Equal(t, rule1.FlagKey, evaluationRules[0].FlagKey) + assert.Equal(t, rule1.Id, evaluationRules[0].Id) - assert.Equal(t, rule1.SegmentKey, evaluationRules[0].Segments[segment.Key].SegmentKey) - assert.Equal(t, segment.MatchType, evaluationRules[0].Segments[segment.Key].MatchType) + assert.Equal(t, rule1.SegmentKey, evaluationRules[0].Segments[0].Key) + assert.Equal(t, segment.MatchType, evaluationRules[0].Segments[0].MatchType) assert.Equal(t, rule1.Rank, evaluationRules[0].Rank) - assert.Len(t, evaluationRules[0].Segments[segment.Key].Constraints, 2) + assert.Len(t, evaluationRules[0].Segments[0].Constraints, 2) - assert.Equal(t, rule2.Id, evaluationRules[1].ID) - assert.Equal(t, storage.DefaultNamespace, evaluationRules[1].NamespaceKey) - assert.Equal(t, rule2.FlagKey, evaluationRules[1].FlagKey) + assert.Equal(t, rule2.Id, evaluationRules[1].Id) - assert.Equal(t, rule2.SegmentKey, evaluationRules[1].Segments[segment.Key].SegmentKey) - assert.Equal(t, segment.MatchType, evaluationRules[1].Segments[segment.Key].MatchType) + assert.Equal(t, rule2.SegmentKey, evaluationRules[1].Segments[0].Key) + assert.Equal(t, segment.MatchType, evaluationRules[1].Segments[0].MatchType) assert.Equal(t, rule2.Rank, evaluationRules[1].Rank) - assert.Len(t, evaluationRules[1].Segments[segment.Key].Constraints, 2) + assert.Len(t, evaluationRules[1].Segments[0].Constraints, 2) } func (s *DBTestSuite) TestGetEvaluationRules_NoNamespace() { @@ -173,23 +169,19 @@ func (s *DBTestSuite) TestGetEvaluationRules_NoNamespace() { assert.NotEmpty(t, evaluationRules) assert.Equal(t, 2, len(evaluationRules)) - assert.Equal(t, rule1.Id, evaluationRules[0].ID) - assert.Equal(t, storage.DefaultNamespace, evaluationRules[0].NamespaceKey) - assert.Equal(t, rule1.FlagKey, evaluationRules[0].FlagKey) + assert.Equal(t, rule1.Id, evaluationRules[0].Id) - assert.Equal(t, rule1.SegmentKey, evaluationRules[0].Segments[segment.Key].SegmentKey) - assert.Equal(t, segment.MatchType, evaluationRules[0].Segments[segment.Key].MatchType) + assert.Equal(t, rule1.SegmentKey, evaluationRules[0].Segments[0].Key) + assert.Equal(t, segment.MatchType, evaluationRules[0].Segments[0].MatchType) assert.Equal(t, rule1.Rank, evaluationRules[0].Rank) - assert.Len(t, evaluationRules[0].Segments[segment.Key].Constraints, 2) + assert.Len(t, evaluationRules[0].Segments[0].Constraints, 2) - assert.Equal(t, rule2.Id, evaluationRules[1].ID) - assert.Equal(t, storage.DefaultNamespace, evaluationRules[1].NamespaceKey) - assert.Equal(t, rule2.FlagKey, evaluationRules[1].FlagKey) + assert.Equal(t, rule2.Id, evaluationRules[1].Id) - assert.Equal(t, rule2.SegmentKey, evaluationRules[1].Segments[segment.Key].SegmentKey) - assert.Equal(t, segment.MatchType, evaluationRules[1].Segments[segment.Key].MatchType) + assert.Equal(t, rule2.SegmentKey, evaluationRules[1].Segments[0].Key) + assert.Equal(t, segment.MatchType, evaluationRules[1].Segments[0].MatchType) assert.Equal(t, rule2.Rank, evaluationRules[1].Rank) - assert.Len(t, evaluationRules[1].Segments[segment.Key].Constraints, 2) + assert.Len(t, evaluationRules[1].Segments[0].Constraints, 2) } func (s *DBTestSuite) TestGetEvaluationRulesNamespace() { @@ -266,19 +258,17 @@ func (s *DBTestSuite) TestGetEvaluationRulesNamespace() { assert.NotEmpty(t, evaluationRules) assert.Equal(t, 1, len(evaluationRules)) - assert.Equal(t, rule1.Id, evaluationRules[0].ID) - assert.Equal(t, s.namespace, evaluationRules[0].NamespaceKey) - assert.Equal(t, rule1.FlagKey, evaluationRules[0].FlagKey) + assert.Equal(t, rule1.Id, evaluationRules[0].Id) - assert.Equal(t, firstSegment.Key, evaluationRules[0].Segments[firstSegment.Key].SegmentKey) - assert.Equal(t, firstSegment.MatchType, evaluationRules[0].Segments[firstSegment.Key].MatchType) + assert.Equal(t, firstSegment.Key, evaluationRules[0].Segments[0].Key) + assert.Equal(t, firstSegment.MatchType, evaluationRules[0].Segments[0].MatchType) assert.Equal(t, rule1.Rank, evaluationRules[0].Rank) - assert.Len(t, evaluationRules[0].Segments[firstSegment.Key].Constraints, 2) + assert.Len(t, evaluationRules[0].Segments[0].Constraints, 2) - assert.Equal(t, secondSegment.Key, evaluationRules[0].Segments[secondSegment.Key].SegmentKey) - assert.Equal(t, secondSegment.MatchType, evaluationRules[0].Segments[secondSegment.Key].MatchType) + assert.Equal(t, secondSegment.Key, evaluationRules[0].Segments[1].Key) + assert.Equal(t, secondSegment.MatchType, evaluationRules[0].Segments[1].MatchType) assert.Equal(t, rule1.Rank, evaluationRules[0].Rank) - assert.Len(t, evaluationRules[0].Segments[secondSegment.Key].Constraints, 0) + assert.Len(t, evaluationRules[0].Segments[1].Constraints, 0) } func (s *DBTestSuite) TestGetEvaluationDistributions() { @@ -364,15 +354,15 @@ func (s *DBTestSuite) TestGetEvaluationDistributions() { assert.Equal(t, 2, len(evaluationDistributions)) - assert.NotEmpty(t, evaluationDistributions[0].ID) - assert.Equal(t, rule.Id, evaluationDistributions[0].RuleID) - assert.Equal(t, variant1.Id, evaluationDistributions[0].VariantID) + assert.NotEmpty(t, evaluationDistributions[0].Id) + assert.Equal(t, rule.Id, evaluationDistributions[0].RuleId) + assert.Equal(t, variant1.Id, evaluationDistributions[0].VariantId) assert.Equal(t, variant1.Key, evaluationDistributions[0].VariantKey) assert.Equal(t, float32(50.00), evaluationDistributions[0].Rollout) - assert.NotEmpty(t, evaluationDistributions[1].ID) - assert.Equal(t, rule.Id, evaluationDistributions[1].RuleID) - assert.Equal(t, variant2.Id, evaluationDistributions[1].VariantID) + assert.NotEmpty(t, evaluationDistributions[1].Id) + assert.Equal(t, rule.Id, evaluationDistributions[1].RuleId) + assert.Equal(t, variant2.Id, evaluationDistributions[1].VariantId) assert.Equal(t, variant2.Key, evaluationDistributions[1].VariantKey) assert.Equal(t, `{"key2":"value2"}`, evaluationDistributions[1].VariantAttachment) assert.Equal(t, float32(50.00), evaluationDistributions[1].Rollout) @@ -469,15 +459,15 @@ func (s *DBTestSuite) TestGetEvaluationDistributionsNamespace() { assert.Equal(t, 2, len(evaluationDistributions)) - assert.NotEmpty(t, evaluationDistributions[0].ID) - assert.Equal(t, rule.Id, evaluationDistributions[0].RuleID) - assert.Equal(t, variant1.Id, evaluationDistributions[0].VariantID) + assert.NotEmpty(t, evaluationDistributions[0].Id) + assert.Equal(t, rule.Id, evaluationDistributions[0].RuleId) + assert.Equal(t, variant1.Id, evaluationDistributions[0].VariantId) assert.Equal(t, variant1.Key, evaluationDistributions[0].VariantKey) assert.Equal(t, float32(50.00), evaluationDistributions[0].Rollout) - assert.NotEmpty(t, evaluationDistributions[1].ID) - assert.Equal(t, rule.Id, evaluationDistributions[1].RuleID) - assert.Equal(t, variant2.Id, evaluationDistributions[1].VariantID) + assert.NotEmpty(t, evaluationDistributions[1].Id) + assert.Equal(t, rule.Id, evaluationDistributions[1].RuleId) + assert.Equal(t, variant2.Id, evaluationDistributions[1].VariantId) assert.Equal(t, variant2.Key, evaluationDistributions[1].VariantKey) assert.Equal(t, `{"key2":"value2"}`, evaluationDistributions[1].VariantAttachment) assert.Equal(t, float32(50.00), evaluationDistributions[1].Rollout) @@ -566,15 +556,15 @@ func (s *DBTestSuite) TestGetEvaluationDistributions_MaintainOrder() { assert.Equal(t, 2, len(evaluationDistributions)) - assert.NotEmpty(t, evaluationDistributions[0].ID) - assert.Equal(t, rule.Id, evaluationDistributions[0].RuleID) - assert.Equal(t, variant1.Id, evaluationDistributions[0].VariantID) + assert.NotEmpty(t, evaluationDistributions[0].Id) + assert.Equal(t, rule.Id, evaluationDistributions[0].RuleId) + assert.Equal(t, variant1.Id, evaluationDistributions[0].VariantId) assert.Equal(t, variant1.Key, evaluationDistributions[0].VariantKey) assert.Equal(t, float32(80.00), evaluationDistributions[0].Rollout) - assert.NotEmpty(t, evaluationDistributions[1].ID) - assert.Equal(t, rule.Id, evaluationDistributions[1].RuleID) - assert.Equal(t, variant2.Id, evaluationDistributions[1].VariantID) + assert.NotEmpty(t, evaluationDistributions[1].Id) + assert.Equal(t, rule.Id, evaluationDistributions[1].RuleId) + assert.Equal(t, variant2.Id, evaluationDistributions[1].VariantId) assert.Equal(t, variant2.Key, evaluationDistributions[1].VariantKey) assert.Equal(t, float32(20.00), evaluationDistributions[1].Rollout) @@ -608,15 +598,15 @@ func (s *DBTestSuite) TestGetEvaluationDistributions_MaintainOrder() { assert.Equal(t, 2, len(evaluationDistributions)) - assert.NotEmpty(t, evaluationDistributions[0].ID) - assert.Equal(t, rule.Id, evaluationDistributions[0].RuleID) - assert.Equal(t, variant1.Id, evaluationDistributions[0].VariantID) + assert.NotEmpty(t, evaluationDistributions[0].Id) + assert.Equal(t, rule.Id, evaluationDistributions[0].RuleId) + assert.Equal(t, variant1.Id, evaluationDistributions[0].VariantId) assert.Equal(t, variant1.Key, evaluationDistributions[0].VariantKey) assert.Equal(t, float32(80.00), evaluationDistributions[0].Rollout) - assert.NotEmpty(t, evaluationDistributions[1].ID) - assert.Equal(t, rule.Id, evaluationDistributions[1].RuleID) - assert.Equal(t, variant2.Id, evaluationDistributions[1].VariantID) + assert.NotEmpty(t, evaluationDistributions[1].Id) + assert.Equal(t, rule.Id, evaluationDistributions[1].RuleId) + assert.Equal(t, variant2.Id, evaluationDistributions[1].VariantId) assert.Equal(t, variant2.Key, evaluationDistributions[1].VariantKey) assert.Equal(t, float32(20.00), evaluationDistributions[1].Rollout) } @@ -674,20 +664,18 @@ func (s *DBTestSuite) TestGetEvaluationRollouts() { assert.Equal(t, 2, len(evaluationRollouts)) - assert.Equal(t, "default", evaluationRollouts[0].NamespaceKey) assert.Equal(t, int32(1), evaluationRollouts[0].Rank) - assert.NotNil(t, evaluationRollouts[0].Threshold) - assert.Equal(t, float32(50.0), evaluationRollouts[0].Threshold.Percentage) - assert.False(t, evaluationRollouts[0].Threshold.Value, "percentage value is false") + assert.NotNil(t, evaluationRollouts[0].GetThreshold()) + assert.Equal(t, float32(50.0), evaluationRollouts[0].GetThreshold().Percentage) + assert.False(t, evaluationRollouts[0].GetThreshold().Value, "percentage value is false") - assert.Equal(t, "default", evaluationRollouts[1].NamespaceKey) assert.Equal(t, int32(2), evaluationRollouts[1].Rank) - assert.NotNil(t, evaluationRollouts[1].Segment) + assert.NotNil(t, evaluationRollouts[1].GetSegment()) - assert.Contains(t, evaluationRollouts[1].Segment.Segments, segment.Key) - assert.Equal(t, segment.MatchType, evaluationRollouts[1].Segment.Segments[segment.Key].MatchType) + assert.Contains(t, evaluationRollouts[1].GetSegment().Segments, segment.Key) + assert.Equal(t, segment.MatchType, evaluationRollouts[1].GetSegment().Segments[0].MatchType) - assert.True(t, evaluationRollouts[1].Segment.Value, "segment value is true") + assert.True(t, evaluationRollouts[1].GetSegment().Value, "segment value is true") } func (s *DBTestSuite) TestGetEvaluationRollouts_NoNamespace() { @@ -763,22 +751,20 @@ func (s *DBTestSuite) TestGetEvaluationRollouts_NoNamespace() { assert.Equal(t, 2, len(evaluationRollouts)) - assert.Equal(t, "default", evaluationRollouts[0].NamespaceKey) assert.Equal(t, int32(1), evaluationRollouts[0].Rank) - assert.NotNil(t, evaluationRollouts[0].Threshold) - assert.Equal(t, float32(50.0), evaluationRollouts[0].Threshold.Percentage) - assert.False(t, evaluationRollouts[0].Threshold.Value, "percentage value is false") + assert.NotNil(t, evaluationRollouts[0].GetThreshold()) + assert.Equal(t, float32(50.0), evaluationRollouts[0].GetThreshold().Percentage) + assert.False(t, evaluationRollouts[0].GetThreshold().Value, "percentage value is false") - assert.Equal(t, "default", evaluationRollouts[1].NamespaceKey) assert.Equal(t, int32(2), evaluationRollouts[1].Rank) - assert.NotNil(t, evaluationRollouts[1].Segment) + assert.NotNil(t, evaluationRollouts[1].GetSegment()) - assert.Equal(t, firstSegment.Key, evaluationRollouts[1].Segment.Segments[firstSegment.Key].SegmentKey) - assert.Equal(t, flipt.SegmentOperator_AND_SEGMENT_OPERATOR, evaluationRollouts[1].Segment.SegmentOperator) - assert.Len(t, evaluationRollouts[1].Segment.Segments[firstSegment.Key].Constraints, 1) + assert.Equal(t, firstSegment.Key, evaluationRollouts[1].GetSegment().Segments[0].Key) + assert.Equal(t, flipt.SegmentOperator_AND_SEGMENT_OPERATOR, evaluationRollouts[1].GetSegment().SegmentOperator) + assert.Len(t, evaluationRollouts[1].GetSegment().Segments[0].Constraints, 1) - assert.Equal(t, secondSegment.Key, evaluationRollouts[1].Segment.Segments[secondSegment.Key].SegmentKey) - assert.Len(t, evaluationRollouts[1].Segment.Segments[secondSegment.Key].Constraints, 0) + assert.Equal(t, secondSegment.Key, evaluationRollouts[1].GetSegment().Segments[1].Key) + assert.Len(t, evaluationRollouts[1].GetSegment().Segments[1].Constraints, 0) } func (s *DBTestSuite) TestGetEvaluationRollouts_NonDefaultNamespace() { @@ -849,20 +835,18 @@ func (s *DBTestSuite) TestGetEvaluationRollouts_NonDefaultNamespace() { assert.Equal(t, 2, len(evaluationRollouts)) - assert.Equal(t, s.namespace, evaluationRollouts[0].NamespaceKey) assert.Equal(t, int32(1), evaluationRollouts[0].Rank) - assert.NotNil(t, evaluationRollouts[0].Threshold) - assert.Equal(t, float32(50.0), evaluationRollouts[0].Threshold.Percentage) - assert.False(t, evaluationRollouts[0].Threshold.Value, "percentage value is false") + assert.NotNil(t, evaluationRollouts[0].GetThreshold()) + assert.Equal(t, float32(50.0), evaluationRollouts[0].GetThreshold().Percentage) + assert.False(t, evaluationRollouts[0].GetThreshold().Value, "percentage value is false") - assert.Equal(t, s.namespace, evaluationRollouts[1].NamespaceKey) assert.Equal(t, int32(2), evaluationRollouts[1].Rank) - assert.NotNil(t, evaluationRollouts[1].Segment) + assert.NotNil(t, evaluationRollouts[1].GetSegment()) - assert.Contains(t, evaluationRollouts[1].Segment.Segments, segment.Key) - assert.Equal(t, segment.MatchType, evaluationRollouts[1].Segment.Segments[segment.Key].MatchType) + assert.Contains(t, evaluationRollouts[1].GetSegment().Segments, segment.Key) + assert.Equal(t, segment.MatchType, evaluationRollouts[1].GetSegment().Segments[0].MatchType) - assert.True(t, evaluationRollouts[1].Segment.Value, "segment value is true") + assert.True(t, evaluationRollouts[1].GetSegment().Value, "segment value is true") } func Benchmark_EvaluationV1AndV2(b *testing.B) { diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 0f7b5441bf..de8f1fefa1 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -5,6 +5,7 @@ import ( "fmt" "go.flipt.io/flipt/rpc/flipt" + "go.flipt.io/flipt/rpc/flipt/evaluation" ) const ( @@ -16,62 +17,27 @@ const ( ) // EvaluationRule represents a rule and constraints required for evaluating if a -// given flagKey matches a segment -type EvaluationRule struct { - ID string `json:"id"` - NamespaceKey string `json:"namespace_key,omitempty"` - FlagKey string `json:"flag_key,omitempty"` - Segments map[string]*EvaluationSegment `json:"segments,omitempty"` - Rank int32 `json:"rank,omitempty"` - SegmentOperator flipt.SegmentOperator `json:"segmentOperator,omitempty"` -} +// given flagKey matches a segment. +type EvaluationRule = evaluation.EvaluationRule -type EvaluationSegment struct { - SegmentKey string `json:"segment_key,omitempty"` - MatchType flipt.MatchType `json:"match_type,omitempty"` - Constraints []EvaluationConstraint `json:"constraints,omitempty"` -} +// EvaluationSegment represents a segment and constraints required for evaluating if a +// given flagKey matches the segment. +type EvaluationSegment = evaluation.EvaluationSegment // EvaluationRollout represents a rollout in the form that helps with evaluation. -type EvaluationRollout struct { - NamespaceKey string - RolloutType flipt.RolloutType - Rank int32 - Threshold *RolloutThreshold - Segment *RolloutSegment -} +type EvaluationRollout = evaluation.EvaluationRollout // RolloutThreshold represents Percentage(s) for use in evaluation. -type RolloutThreshold struct { - Percentage float32 - Value bool -} +type RolloutThreshold = evaluation.EvaluationRolloutThreshold // RolloutSegment represents Segment(s) for use in evaluation. -type RolloutSegment struct { - Value bool - SegmentOperator flipt.SegmentOperator - Segments map[string]*EvaluationSegment -} +type RolloutSegment = evaluation.EvaluationRolloutSegment // EvaluationConstraint represents a segment constraint that is used for evaluation -type EvaluationConstraint struct { - ID string `json:"id,omitempty"` - Type flipt.ComparisonType `json:"comparison_type,omitempty"` - Property string `json:"property,omitempty"` - Operator string `json:"operator,omitempty"` - Value string `json:"value,omitempty"` -} +type EvaluationConstraint = evaluation.EvaluationConstraint // EvaluationDistribution represents a rule distribution along with its variant for evaluation -type EvaluationDistribution struct { - ID string - RuleID string - VariantID string - Rollout float32 - VariantKey string - VariantAttachment string -} +type EvaluationDistribution = evaluation.EvaluationDistribution type QueryParams struct { Limit uint64 From bc167d2fc3b27da92fe7db5e92302ae8dc336602 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Sat, 4 Nov 2023 15:41:28 -0400 Subject: [PATCH 11/39] chore: fix tests --- internal/storage/sql/common/evaluation.go | 33 +++++++++++++++++++++-- internal/storage/sql/evaluation_test.go | 4 +-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/internal/storage/sql/common/evaluation.go b/internal/storage/sql/common/evaluation.go index 6915d767d6..1dbb1c4c67 100644 --- a/internal/storage/sql/common/evaluation.go +++ b/internal/storage/sql/common/evaluation.go @@ -126,7 +126,7 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st intermediateStorageRule.SegmentOperator = rm.SegmentOperator // check if we've seen this rule before - if _, ok := uniqueRules[intermediateStorageRule.ID]; ok { + if rule, ok := uniqueRules[intermediateStorageRule.ID]; ok { var constraint *storage.EvaluationConstraint if optionalConstraint.Id.Valid { constraint = &storage.EvaluationConstraint{ @@ -150,7 +150,12 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st ses.Constraints = []*storage.EvaluationConstraint{constraint} } + if _, ok := uniqueRuleSegments[intermediateStorageRule.ID]; !ok { + uniqueRuleSegments[intermediateStorageRule.ID] = make(map[string]*storage.EvaluationSegment) + } + uniqueRuleSegments[intermediateStorageRule.ID][intermediateStorageRule.SegmentKey] = ses + rule.Segments = append(rule.Segments, ses) } else if constraint != nil { segment.Constraints = append(segment.Constraints, constraint) } @@ -183,6 +188,12 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st ses.Constraints = []*storage.EvaluationConstraint{constraint} } + if _, ok := uniqueRuleSegments[intermediateStorageRule.ID]; !ok { + uniqueRuleSegments[intermediateStorageRule.ID] = make(map[string]*storage.EvaluationSegment) + } + + uniqueRuleSegments[intermediateStorageRule.ID][intermediateStorageRule.SegmentKey] = ses + newRule.Segments = append(newRule.Segments, ses) uniqueRules[newRule.Id] = newRule @@ -372,7 +383,8 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey } } - if _, ok := uniqueSegmentedRollouts[rolloutId]; ok { + // check if we've seen this rollout before + if rollout, ok := uniqueSegmentedRollouts[rolloutId]; ok { // check if segment exists and either append constraints to an already existing segment, // or add another segment to the map. es, innerOk := uniqueRolloutSegments[rolloutId][rsSegmentKey.String] @@ -390,6 +402,22 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey ses.Constraints = []*storage.EvaluationConstraint{constraint} } + if _, ok := uniqueRolloutSegments[rolloutId]; !ok { + uniqueRolloutSegments[rolloutId] = make(map[string]*storage.EvaluationSegment) + } + + if rollout.GetSegment() != nil { + rollout.GetSegment().Segments = append(rollout.GetSegment().Segments, ses) + } else { + rollout.Rule = &evaluation.EvaluationRollout_Segment{ + Segment: &storage.RolloutSegment{ + Value: rsSegmentValue.Bool, + SegmentOperator: flipt.SegmentOperator(rsSegmentOperator.Int32), + Segments: []*storage.EvaluationSegment{ses}, + }, + } + } + uniqueRolloutSegments[rolloutId][rsSegmentKey.String] = ses } @@ -416,6 +444,7 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey evaluationRollout.Rule = &evaluation.EvaluationRollout_Segment{ Segment: storageSegment, } + uniqueSegmentedRollouts[rolloutId] = &evaluationRollout } diff --git a/internal/storage/sql/evaluation_test.go b/internal/storage/sql/evaluation_test.go index 8b363d0944..7aee3f26c3 100644 --- a/internal/storage/sql/evaluation_test.go +++ b/internal/storage/sql/evaluation_test.go @@ -672,7 +672,7 @@ func (s *DBTestSuite) TestGetEvaluationRollouts() { assert.Equal(t, int32(2), evaluationRollouts[1].Rank) assert.NotNil(t, evaluationRollouts[1].GetSegment()) - assert.Contains(t, evaluationRollouts[1].GetSegment().Segments, segment.Key) + assert.Equal(t, evaluationRollouts[1].GetSegment().Segments[0].Key, segment.Key) assert.Equal(t, segment.MatchType, evaluationRollouts[1].GetSegment().Segments[0].MatchType) assert.True(t, evaluationRollouts[1].GetSegment().Value, "segment value is true") @@ -843,7 +843,7 @@ func (s *DBTestSuite) TestGetEvaluationRollouts_NonDefaultNamespace() { assert.Equal(t, int32(2), evaluationRollouts[1].Rank) assert.NotNil(t, evaluationRollouts[1].GetSegment()) - assert.Contains(t, evaluationRollouts[1].GetSegment().Segments, segment.Key) + assert.Equal(t, evaluationRollouts[1].GetSegment().Segments[0].Key, segment.Key) assert.Equal(t, segment.MatchType, evaluationRollouts[1].GetSegment().Segments[0].MatchType) assert.True(t, evaluationRollouts[1].GetSegment().Value, "segment value is true") From b84f26c21f864f306e281074fcfa4f7ff122c2c3 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Sat, 4 Nov 2023 15:48:18 -0400 Subject: [PATCH 12/39] chore: variable cleanup --- internal/storage/sql/common/evaluation.go | 139 +++++++++++----------- 1 file changed, 71 insertions(+), 68 deletions(-) diff --git a/internal/storage/sql/common/evaluation.go b/internal/storage/sql/common/evaluation.go index 1dbb1c4c67..e4d9c0f2d2 100644 --- a/internal/storage/sql/common/evaluation.go +++ b/internal/storage/sql/common/evaluation.go @@ -11,12 +11,28 @@ import ( "go.flipt.io/flipt/rpc/flipt/evaluation" ) +type rule struct { + ID string + Rank int32 + SegmentOperator flipt.SegmentOperator +} + +type intermediateRule struct { + ID string + NamespaceKey string + FlagKey string + SegmentKey string + SegmentMatchType flipt.MatchType + SegmentOperator flipt.SegmentOperator + Rank int32 +} + func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey string) (_ []*storage.EvaluationRule, err error) { if namespaceKey == "" { namespaceKey = storage.DefaultNamespace } - ruleMetaRows, err := s.builder. + ruleRows, err := s.builder. Select("id, \"rank\", segment_operator"). From("rules"). Where(sq.And{sq.Eq{"flag_key": flagKey}, sq.Eq{"namespace_key": namespaceKey}}). @@ -26,36 +42,32 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st } defer func() { - if cerr := ruleMetaRows.Close(); cerr != nil && err == nil { + if cerr := ruleRows.Close(); cerr != nil && err == nil { err = cerr } }() - type RuleMeta struct { - ID string - Rank int32 - SegmentOperator flipt.SegmentOperator - } - - var rmMap = make(map[string]*RuleMeta) + var ( + uniqueRules = make(map[string]*rule) + ruleIDs = make([]string, 0) + ) - ruleIDs := make([]string, 0) - for ruleMetaRows.Next() { - var rm RuleMeta + for ruleRows.Next() { + var r rule - if err := ruleMetaRows.Scan(&rm.ID, &rm.Rank, &rm.SegmentOperator); err != nil { + if err := ruleRows.Scan(&r.ID, &r.Rank, &r.SegmentOperator); err != nil { return nil, err } - rmMap[rm.ID] = &rm - ruleIDs = append(ruleIDs, rm.ID) + uniqueRules[r.ID] = &r + ruleIDs = append(ruleIDs, r.ID) } - if err := ruleMetaRows.Err(); err != nil { + if err := ruleRows.Err(); err != nil { return nil, err } - if err := ruleMetaRows.Close(); err != nil { + if err := ruleRows.Close(); err != nil { return nil, err } @@ -86,47 +98,39 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st var ( // ruleID -> rule - uniqueRules = make(map[string]*storage.EvaluationRule) + uniqueEvaluationRules = make(map[string]*storage.EvaluationRule) // ruleID -> segmentKey -> segment - uniqueRuleSegments = make(map[string]map[string]*storage.EvaluationSegment) - rules = []*storage.EvaluationRule{} + uniqueEvaluationRulesSegments = make(map[string]map[string]*storage.EvaluationSegment) + evaluationRules = []*storage.EvaluationRule{} ) for rows.Next() { var ( - intermediateStorageRule struct { - ID string - NamespaceKey string - FlagKey string - SegmentKey string - SegmentMatchType flipt.MatchType - SegmentOperator flipt.SegmentOperator - Rank int32 - } optionalConstraint optionalConstraint + intermediateRule intermediateRule ) if err := rows.Scan( - &intermediateStorageRule.ID, - &intermediateStorageRule.SegmentKey, - &intermediateStorageRule.SegmentMatchType, + &intermediateRule.ID, + &intermediateRule.SegmentKey, + &intermediateRule.SegmentMatchType, &optionalConstraint.Id, &optionalConstraint.Type, &optionalConstraint.Property, &optionalConstraint.Operator, &optionalConstraint.Value); err != nil { - return rules, err + return evaluationRules, err } - rm := rmMap[intermediateStorageRule.ID] + r := uniqueRules[intermediateRule.ID] - intermediateStorageRule.FlagKey = flagKey - intermediateStorageRule.NamespaceKey = namespaceKey - intermediateStorageRule.Rank = rm.Rank - intermediateStorageRule.SegmentOperator = rm.SegmentOperator + intermediateRule.FlagKey = flagKey + intermediateRule.NamespaceKey = namespaceKey + intermediateRule.Rank = r.Rank + intermediateRule.SegmentOperator = r.SegmentOperator // check if we've seen this rule before - if rule, ok := uniqueRules[intermediateStorageRule.ID]; ok { + if rule, ok := uniqueEvaluationRules[intermediateRule.ID]; ok { var constraint *storage.EvaluationConstraint if optionalConstraint.Id.Valid { constraint = &storage.EvaluationConstraint{ @@ -139,32 +143,32 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st } // check if we've seen this segment before for this rule - segment, ok := uniqueRuleSegments[intermediateStorageRule.ID][intermediateStorageRule.SegmentKey] + segment, ok := uniqueEvaluationRulesSegments[intermediateRule.ID][intermediateRule.SegmentKey] if !ok { - ses := &storage.EvaluationSegment{ - Key: intermediateStorageRule.SegmentKey, - MatchType: intermediateStorageRule.SegmentMatchType, + segment := &storage.EvaluationSegment{ + Key: intermediateRule.SegmentKey, + MatchType: intermediateRule.SegmentMatchType, } if constraint != nil { - ses.Constraints = []*storage.EvaluationConstraint{constraint} + segment.Constraints = []*storage.EvaluationConstraint{constraint} } - if _, ok := uniqueRuleSegments[intermediateStorageRule.ID]; !ok { - uniqueRuleSegments[intermediateStorageRule.ID] = make(map[string]*storage.EvaluationSegment) + if _, ok := uniqueEvaluationRulesSegments[intermediateRule.ID]; !ok { + uniqueEvaluationRulesSegments[intermediateRule.ID] = make(map[string]*storage.EvaluationSegment) } - uniqueRuleSegments[intermediateStorageRule.ID][intermediateStorageRule.SegmentKey] = ses - rule.Segments = append(rule.Segments, ses) + uniqueEvaluationRulesSegments[intermediateRule.ID][intermediateRule.SegmentKey] = segment + rule.Segments = append(rule.Segments, segment) } else if constraint != nil { segment.Constraints = append(segment.Constraints, constraint) } } else { // haven't seen this rule before - newRule := &storage.EvaluationRule{ - Id: intermediateStorageRule.ID, - Rank: intermediateStorageRule.Rank, - SegmentOperator: intermediateStorageRule.SegmentOperator, + rule := &storage.EvaluationRule{ + Id: intermediateRule.ID, + Rank: intermediateRule.Rank, + SegmentOperator: intermediateRule.SegmentOperator, Segments: []*storage.EvaluationSegment{}, } @@ -179,41 +183,40 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st } } - ses := &storage.EvaluationSegment{ - Key: intermediateStorageRule.SegmentKey, - MatchType: intermediateStorageRule.SegmentMatchType, + segment := &storage.EvaluationSegment{ + Key: intermediateRule.SegmentKey, + MatchType: intermediateRule.SegmentMatchType, } if constraint != nil { - ses.Constraints = []*storage.EvaluationConstraint{constraint} + segment.Constraints = []*storage.EvaluationConstraint{constraint} } - if _, ok := uniqueRuleSegments[intermediateStorageRule.ID]; !ok { - uniqueRuleSegments[intermediateStorageRule.ID] = make(map[string]*storage.EvaluationSegment) + if _, ok := uniqueEvaluationRulesSegments[intermediateRule.ID]; !ok { + uniqueEvaluationRulesSegments[intermediateRule.ID] = make(map[string]*storage.EvaluationSegment) } - uniqueRuleSegments[intermediateStorageRule.ID][intermediateStorageRule.SegmentKey] = ses - - newRule.Segments = append(newRule.Segments, ses) + uniqueEvaluationRulesSegments[intermediateRule.ID][intermediateRule.SegmentKey] = segment + rule.Segments = append(rule.Segments, segment) - uniqueRules[newRule.Id] = newRule - rules = append(rules, newRule) + uniqueEvaluationRules[rule.Id] = rule + evaluationRules = append(evaluationRules, rule) } } - sort.Slice(rules, func(i, j int) bool { - return rules[i].Rank < rules[j].Rank + sort.Slice(evaluationRules, func(i, j int) bool { + return evaluationRules[i].Rank < evaluationRules[j].Rank }) if err := rows.Err(); err != nil { - return rules, err + return evaluationRules, err } if err := rows.Close(); err != nil { - return rules, err + return evaluationRules, err } - return rules, nil + return evaluationRules, nil } func (s *Store) GetEvaluationDistributions(ctx context.Context, ruleID string) (_ []*storage.EvaluationDistribution, err error) { From d21513beb4d8f40e0a074440416f05c428fe4285 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Sat, 4 Nov 2023 15:55:14 -0400 Subject: [PATCH 13/39] chore: more variable renaming --- internal/storage/sql/common/evaluation.go | 61 ++++++++++++----------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/internal/storage/sql/common/evaluation.go b/internal/storage/sql/common/evaluation.go index e4d9c0f2d2..f08b48a4f7 100644 --- a/internal/storage/sql/common/evaluation.go +++ b/internal/storage/sql/common/evaluation.go @@ -326,10 +326,10 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey var ( // rolloutId -> rollout - uniqueSegmentedRollouts = make(map[string]*storage.EvaluationRollout) + uniqueEvaluationRollouts = make(map[string]*storage.EvaluationRollout) // rolloutId -> segmentKey -> segment - uniqueRolloutSegments = make(map[string]map[string]*storage.EvaluationSegment) - rollouts = []*storage.EvaluationRollout{} + uniqueEvaluationRolloutsSegments = make(map[string]map[string]*storage.EvaluationSegment) + evaluationRollouts = []*storage.EvaluationRollout{} ) for rows.Next() { @@ -360,7 +360,7 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey &optionalConstraint.Operator, &optionalConstraint.Value, ); err != nil { - return rollouts, err + return evaluationRollouts, err } if rtPercentageNumber.Valid && rtPercentageValue.Valid { @@ -387,76 +387,77 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey } // check if we've seen this rollout before - if rollout, ok := uniqueSegmentedRollouts[rolloutId]; ok { + if rollout, ok := uniqueEvaluationRollouts[rolloutId]; ok { // check if segment exists and either append constraints to an already existing segment, // or add another segment to the map. - es, innerOk := uniqueRolloutSegments[rolloutId][rsSegmentKey.String] - if innerOk { + if segment, ok := uniqueEvaluationRolloutsSegments[rolloutId][rsSegmentKey.String]; ok { if constraint != nil { - es.Constraints = append(es.Constraints, constraint) + segment.Constraints = append(segment.Constraints, constraint) } } else { - ses := &storage.EvaluationSegment{ + segment := &storage.EvaluationSegment{ Key: rsSegmentKey.String, MatchType: flipt.MatchType(rsMatchType.Int32), } if constraint != nil { - ses.Constraints = []*storage.EvaluationConstraint{constraint} + segment.Constraints = []*storage.EvaluationConstraint{constraint} } - if _, ok := uniqueRolloutSegments[rolloutId]; !ok { - uniqueRolloutSegments[rolloutId] = make(map[string]*storage.EvaluationSegment) + if _, ok := uniqueEvaluationRolloutsSegments[rolloutId]; !ok { + uniqueEvaluationRolloutsSegments[rolloutId] = make(map[string]*storage.EvaluationSegment) } if rollout.GetSegment() != nil { - rollout.GetSegment().Segments = append(rollout.GetSegment().Segments, ses) + rollout.GetSegment().Segments = append(rollout.GetSegment().Segments, segment) } else { rollout.Rule = &evaluation.EvaluationRollout_Segment{ Segment: &storage.RolloutSegment{ Value: rsSegmentValue.Bool, SegmentOperator: flipt.SegmentOperator(rsSegmentOperator.Int32), - Segments: []*storage.EvaluationSegment{ses}, + Segments: []*storage.EvaluationSegment{segment}, }, } } - uniqueRolloutSegments[rolloutId][rsSegmentKey.String] = ses + uniqueEvaluationRolloutsSegments[rolloutId][rsSegmentKey.String] = segment } + // this rollout has already been seen, so we can continue and dont need to add it to the slice continue } - storageSegment := &storage.RolloutSegment{ - Value: rsSegmentValue.Bool, - SegmentOperator: flipt.SegmentOperator(rsSegmentOperator.Int32), - Segments: []*storage.EvaluationSegment{}, - } - - ses := &storage.EvaluationSegment{ + // haven't seen this rollout before, so we need to create it and the segment + segment := &storage.EvaluationSegment{ Key: rsSegmentKey.String, MatchType: flipt.MatchType(rsMatchType.Int32), } if constraint != nil { - ses.Constraints = []*storage.EvaluationConstraint{constraint} + segment.Constraints = []*storage.EvaluationConstraint{constraint} } - storageSegment.Segments = append(storageSegment.Segments, ses) - evaluationRollout.Rule = &evaluation.EvaluationRollout_Segment{ - Segment: storageSegment, + Segment: &storage.RolloutSegment{ + Value: rsSegmentValue.Bool, + SegmentOperator: flipt.SegmentOperator(rsSegmentOperator.Int32), + Segments: []*storage.EvaluationSegment{segment}, + }, } - uniqueSegmentedRollouts[rolloutId] = &evaluationRollout + uniqueEvaluationRollouts[rolloutId] = &evaluationRollout } - rollouts = append(rollouts, &evaluationRollout) + evaluationRollouts = append(evaluationRollouts, &evaluationRollout) } if err := rows.Err(); err != nil { - return rollouts, err + return evaluationRollouts, err + } + + if err := rows.Close(); err != nil { + return evaluationRollouts, err } - return rollouts, nil + return evaluationRollouts, nil } From 4c4de0e7604b0e2ab859f95123923f084b14a34e Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:30:55 -0400 Subject: [PATCH 14/39] chore(wip): gah --- internal/server/data/server.go | 210 ++++++ rpc/flipt/data/data.pb.go | 1133 ++++++++++++++++++++++++++++++++ rpc/flipt/data/data.proto | 84 +++ rpc/flipt/data/data_grpc.pb.go | 109 +++ sdk/go/data.sdk.gen.go | 21 + sdk/go/grpc/grpc.sdk.gen.go | 5 + sdk/go/http/data.sdk.gen.go | 17 + sdk/go/sdk.gen.go | 9 + 8 files changed, 1588 insertions(+) create mode 100644 internal/server/data/server.go create mode 100644 rpc/flipt/data/data.pb.go create mode 100644 rpc/flipt/data/data.proto create mode 100644 rpc/flipt/data/data_grpc.pb.go create mode 100644 sdk/go/data.sdk.gen.go create mode 100644 sdk/go/http/data.sdk.gen.go diff --git a/internal/server/data/server.go b/internal/server/data/server.go new file mode 100644 index 0000000000..ba3285a9c9 --- /dev/null +++ b/internal/server/data/server.go @@ -0,0 +1,210 @@ +package data + +import ( + "context" + "encoding/json" + "fmt" + + "go.flipt.io/flipt/internal/storage" + "go.flipt.io/flipt/rpc/flipt" + "go.flipt.io/flipt/rpc/flipt/data" + "go.uber.org/zap" +) + +type Server struct { + logger *zap.Logger + store storage.Store + + data.UnimplementedDataServer +} + +func NewServer(logger *zap.Logger, store storage.Store) *Server { + return &Server{ + logger: logger, + store: store, + } +} + +func (s *Server) Snapshot(ctx context.Context, r *data.NamespaceRequest) (*data.NamespaceResponse, error) { + var ( + namespaceKey = r.Key + resp = &data.NamespaceResponse{} + remaining = true + nextPage string + ) + + // flags/variants in batches + for batch := int32(0); remaining; batch++ { + res, err := s.store.ListFlags( + ctx, + namespaceKey, + storage.WithPageToken(nextPage), + ) + if err != nil { + return nil, fmt.Errorf("getting flags: %w", err) + } + + flags := res.Results + nextPage = res.NextPageToken + remaining = nextPage != "" + + for _, f := range flags { + flag := &data.Flag{ + Key: f.Key, + Name: f.Name, + Type: f.Type.String(), + Description: f.Description, + Enabled: f.Enabled, + } + + // map variant id => variant key + variantKeys := make(map[string]string) + + for _, v := range f.Variants { + var attachment interface{} + + if v.Attachment != "" { + if err := json.Unmarshal([]byte(v.Attachment), &attachment); err != nil { + return nil, fmt.Errorf("unmarshaling variant attachment: %w", err) + } + } + + flag.Variants = append(flag.Variants, &data.Variant{ + Key: v.Key, + Name: v.Name, + Description: v.Description, + Attachment: attachment, + }) + + variantKeys[v.Id] = v.Key + } + + // rules for flag + resp, err := e.store.ListRules( + ctx, + &flipt.ListRuleRequest{ + NamespaceKey: namespaces[i], + FlagKey: flag.Key, + }, + ) + if err != nil { + return fmt.Errorf("getting rules for flag %q: %w", flag.Key, err) + } + + rules := resp.Rules + for _, r := range rules { + rule := &Rule{} + + switch { + case r.SegmentKey != "": + rule.Segment = &SegmentEmbed{ + IsSegment: SegmentKey(r.SegmentKey), + } + case len(r.SegmentKeys) > 0: + rule.Segment = &SegmentEmbed{ + IsSegment: &Segments{ + Keys: r.SegmentKeys, + SegmentOperator: r.SegmentOperator.String(), + }, + } + default: + return fmt.Errorf("wrong format for rule segments") + } + + for _, d := range r.Distributions { + rule.Distributions = append(rule.Distributions, &Distribution{ + VariantKey: variantKeys[d.VariantId], + Rollout: d.Rollout, + }) + } + + flag.Rules = append(flag.Rules, rule) + } + + rollouts, err := e.store.ListRollouts(ctx, &flipt.ListRolloutRequest{ + NamespaceKey: namespaces[i], + FlagKey: flag.Key, + }) + if err != nil { + return fmt.Errorf("getting rollout rules for flag %q: %w", flag.Key, err) + } + + for _, r := range rollouts.Rules { + rollout := Rollout{ + Description: r.Description, + } + + switch rule := r.Rule.(type) { + case *flipt.Rollout_Segment: + rollout.Segment = &SegmentRule{ + Value: rule.Segment.Value, + } + + if rule.Segment.SegmentKey != "" { + rollout.Segment.Key = rule.Segment.SegmentKey + } else if len(rule.Segment.SegmentKeys) > 0 { + rollout.Segment.Keys = rule.Segment.SegmentKeys + } + + if rule.Segment.SegmentOperator == flipt.SegmentOperator_AND_SEGMENT_OPERATOR { + rollout.Segment.Operator = rule.Segment.SegmentOperator.String() + } + case *flipt.Rollout_Threshold: + rollout.Threshold = &ThresholdRule{ + Percentage: rule.Threshold.Percentage, + Value: rule.Threshold.Value, + } + } + + flag.Rollouts = append(flag.Rollouts, &rollout) + } + + doc.Flags = append(doc.Flags, flag) + } + } + + remaining = true + nextPage = "" + + // segments/constraints in batches + for batch := int32(0); remaining; batch++ { + resp, err := e.store.ListSegments( + ctx, + &flipt.ListSegmentRequest{ + NamespaceKey: namespaces[i], + PageToken: nextPage, + Limit: batchSize, + }, + ) + if err != nil { + return fmt.Errorf("getting segments: %w", err) + } + + segments := resp.Segments + nextPage = resp.NextPageToken + remaining = nextPage != "" + + for _, s := range segments { + segment := &Segment{ + Key: s.Key, + Name: s.Name, + Description: s.Description, + MatchType: s.MatchType.String(), + } + + for _, c := range s.Constraints { + segment.Constraints = append(segment.Constraints, &Constraint{ + Type: c.Type.String(), + Property: c.Property, + Operator: c.Operator, + Value: c.Value, + Description: c.Description, + }) + } + + doc.Segments = append(doc.Segments, segment) + } + } + + return nil, nil +} diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go new file mode 100644 index 0000000000..cad9a880f1 --- /dev/null +++ b/rpc/flipt/data/data.pb.go @@ -0,0 +1,1133 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: data/data.proto + +package data + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Flag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + Variants []*Variant `protobuf:"bytes,8,rep,name=variants,proto3" json:"variants,omitempty"` + Rules []*Rule `protobuf:"bytes,9,rep,name=rules,proto3" json:"rules,omitempty"` +} + +func (x *Flag) Reset() { + *x = Flag{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Flag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Flag) ProtoMessage() {} + +func (x *Flag) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Flag.ProtoReflect.Descriptor instead. +func (*Flag) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{0} +} + +func (x *Flag) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Flag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Flag) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Flag) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *Flag) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Flag) GetVariants() []*Variant { + if x != nil { + return x.Variants + } + return nil +} + +func (x *Flag) GetRules() []*Rule { + if x != nil { + return x.Rules + } + return nil +} + +type Rule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Segments *Rule_SegmentsRule `protobuf:"bytes,1,opt,name=segments,proto3" json:"segments,omitempty"` + Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` + Distributions []*Distribution `protobuf:"bytes,3,rep,name=distributions,proto3" json:"distributions,omitempty"` +} + +func (x *Rule) Reset() { + *x = Rule{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rule) ProtoMessage() {} + +func (x *Rule) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rule.ProtoReflect.Descriptor instead. +func (*Rule) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{1} +} + +func (x *Rule) GetSegments() *Rule_SegmentsRule { + if x != nil { + return x.Segments + } + return nil +} + +func (x *Rule) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *Rule) GetDistributions() []*Distribution { + if x != nil { + return x.Distributions + } + return nil +} + +type Rollout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Segment *Rollout_SegmentsRollout `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` + Threshold *Rollout_ThresholdRollout `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *Rollout) Reset() { + *x = Rollout{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rollout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rollout) ProtoMessage() {} + +func (x *Rollout) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rollout.ProtoReflect.Descriptor instead. +func (*Rollout) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{2} +} + +func (x *Rollout) GetSegment() *Rollout_SegmentsRollout { + if x != nil { + return x.Segment + } + return nil +} + +func (x *Rollout) GetThreshold() *Rollout_ThresholdRollout { + if x != nil { + return x.Threshold + } + return nil +} + +func (x *Rollout) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type Distribution struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VariantKey string `protobuf:"bytes,1,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` + Rollout float32 `protobuf:"fixed32,2,opt,name=rollout,proto3" json:"rollout,omitempty"` +} + +func (x *Distribution) Reset() { + *x = Distribution{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Distribution) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Distribution) ProtoMessage() {} + +func (x *Distribution) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Distribution.ProtoReflect.Descriptor instead. +func (*Distribution) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{3} +} + +func (x *Distribution) GetVariantKey() string { + if x != nil { + return x.VariantKey + } + return "" +} + +func (x *Distribution) GetRollout() float32 { + if x != nil { + return x.Rollout + } + return 0 +} + +type Variant struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Attachment string `protobuf:"bytes,4,opt,name=attachment,proto3" json:"attachment,omitempty"` +} + +func (x *Variant) Reset() { + *x = Variant{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Variant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Variant) ProtoMessage() {} + +func (x *Variant) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Variant.ProtoReflect.Descriptor instead. +func (*Variant) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{4} +} + +func (x *Variant) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Variant) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Variant) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Variant) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +type Segment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + MatchType string `protobuf:"bytes,4,opt,name=match_type,json=matchType,proto3" json:"match_type,omitempty"` + Constraints []*Constraint `protobuf:"bytes,5,rep,name=constraints,proto3" json:"constraints,omitempty"` +} + +func (x *Segment) Reset() { + *x = Segment{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Segment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Segment) ProtoMessage() {} + +func (x *Segment) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Segment.ProtoReflect.Descriptor instead. +func (*Segment) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{5} +} + +func (x *Segment) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Segment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Segment) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Segment) GetMatchType() string { + if x != nil { + return x.MatchType + } + return "" +} + +func (x *Segment) GetConstraints() []*Constraint { + if x != nil { + return x.Constraints + } + return nil +} + +type Constraint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Property string `protobuf:"bytes,2,opt,name=property,proto3" json:"property,omitempty"` + Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` + Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *Constraint) Reset() { + *x = Constraint{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Constraint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Constraint) ProtoMessage() {} + +func (x *Constraint) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Constraint.ProtoReflect.Descriptor instead. +func (*Constraint) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{6} +} + +func (x *Constraint) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Constraint) GetProperty() string { + if x != nil { + return x.Property + } + return "" +} + +func (x *Constraint) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *Constraint) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *Constraint) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +type NamespaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *NamespaceRequest) Reset() { + *x = NamespaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NamespaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NamespaceRequest) ProtoMessage() {} + +func (x *NamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NamespaceRequest.ProtoReflect.Descriptor instead. +func (*NamespaceRequest) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{7} +} + +func (x *NamespaceRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type NamespaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Flags []*Flag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` + Segments []*Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` +} + +func (x *NamespaceResponse) Reset() { + *x = NamespaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NamespaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NamespaceResponse) ProtoMessage() {} + +func (x *NamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NamespaceResponse.ProtoReflect.Descriptor instead. +func (*NamespaceResponse) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{8} +} + +func (x *NamespaceResponse) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *NamespaceResponse) GetFlags() []*Flag { + if x != nil { + return x.Flags + } + return nil +} + +func (x *NamespaceResponse) GetSegments() []*Segment { + if x != nil { + return x.Segments + } + return nil +} + +type Rule_SegmentsRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` + SegmentOperator string `protobuf:"bytes,2,opt,name=segment_operator,json=segmentOperator,proto3" json:"segment_operator,omitempty"` +} + +func (x *Rule_SegmentsRule) Reset() { + *x = Rule_SegmentsRule{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rule_SegmentsRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rule_SegmentsRule) ProtoMessage() {} + +func (x *Rule_SegmentsRule) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rule_SegmentsRule.ProtoReflect.Descriptor instead. +func (*Rule_SegmentsRule) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *Rule_SegmentsRule) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +func (x *Rule_SegmentsRule) GetSegmentOperator() string { + if x != nil { + return x.SegmentOperator + } + return "" +} + +type Rollout_SegmentsRollout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` + SegmentOperator string `protobuf:"bytes,2,opt,name=segment_operator,json=segmentOperator,proto3" json:"segment_operator,omitempty"` + Value bool `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Rollout_SegmentsRollout) Reset() { + *x = Rollout_SegmentsRollout{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rollout_SegmentsRollout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rollout_SegmentsRollout) ProtoMessage() {} + +func (x *Rollout_SegmentsRollout) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rollout_SegmentsRollout.ProtoReflect.Descriptor instead. +func (*Rollout_SegmentsRollout) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *Rollout_SegmentsRollout) GetKeys() []string { + if x != nil { + return x.Keys + } + return nil +} + +func (x *Rollout_SegmentsRollout) GetSegmentOperator() string { + if x != nil { + return x.SegmentOperator + } + return "" +} + +func (x *Rollout_SegmentsRollout) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +type Rollout_ThresholdRollout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` + Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Rollout_ThresholdRollout) Reset() { + *x = Rollout_ThresholdRollout{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rollout_ThresholdRollout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rollout_ThresholdRollout) ProtoMessage() {} + +func (x *Rollout_ThresholdRollout) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Rollout_ThresholdRollout.ProtoReflect.Descriptor instead. +func (*Rollout_ThresholdRollout) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *Rollout_ThresholdRollout) GetPercentage() float32 { + if x != nil { + return x.Percentage + } + return 0 +} + +func (x *Rollout_ThresholdRollout) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +var File_data_data_proto protoreflect.FileDescriptor + +var file_data_data_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd5, 0x01, + 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x08, + 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x61, 0x72, 0x69, + 0x61, 0x6e, 0x74, 0x52, 0x08, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, + 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, + 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x39, + 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x75, + 0x6c, 0x65, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x52, + 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, + 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x3e, 0x0a, + 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4d, 0x0a, + 0x0c, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, + 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xe0, 0x02, 0x0a, + 0x07, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x2e, 0x53, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x07, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x2e, + 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, + 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x66, 0x0a, + 0x0f, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, + 0x6b, 0x65, 0x79, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x48, 0x0a, 0x10, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, + 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x49, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0x71, 0x0a, 0x07, 0x56, 0x61, + 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xaa, 0x01, + 0x0a, 0x07, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0a, 0x43, + 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a, + 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x22, 0x7e, 0x0a, 0x11, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x66, 0x6c, + 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, + 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x32, 0x4f, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x08, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_data_data_proto_rawDescOnce sync.Once + file_data_data_proto_rawDescData = file_data_data_proto_rawDesc +) + +func file_data_data_proto_rawDescGZIP() []byte { + file_data_data_proto_rawDescOnce.Do(func() { + file_data_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_data_data_proto_rawDescData) + }) + return file_data_data_proto_rawDescData +} + +var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_data_data_proto_goTypes = []interface{}{ + (*Flag)(nil), // 0: flipt.data.Flag + (*Rule)(nil), // 1: flipt.data.Rule + (*Rollout)(nil), // 2: flipt.data.Rollout + (*Distribution)(nil), // 3: flipt.data.Distribution + (*Variant)(nil), // 4: flipt.data.Variant + (*Segment)(nil), // 5: flipt.data.Segment + (*Constraint)(nil), // 6: flipt.data.Constraint + (*NamespaceRequest)(nil), // 7: flipt.data.NamespaceRequest + (*NamespaceResponse)(nil), // 8: flipt.data.NamespaceResponse + (*Rule_SegmentsRule)(nil), // 9: flipt.data.Rule.SegmentsRule + (*Rollout_SegmentsRollout)(nil), // 10: flipt.data.Rollout.SegmentsRollout + (*Rollout_ThresholdRollout)(nil), // 11: flipt.data.Rollout.ThresholdRollout +} +var file_data_data_proto_depIdxs = []int32{ + 4, // 0: flipt.data.Flag.variants:type_name -> flipt.data.Variant + 1, // 1: flipt.data.Flag.rules:type_name -> flipt.data.Rule + 9, // 2: flipt.data.Rule.segments:type_name -> flipt.data.Rule.SegmentsRule + 3, // 3: flipt.data.Rule.distributions:type_name -> flipt.data.Distribution + 10, // 4: flipt.data.Rollout.segment:type_name -> flipt.data.Rollout.SegmentsRollout + 11, // 5: flipt.data.Rollout.threshold:type_name -> flipt.data.Rollout.ThresholdRollout + 6, // 6: flipt.data.Segment.constraints:type_name -> flipt.data.Constraint + 0, // 7: flipt.data.NamespaceResponse.flags:type_name -> flipt.data.Flag + 5, // 8: flipt.data.NamespaceResponse.segments:type_name -> flipt.data.Segment + 7, // 9: flipt.data.Data.Snapshot:input_type -> flipt.data.NamespaceRequest + 8, // 10: flipt.data.Data.Snapshot:output_type -> flipt.data.NamespaceResponse + 10, // [10:11] is the sub-list for method output_type + 9, // [9:10] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_data_data_proto_init() } +func file_data_data_proto_init() { + if File_data_data_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_data_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Flag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rollout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Distribution); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Variant); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Segment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Constraint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamespaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NamespaceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rule_SegmentsRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rollout_SegmentsRollout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rollout_ThresholdRollout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_data_data_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_data_data_proto_goTypes, + DependencyIndexes: file_data_data_proto_depIdxs, + MessageInfos: file_data_data_proto_msgTypes, + }.Build() + File_data_data_proto = out.File + file_data_data_proto_rawDesc = nil + file_data_data_proto_goTypes = nil + file_data_data_proto_depIdxs = nil +} diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto new file mode 100644 index 0000000000..33d712e964 --- /dev/null +++ b/rpc/flipt/data/data.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; + +package flipt.data; + +option go_package = "go.flipt.io/flipt/rpc/flipt/data"; + +message Flag { + string key = 1; + string name = 2; + string description = 3; + bool enabled = 4; + string type = 5; + repeated Variant variants = 8; + repeated Rule rules = 9; +} + +message Rule { + message SegmentsRule { + repeated string keys = 1; + string segment_operator = 2; + } + SegmentsRule segments = 1; + int32 rank = 2; + repeated Distribution distributions = 3; +} + +message Rollout { + message SegmentsRollout { + repeated string keys = 1; + string segment_operator = 2; + bool value = 3; + } + message ThresholdRollout { + float percentage = 1; + bool value = 2; + } + SegmentsRollout segment = 1; + ThresholdRollout threshold = 2; + string description = 3; +} + +message Distribution { + string variant_key = 1; + float rollout = 2; +} + +message Variant { + string key = 1; + string name = 2; + string description = 3; + string attachment = 4; +} + +message Segment { + string key = 1; + string name = 2; + string description = 3; + string match_type = 4; + repeated Constraint constraints = 5; +} + +message Constraint { + string type = 1; + string property = 2; + string operator = 3; + string value = 4; + string description = 5; +} + +message NamespaceRequest { + string key = 1; + //int32 limit = 2; + //string page_token = 3; +} + +message NamespaceResponse { + string key = 1; + repeated Flag flags = 2; + repeated Segment segments = 3; +} + +service Data { + rpc Snapshot(NamespaceRequest) returns (NamespaceResponse); +} diff --git a/rpc/flipt/data/data_grpc.pb.go b/rpc/flipt/data/data_grpc.pb.go new file mode 100644 index 0000000000..8f4aa52f2f --- /dev/null +++ b/rpc/flipt/data/data_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: data/data.proto + +package data + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Data_Snapshot_FullMethodName = "/flipt.data.Data/Snapshot" +) + +// DataClient is the client API for Data service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DataClient interface { + Snapshot(ctx context.Context, in *NamespaceRequest, opts ...grpc.CallOption) (*NamespaceResponse, error) +} + +type dataClient struct { + cc grpc.ClientConnInterface +} + +func NewDataClient(cc grpc.ClientConnInterface) DataClient { + return &dataClient{cc} +} + +func (c *dataClient) Snapshot(ctx context.Context, in *NamespaceRequest, opts ...grpc.CallOption) (*NamespaceResponse, error) { + out := new(NamespaceResponse) + err := c.cc.Invoke(ctx, Data_Snapshot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DataServer is the server API for Data service. +// All implementations must embed UnimplementedDataServer +// for forward compatibility +type DataServer interface { + Snapshot(context.Context, *NamespaceRequest) (*NamespaceResponse, error) + mustEmbedUnimplementedDataServer() +} + +// UnimplementedDataServer must be embedded to have forward compatible implementations. +type UnimplementedDataServer struct { +} + +func (UnimplementedDataServer) Snapshot(context.Context, *NamespaceRequest) (*NamespaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Snapshot not implemented") +} +func (UnimplementedDataServer) mustEmbedUnimplementedDataServer() {} + +// UnsafeDataServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DataServer will +// result in compilation errors. +type UnsafeDataServer interface { + mustEmbedUnimplementedDataServer() +} + +func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) { + s.RegisterService(&Data_ServiceDesc, srv) +} + +func _Data_Snapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NamespaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataServer).Snapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Data_Snapshot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataServer).Snapshot(ctx, req.(*NamespaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Data_ServiceDesc is the grpc.ServiceDesc for Data service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Data_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipt.data.Data", + HandlerType: (*DataServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Snapshot", + Handler: _Data_Snapshot_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "data/data.proto", +} diff --git a/sdk/go/data.sdk.gen.go b/sdk/go/data.sdk.gen.go new file mode 100644 index 0000000000..6e0ac6f213 --- /dev/null +++ b/sdk/go/data.sdk.gen.go @@ -0,0 +1,21 @@ +// Code generated by protoc-gen-go-flipt-sdk. DO NOT EDIT. + +package sdk + +import ( + context "context" + data "go.flipt.io/flipt/rpc/flipt/data" +) + +type Data struct { + transport data.DataClient + tokenProvider ClientTokenProvider +} + +func (x *Data) Snapshot(ctx context.Context, v *data.NamespaceRequest) (*data.NamespaceResponse, error) { + ctx, err := authenticate(ctx, x.tokenProvider) + if err != nil { + return nil, err + } + return x.transport.Snapshot(ctx, v) +} diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index 96f7cd0644..89d95741a4 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -5,6 +5,7 @@ package grpc import ( flipt "go.flipt.io/flipt/rpc/flipt" auth "go.flipt.io/flipt/rpc/flipt/auth" + data "go.flipt.io/flipt/rpc/flipt/data" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" _go "go.flipt.io/flipt/sdk/go" @@ -53,6 +54,10 @@ func (t Transport) AuthClient() _go.AuthClient { return authClient{cc: t.cc} } +func (t Transport) DataClient() data.DataClient { + return data.NewDataClient(t.cc) +} + func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { return evaluation.NewEvaluationServiceClient(t.cc) } diff --git a/sdk/go/http/data.sdk.gen.go b/sdk/go/http/data.sdk.gen.go new file mode 100644 index 0000000000..e6fbf7982b --- /dev/null +++ b/sdk/go/http/data.sdk.gen.go @@ -0,0 +1,17 @@ +// Code generated by protoc-gen-go-flipt-sdk. DO NOT EDIT. + +package http + +import ( + data "go.flipt.io/flipt/rpc/flipt/data" + http "net/http" +) + +type DataClient struct { + client *http.Client + addr string +} + +func (t Transport) DataClient() data.DataClient { + return &DataClient{client: t.client, addr: t.addr} +} diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index 13952f90bc..04e5ef8ed9 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -5,6 +5,7 @@ package sdk import ( context "context" flipt "go.flipt.io/flipt/rpc/flipt" + data "go.flipt.io/flipt/rpc/flipt/data" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" metadata "google.golang.org/grpc/metadata" @@ -12,6 +13,7 @@ import ( type Transport interface { AuthClient() AuthClient + DataClient() data.DataClient EvaluationClient() evaluation.EvaluationServiceClient FliptClient() flipt.FliptClient MetaClient() meta.MetadataServiceClient @@ -73,6 +75,13 @@ func (s SDK) Auth() *Auth { } } +func (s SDK) Data() *Data { + return &Data{ + transport: s.transport.DataClient(), + tokenProvider: s.tokenProvider, + } +} + func (s SDK) Evaluation() *Evaluation { return &Evaluation{ transport: s.transport.EvaluationClient(), From b654587b4e88f14aae69b03a9b1fe17db60c8778 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Wed, 1 Nov 2023 20:35:27 -0400 Subject: [PATCH 15/39] feat(wip): snapshot api --- internal/ext/exporter.go | 4 +- internal/server/data/server.go | 167 +---- rpc/flipt/data/data.pb.go | 1053 ++++---------------------------- rpc/flipt/data/data.pb.gw.go | 189 ++++++ rpc/flipt/data/data.proto | 81 +-- rpc/flipt/data/data_grpc.pb.go | 74 +-- rpc/flipt/flipt.yaml | 3 + sdk/go/data.sdk.gen.go | 6 +- sdk/go/grpc/grpc.sdk.gen.go | 12 +- sdk/go/http/data.sdk.gen.go | 39 +- sdk/go/sdk.gen.go | 18 +- 11 files changed, 429 insertions(+), 1217 deletions(-) create mode 100644 rpc/flipt/data/data.pb.gw.go diff --git a/internal/ext/exporter.go b/internal/ext/exporter.go index 46d5df3015..cd7c531351 100644 --- a/internal/ext/exporter.go +++ b/internal/ext/exporter.go @@ -75,7 +75,7 @@ func (e *Exporter) Export(ctx context.Context, w io.Writer) error { intermediateNamespaces := make([]string, 0) - for batch := int32(0); remaining; batch++ { + for remaining { resp, err := e.store.ListNamespaces(ctx, &flipt.ListNamespaceRequest{ PageToken: nextPage, Limit: batchSize, @@ -246,7 +246,7 @@ func (e *Exporter) Export(ctx context.Context, w io.Writer) error { nextPage = "" // export segments/constraints in batches - for batch := int32(0); remaining; batch++ { + for remaining { resp, err := e.store.ListSegments( ctx, &flipt.ListSegmentRequest{ diff --git a/internal/server/data/server.go b/internal/server/data/server.go index ba3285a9c9..dc92952f9a 100644 --- a/internal/server/data/server.go +++ b/internal/server/data/server.go @@ -2,7 +2,6 @@ package data import ( "context" - "encoding/json" "fmt" "go.flipt.io/flipt/internal/storage" @@ -25,16 +24,19 @@ func NewServer(logger *zap.Logger, store storage.Store) *Server { } } -func (s *Server) Snapshot(ctx context.Context, r *data.NamespaceRequest) (*data.NamespaceResponse, error) { +func (s *Server) SnapshotNamespace(ctx context.Context, r *data.SnapshotNamespaceRequest) (*data.SnapshotNamespaceResponse, error) { var ( namespaceKey = r.Key - resp = &data.NamespaceResponse{} - remaining = true - nextPage string + resp = &data.SnapshotNamespaceResponse{ + Rules: make(map[string]*flipt.RuleList), + Rollouts: make(map[string]*flipt.RolloutList), + } + remaining = true + nextPage string ) // flags/variants in batches - for batch := int32(0); remaining; batch++ { + for remaining { res, err := s.store.ListFlags( ctx, namespaceKey, @@ -48,118 +50,33 @@ func (s *Server) Snapshot(ctx context.Context, r *data.NamespaceRequest) (*data. nextPage = res.NextPageToken remaining = nextPage != "" - for _, f := range flags { - flag := &data.Flag{ - Key: f.Key, - Name: f.Name, - Type: f.Type.String(), - Description: f.Description, - Enabled: f.Enabled, - } - - // map variant id => variant key - variantKeys := make(map[string]string) - - for _, v := range f.Variants { - var attachment interface{} - - if v.Attachment != "" { - if err := json.Unmarshal([]byte(v.Attachment), &attachment); err != nil { - return nil, fmt.Errorf("unmarshaling variant attachment: %w", err) - } - } - - flag.Variants = append(flag.Variants, &data.Variant{ - Key: v.Key, - Name: v.Name, - Description: v.Description, - Attachment: attachment, - }) - - variantKeys[v.Id] = v.Key - } + resp.Flags = flags + for _, f := range flags { // rules for flag - resp, err := e.store.ListRules( + rules, err := s.store.ListRules( ctx, - &flipt.ListRuleRequest{ - NamespaceKey: namespaces[i], - FlagKey: flag.Key, - }, + namespaceKey, + f.Key, ) if err != nil { - return fmt.Errorf("getting rules for flag %q: %w", flag.Key, err) + return nil, fmt.Errorf("getting rules for flag %q: %w", f.Key, err) } - rules := resp.Rules - for _, r := range rules { - rule := &Rule{} - - switch { - case r.SegmentKey != "": - rule.Segment = &SegmentEmbed{ - IsSegment: SegmentKey(r.SegmentKey), - } - case len(r.SegmentKeys) > 0: - rule.Segment = &SegmentEmbed{ - IsSegment: &Segments{ - Keys: r.SegmentKeys, - SegmentOperator: r.SegmentOperator.String(), - }, - } - default: - return fmt.Errorf("wrong format for rule segments") - } - - for _, d := range r.Distributions { - rule.Distributions = append(rule.Distributions, &Distribution{ - VariantKey: variantKeys[d.VariantId], - Rollout: d.Rollout, - }) - } - - flag.Rules = append(flag.Rules, rule) + resp.Rules[f.Key] = &flipt.RuleList{ + Rules: rules.Results, + TotalCount: int32(len(rules.Results)), } - rollouts, err := e.store.ListRollouts(ctx, &flipt.ListRolloutRequest{ - NamespaceKey: namespaces[i], - FlagKey: flag.Key, - }) + rollouts, err := s.store.ListRollouts(ctx, namespaceKey, f.Key) if err != nil { - return fmt.Errorf("getting rollout rules for flag %q: %w", flag.Key, err) + return nil, fmt.Errorf("getting rollout rules for flag %q: %w", f.Key, err) } - for _, r := range rollouts.Rules { - rollout := Rollout{ - Description: r.Description, - } - - switch rule := r.Rule.(type) { - case *flipt.Rollout_Segment: - rollout.Segment = &SegmentRule{ - Value: rule.Segment.Value, - } - - if rule.Segment.SegmentKey != "" { - rollout.Segment.Key = rule.Segment.SegmentKey - } else if len(rule.Segment.SegmentKeys) > 0 { - rollout.Segment.Keys = rule.Segment.SegmentKeys - } - - if rule.Segment.SegmentOperator == flipt.SegmentOperator_AND_SEGMENT_OPERATOR { - rollout.Segment.Operator = rule.Segment.SegmentOperator.String() - } - case *flipt.Rollout_Threshold: - rollout.Threshold = &ThresholdRule{ - Percentage: rule.Threshold.Percentage, - Value: rule.Threshold.Value, - } - } - - flag.Rollouts = append(flag.Rollouts, &rollout) + resp.Rollouts[f.Key] = &flipt.RolloutList{ + Rules: rollouts.Results, + TotalCount: int32(len(rollouts.Results)), } - - doc.Flags = append(doc.Flags, flag) } } @@ -167,44 +84,22 @@ func (s *Server) Snapshot(ctx context.Context, r *data.NamespaceRequest) (*data. nextPage = "" // segments/constraints in batches - for batch := int32(0); remaining; batch++ { - resp, err := e.store.ListSegments( + for remaining { + res, err := s.store.ListSegments( ctx, - &flipt.ListSegmentRequest{ - NamespaceKey: namespaces[i], - PageToken: nextPage, - Limit: batchSize, - }, + namespaceKey, + storage.WithPageToken(nextPage), ) if err != nil { - return fmt.Errorf("getting segments: %w", err) + return nil, fmt.Errorf("getting segments: %w", err) } - segments := resp.Segments - nextPage = resp.NextPageToken + segments := res.Results + nextPage = res.NextPageToken remaining = nextPage != "" - for _, s := range segments { - segment := &Segment{ - Key: s.Key, - Name: s.Name, - Description: s.Description, - MatchType: s.MatchType.String(), - } - - for _, c := range s.Constraints { - segment.Constraints = append(segment.Constraints, &Constraint{ - Type: c.Type.String(), - Property: c.Property, - Operator: c.Operator, - Value: c.Value, - Description: c.Description, - }) - } - - doc.Segments = append(doc.Segments, segment) - } + resp.Segments = append(resp.Segments, segments...) } - return nil, nil + return resp, nil } diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go index cad9a880f1..597cde106b 100644 --- a/rpc/flipt/data/data.pb.go +++ b/rpc/flipt/data/data.pb.go @@ -7,6 +7,7 @@ package data import ( + flipt "go.flipt.io/flipt/rpc/flipt" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,512 +21,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type Flag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` - Variants []*Variant `protobuf:"bytes,8,rep,name=variants,proto3" json:"variants,omitempty"` - Rules []*Rule `protobuf:"bytes,9,rep,name=rules,proto3" json:"rules,omitempty"` -} - -func (x *Flag) Reset() { - *x = Flag{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Flag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Flag) ProtoMessage() {} - -func (x *Flag) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Flag.ProtoReflect.Descriptor instead. -func (*Flag) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{0} -} - -func (x *Flag) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Flag) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Flag) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Flag) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *Flag) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Flag) GetVariants() []*Variant { - if x != nil { - return x.Variants - } - return nil -} - -func (x *Flag) GetRules() []*Rule { - if x != nil { - return x.Rules - } - return nil -} - -type Rule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Segments *Rule_SegmentsRule `protobuf:"bytes,1,opt,name=segments,proto3" json:"segments,omitempty"` - Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` - Distributions []*Distribution `protobuf:"bytes,3,rep,name=distributions,proto3" json:"distributions,omitempty"` -} - -func (x *Rule) Reset() { - *x = Rule{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rule) ProtoMessage() {} - -func (x *Rule) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rule.ProtoReflect.Descriptor instead. -func (*Rule) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{1} -} - -func (x *Rule) GetSegments() *Rule_SegmentsRule { - if x != nil { - return x.Segments - } - return nil -} - -func (x *Rule) GetRank() int32 { - if x != nil { - return x.Rank - } - return 0 -} - -func (x *Rule) GetDistributions() []*Distribution { - if x != nil { - return x.Distributions - } - return nil -} - -type Rollout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Segment *Rollout_SegmentsRollout `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` - Threshold *Rollout_ThresholdRollout `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` -} - -func (x *Rollout) Reset() { - *x = Rollout{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rollout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rollout) ProtoMessage() {} - -func (x *Rollout) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rollout.ProtoReflect.Descriptor instead. -func (*Rollout) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{2} -} - -func (x *Rollout) GetSegment() *Rollout_SegmentsRollout { - if x != nil { - return x.Segment - } - return nil -} - -func (x *Rollout) GetThreshold() *Rollout_ThresholdRollout { - if x != nil { - return x.Threshold - } - return nil -} - -func (x *Rollout) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -type Distribution struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - VariantKey string `protobuf:"bytes,1,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` - Rollout float32 `protobuf:"fixed32,2,opt,name=rollout,proto3" json:"rollout,omitempty"` -} - -func (x *Distribution) Reset() { - *x = Distribution{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Distribution) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Distribution) ProtoMessage() {} - -func (x *Distribution) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Distribution.ProtoReflect.Descriptor instead. -func (*Distribution) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{3} -} - -func (x *Distribution) GetVariantKey() string { - if x != nil { - return x.VariantKey - } - return "" -} - -func (x *Distribution) GetRollout() float32 { - if x != nil { - return x.Rollout - } - return 0 -} - -type Variant struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Attachment string `protobuf:"bytes,4,opt,name=attachment,proto3" json:"attachment,omitempty"` -} - -func (x *Variant) Reset() { - *x = Variant{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Variant) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Variant) ProtoMessage() {} - -func (x *Variant) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Variant.ProtoReflect.Descriptor instead. -func (*Variant) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{4} -} - -func (x *Variant) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Variant) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Variant) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Variant) GetAttachment() string { - if x != nil { - return x.Attachment - } - return "" -} - -type Segment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - MatchType string `protobuf:"bytes,4,opt,name=match_type,json=matchType,proto3" json:"match_type,omitempty"` - Constraints []*Constraint `protobuf:"bytes,5,rep,name=constraints,proto3" json:"constraints,omitempty"` -} - -func (x *Segment) Reset() { - *x = Segment{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Segment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Segment) ProtoMessage() {} - -func (x *Segment) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Segment.ProtoReflect.Descriptor instead. -func (*Segment) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{5} -} - -func (x *Segment) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Segment) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Segment) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Segment) GetMatchType() string { - if x != nil { - return x.MatchType - } - return "" -} - -func (x *Segment) GetConstraints() []*Constraint { - if x != nil { - return x.Constraints - } - return nil -} - -type Constraint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Property string `protobuf:"bytes,2,opt,name=property,proto3" json:"property,omitempty"` - Operator string `protobuf:"bytes,3,opt,name=operator,proto3" json:"operator,omitempty"` - Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` -} - -func (x *Constraint) Reset() { - *x = Constraint{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Constraint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Constraint) ProtoMessage() {} - -func (x *Constraint) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Constraint.ProtoReflect.Descriptor instead. -func (*Constraint) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{6} -} - -func (x *Constraint) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Constraint) GetProperty() string { - if x != nil { - return x.Property - } - return "" -} - -func (x *Constraint) GetOperator() string { - if x != nil { - return x.Operator - } - return "" -} - -func (x *Constraint) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Constraint) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -type NamespaceRequest struct { +type SnapshotNamespaceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -533,23 +29,23 @@ type NamespaceRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` } -func (x *NamespaceRequest) Reset() { - *x = NamespaceRequest{} +func (x *SnapshotNamespaceRequest) Reset() { + *x = SnapshotNamespaceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[7] + mi := &file_data_data_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NamespaceRequest) String() string { +func (x *SnapshotNamespaceRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NamespaceRequest) ProtoMessage() {} +func (*SnapshotNamespaceRequest) ProtoMessage() {} -func (x *NamespaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[7] +func (x *SnapshotNamespaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -560,45 +56,47 @@ func (x *NamespaceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use NamespaceRequest.ProtoReflect.Descriptor instead. -func (*NamespaceRequest) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{7} +// Deprecated: Use SnapshotNamespaceRequest.ProtoReflect.Descriptor instead. +func (*SnapshotNamespaceRequest) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{0} } -func (x *NamespaceRequest) GetKey() string { +func (x *SnapshotNamespaceRequest) GetKey() string { if x != nil { return x.Key } return "" } -type NamespaceResponse struct { +type SnapshotNamespaceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Flags []*Flag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` - Segments []*Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Flags []*flipt.Flag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` + Segments []*flipt.Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` + Rules map[string]*flipt.RuleList `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Rollouts map[string]*flipt.RolloutList `protobuf:"bytes,5,rep,name=rollouts,proto3" json:"rollouts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (x *NamespaceResponse) Reset() { - *x = NamespaceResponse{} +func (x *SnapshotNamespaceResponse) Reset() { + *x = SnapshotNamespaceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[8] + mi := &file_data_data_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NamespaceResponse) String() string { +func (x *SnapshotNamespaceResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NamespaceResponse) ProtoMessage() {} +func (*SnapshotNamespaceResponse) ProtoMessage() {} -func (x *NamespaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[8] +func (x *SnapshotNamespaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -609,310 +107,92 @@ func (x *NamespaceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use NamespaceResponse.ProtoReflect.Descriptor instead. -func (*NamespaceResponse) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{8} +// Deprecated: Use SnapshotNamespaceResponse.ProtoReflect.Descriptor instead. +func (*SnapshotNamespaceResponse) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{1} } -func (x *NamespaceResponse) GetKey() string { +func (x *SnapshotNamespaceResponse) GetKey() string { if x != nil { return x.Key } return "" } -func (x *NamespaceResponse) GetFlags() []*Flag { +func (x *SnapshotNamespaceResponse) GetFlags() []*flipt.Flag { if x != nil { return x.Flags } return nil } -func (x *NamespaceResponse) GetSegments() []*Segment { +func (x *SnapshotNamespaceResponse) GetSegments() []*flipt.Segment { if x != nil { return x.Segments } return nil } -type Rule_SegmentsRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` - SegmentOperator string `protobuf:"bytes,2,opt,name=segment_operator,json=segmentOperator,proto3" json:"segment_operator,omitempty"` -} - -func (x *Rule_SegmentsRule) Reset() { - *x = Rule_SegmentsRule{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rule_SegmentsRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rule_SegmentsRule) ProtoMessage() {} - -func (x *Rule_SegmentsRule) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rule_SegmentsRule.ProtoReflect.Descriptor instead. -func (*Rule_SegmentsRule) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *Rule_SegmentsRule) GetKeys() []string { +func (x *SnapshotNamespaceResponse) GetRules() map[string]*flipt.RuleList { if x != nil { - return x.Keys + return x.Rules } return nil } -func (x *Rule_SegmentsRule) GetSegmentOperator() string { - if x != nil { - return x.SegmentOperator - } - return "" -} - -type Rollout_SegmentsRollout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` - SegmentOperator string `protobuf:"bytes,2,opt,name=segment_operator,json=segmentOperator,proto3" json:"segment_operator,omitempty"` - Value bool `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Rollout_SegmentsRollout) Reset() { - *x = Rollout_SegmentsRollout{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rollout_SegmentsRollout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rollout_SegmentsRollout) ProtoMessage() {} - -func (x *Rollout_SegmentsRollout) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rollout_SegmentsRollout.ProtoReflect.Descriptor instead. -func (*Rollout_SegmentsRollout) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *Rollout_SegmentsRollout) GetKeys() []string { +func (x *SnapshotNamespaceResponse) GetRollouts() map[string]*flipt.RolloutList { if x != nil { - return x.Keys + return x.Rollouts } return nil } -func (x *Rollout_SegmentsRollout) GetSegmentOperator() string { - if x != nil { - return x.SegmentOperator - } - return "" -} - -func (x *Rollout_SegmentsRollout) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - -type Rollout_ThresholdRollout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` - Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Rollout_ThresholdRollout) Reset() { - *x = Rollout_ThresholdRollout{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Rollout_ThresholdRollout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Rollout_ThresholdRollout) ProtoMessage() {} - -func (x *Rollout_ThresholdRollout) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Rollout_ThresholdRollout.ProtoReflect.Descriptor instead. -func (*Rollout_ThresholdRollout) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *Rollout_ThresholdRollout) GetPercentage() float32 { - if x != nil { - return x.Percentage - } - return 0 -} - -func (x *Rollout_ThresholdRollout) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - var File_data_data_proto protoreflect.FileDescriptor var file_data_data_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd5, 0x01, - 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x08, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x61, 0x72, 0x69, - 0x61, 0x6e, 0x74, 0x52, 0x08, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, - 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, - 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x39, - 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x75, - 0x6c, 0x65, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x52, - 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, - 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x3e, 0x0a, - 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x4d, 0x0a, - 0x0c, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, - 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xe0, 0x02, 0x0a, - 0x07, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x3d, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x2e, 0x53, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x07, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x2e, - 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, - 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x66, 0x0a, - 0x0f, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, - 0x6b, 0x65, 0x79, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x48, 0x0a, 0x10, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, - 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, - 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x49, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0x71, 0x0a, 0x07, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, - 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xaa, 0x01, - 0x0a, 0x07, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0a, 0x43, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x24, 0x0a, - 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x22, 0x7e, 0x0a, 0x11, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x66, 0x6c, - 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, - 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x32, 0x4f, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x08, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x1c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0b, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x18, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0xb1, 0x03, 0x0a, 0x19, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x08, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x46, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, + 0x4f, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x33, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, + 0x1a, 0x49, 0x0a, 0x0a, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0d, 0x52, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x6f, 0x0a, 0x0b, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x11, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x22, 0x5a, + 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -927,38 +207,31 @@ func file_data_data_proto_rawDescGZIP() []byte { return file_data_data_proto_rawDescData } -var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_data_data_proto_goTypes = []interface{}{ - (*Flag)(nil), // 0: flipt.data.Flag - (*Rule)(nil), // 1: flipt.data.Rule - (*Rollout)(nil), // 2: flipt.data.Rollout - (*Distribution)(nil), // 3: flipt.data.Distribution - (*Variant)(nil), // 4: flipt.data.Variant - (*Segment)(nil), // 5: flipt.data.Segment - (*Constraint)(nil), // 6: flipt.data.Constraint - (*NamespaceRequest)(nil), // 7: flipt.data.NamespaceRequest - (*NamespaceResponse)(nil), // 8: flipt.data.NamespaceResponse - (*Rule_SegmentsRule)(nil), // 9: flipt.data.Rule.SegmentsRule - (*Rollout_SegmentsRollout)(nil), // 10: flipt.data.Rollout.SegmentsRollout - (*Rollout_ThresholdRollout)(nil), // 11: flipt.data.Rollout.ThresholdRollout + (*SnapshotNamespaceRequest)(nil), // 0: flipt.data.SnapshotNamespaceRequest + (*SnapshotNamespaceResponse)(nil), // 1: flipt.data.SnapshotNamespaceResponse + nil, // 2: flipt.data.SnapshotNamespaceResponse.RulesEntry + nil, // 3: flipt.data.SnapshotNamespaceResponse.RolloutsEntry + (*flipt.Flag)(nil), // 4: flipt.Flag + (*flipt.Segment)(nil), // 5: flipt.Segment + (*flipt.RuleList)(nil), // 6: flipt.RuleList + (*flipt.RolloutList)(nil), // 7: flipt.RolloutList } var file_data_data_proto_depIdxs = []int32{ - 4, // 0: flipt.data.Flag.variants:type_name -> flipt.data.Variant - 1, // 1: flipt.data.Flag.rules:type_name -> flipt.data.Rule - 9, // 2: flipt.data.Rule.segments:type_name -> flipt.data.Rule.SegmentsRule - 3, // 3: flipt.data.Rule.distributions:type_name -> flipt.data.Distribution - 10, // 4: flipt.data.Rollout.segment:type_name -> flipt.data.Rollout.SegmentsRollout - 11, // 5: flipt.data.Rollout.threshold:type_name -> flipt.data.Rollout.ThresholdRollout - 6, // 6: flipt.data.Segment.constraints:type_name -> flipt.data.Constraint - 0, // 7: flipt.data.NamespaceResponse.flags:type_name -> flipt.data.Flag - 5, // 8: flipt.data.NamespaceResponse.segments:type_name -> flipt.data.Segment - 7, // 9: flipt.data.Data.Snapshot:input_type -> flipt.data.NamespaceRequest - 8, // 10: flipt.data.Data.Snapshot:output_type -> flipt.data.NamespaceResponse - 10, // [10:11] is the sub-list for method output_type - 9, // [9:10] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 4, // 0: flipt.data.SnapshotNamespaceResponse.flags:type_name -> flipt.Flag + 5, // 1: flipt.data.SnapshotNamespaceResponse.segments:type_name -> flipt.Segment + 2, // 2: flipt.data.SnapshotNamespaceResponse.rules:type_name -> flipt.data.SnapshotNamespaceResponse.RulesEntry + 3, // 3: flipt.data.SnapshotNamespaceResponse.rollouts:type_name -> flipt.data.SnapshotNamespaceResponse.RolloutsEntry + 6, // 4: flipt.data.SnapshotNamespaceResponse.RulesEntry.value:type_name -> flipt.RuleList + 7, // 5: flipt.data.SnapshotNamespaceResponse.RolloutsEntry.value:type_name -> flipt.RolloutList + 0, // 6: flipt.data.DataService.SnapshotNamespace:input_type -> flipt.data.SnapshotNamespaceRequest + 1, // 7: flipt.data.DataService.SnapshotNamespace:output_type -> flipt.data.SnapshotNamespaceResponse + 7, // [7:8] is the sub-list for method output_type + 6, // [6:7] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_data_data_proto_init() } @@ -968,7 +241,7 @@ func file_data_data_proto_init() { } if !protoimpl.UnsafeEnabled { file_data_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Flag); i { + switch v := v.(*SnapshotNamespaceRequest); i { case 0: return &v.state case 1: @@ -980,127 +253,7 @@ func file_data_data_proto_init() { } } file_data_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rollout); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Distribution); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Variant); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Segment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Constraint); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamespaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamespaceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rule_SegmentsRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rollout_SegmentsRollout); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Rollout_ThresholdRollout); i { + switch v := v.(*SnapshotNamespaceResponse); i { case 0: return &v.state case 1: @@ -1118,7 +271,7 @@ func file_data_data_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_data_data_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/flipt/data/data.pb.gw.go b/rpc/flipt/data/data.pb.gw.go new file mode 100644 index 0000000000..e436fb99be --- /dev/null +++ b/rpc/flipt/data/data.pb.gw.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: data/data.proto + +/* +Package data is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package data + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SnapshotNamespaceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + msg, err := client.SnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SnapshotNamespaceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + msg, err := server.SnapshotNamespace(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterDataServiceHandlerServer registers the http handlers for service DataService to "mux". +// UnaryRPC :call DataServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataServiceHandlerFromEndpoint instead. +func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error { + + mux.Handle("GET", pattern_DataService_SnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.data.DataService/SnapshotNamespace", runtime.WithHTTPPathPattern("/api/v1/namespaces/{key}/snapshot")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DataService_SnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataService_SnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterDataServiceHandlerFromEndpoint is same as RegisterDataServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterDataServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterDataServiceHandler(ctx, mux, conn) +} + +// RegisterDataServiceHandler registers the http handlers for service DataService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterDataServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterDataServiceHandlerClient(ctx, mux, NewDataServiceClient(conn)) +} + +// RegisterDataServiceHandlerClient registers the http handlers for service DataService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DataServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DataServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "DataServiceClient" to call the correct interceptors. +func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataServiceClient) error { + + mux.Handle("GET", pattern_DataService_SnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.data.DataService/SnapshotNamespace", runtime.WithHTTPPathPattern("/api/v1/namespaces/{key}/snapshot")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DataService_SnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataService_SnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_DataService_SnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "namespaces", "key", "snapshot"}, "")) +) + +var ( + forward_DataService_SnapshotNamespace_0 = runtime.ForwardResponseMessage +) diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto index 33d712e964..57a07ac354 100644 --- a/rpc/flipt/data/data.proto +++ b/rpc/flipt/data/data.proto @@ -2,83 +2,22 @@ syntax = "proto3"; package flipt.data; -option go_package = "go.flipt.io/flipt/rpc/flipt/data"; - -message Flag { - string key = 1; - string name = 2; - string description = 3; - bool enabled = 4; - string type = 5; - repeated Variant variants = 8; - repeated Rule rules = 9; -} - -message Rule { - message SegmentsRule { - repeated string keys = 1; - string segment_operator = 2; - } - SegmentsRule segments = 1; - int32 rank = 2; - repeated Distribution distributions = 3; -} - -message Rollout { - message SegmentsRollout { - repeated string keys = 1; - string segment_operator = 2; - bool value = 3; - } - message ThresholdRollout { - float percentage = 1; - bool value = 2; - } - SegmentsRollout segment = 1; - ThresholdRollout threshold = 2; - string description = 3; -} - -message Distribution { - string variant_key = 1; - float rollout = 2; -} +import "flipt.proto"; -message Variant { - string key = 1; - string name = 2; - string description = 3; - string attachment = 4; -} - -message Segment { - string key = 1; - string name = 2; - string description = 3; - string match_type = 4; - repeated Constraint constraints = 5; -} - -message Constraint { - string type = 1; - string property = 2; - string operator = 3; - string value = 4; - string description = 5; -} +option go_package = "go.flipt.io/flipt/rpc/flipt/data"; -message NamespaceRequest { +message SnapshotNamespaceRequest { string key = 1; - //int32 limit = 2; - //string page_token = 3; } -message NamespaceResponse { +message SnapshotNamespaceResponse { string key = 1; - repeated Flag flags = 2; - repeated Segment segments = 3; + repeated flipt.Flag flags = 2; + repeated flipt.Segment segments = 3; + map rules = 4; + map rollouts = 5; } -service Data { - rpc Snapshot(NamespaceRequest) returns (NamespaceResponse); +service DataService { + rpc SnapshotNamespace(SnapshotNamespaceRequest) returns (SnapshotNamespaceResponse); } diff --git a/rpc/flipt/data/data_grpc.pb.go b/rpc/flipt/data/data_grpc.pb.go index 8f4aa52f2f..5325e6773a 100644 --- a/rpc/flipt/data/data_grpc.pb.go +++ b/rpc/flipt/data/data_grpc.pb.go @@ -19,89 +19,89 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Data_Snapshot_FullMethodName = "/flipt.data.Data/Snapshot" + DataService_SnapshotNamespace_FullMethodName = "/flipt.data.DataService/SnapshotNamespace" ) -// DataClient is the client API for Data service. +// DataServiceClient is the client API for DataService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DataClient interface { - Snapshot(ctx context.Context, in *NamespaceRequest, opts ...grpc.CallOption) (*NamespaceResponse, error) +type DataServiceClient interface { + SnapshotNamespace(ctx context.Context, in *SnapshotNamespaceRequest, opts ...grpc.CallOption) (*SnapshotNamespaceResponse, error) } -type dataClient struct { +type dataServiceClient struct { cc grpc.ClientConnInterface } -func NewDataClient(cc grpc.ClientConnInterface) DataClient { - return &dataClient{cc} +func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient { + return &dataServiceClient{cc} } -func (c *dataClient) Snapshot(ctx context.Context, in *NamespaceRequest, opts ...grpc.CallOption) (*NamespaceResponse, error) { - out := new(NamespaceResponse) - err := c.cc.Invoke(ctx, Data_Snapshot_FullMethodName, in, out, opts...) +func (c *dataServiceClient) SnapshotNamespace(ctx context.Context, in *SnapshotNamespaceRequest, opts ...grpc.CallOption) (*SnapshotNamespaceResponse, error) { + out := new(SnapshotNamespaceResponse) + err := c.cc.Invoke(ctx, DataService_SnapshotNamespace_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -// DataServer is the server API for Data service. -// All implementations must embed UnimplementedDataServer +// DataServiceServer is the server API for DataService service. +// All implementations must embed UnimplementedDataServiceServer // for forward compatibility -type DataServer interface { - Snapshot(context.Context, *NamespaceRequest) (*NamespaceResponse, error) - mustEmbedUnimplementedDataServer() +type DataServiceServer interface { + SnapshotNamespace(context.Context, *SnapshotNamespaceRequest) (*SnapshotNamespaceResponse, error) + mustEmbedUnimplementedDataServiceServer() } -// UnimplementedDataServer must be embedded to have forward compatible implementations. -type UnimplementedDataServer struct { +// UnimplementedDataServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDataServiceServer struct { } -func (UnimplementedDataServer) Snapshot(context.Context, *NamespaceRequest) (*NamespaceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Snapshot not implemented") +func (UnimplementedDataServiceServer) SnapshotNamespace(context.Context, *SnapshotNamespaceRequest) (*SnapshotNamespaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SnapshotNamespace not implemented") } -func (UnimplementedDataServer) mustEmbedUnimplementedDataServer() {} +func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {} -// UnsafeDataServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DataServer will +// UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DataServiceServer will // result in compilation errors. -type UnsafeDataServer interface { - mustEmbedUnimplementedDataServer() +type UnsafeDataServiceServer interface { + mustEmbedUnimplementedDataServiceServer() } -func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) { - s.RegisterService(&Data_ServiceDesc, srv) +func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) { + s.RegisterService(&DataService_ServiceDesc, srv) } -func _Data_Snapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NamespaceRequest) +func _DataService_SnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SnapshotNamespaceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServer).Snapshot(ctx, in) + return srv.(DataServiceServer).SnapshotNamespace(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Data_Snapshot_FullMethodName, + FullMethod: DataService_SnapshotNamespace_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).Snapshot(ctx, req.(*NamespaceRequest)) + return srv.(DataServiceServer).SnapshotNamespace(ctx, req.(*SnapshotNamespaceRequest)) } return interceptor(ctx, in, info, handler) } -// Data_ServiceDesc is the grpc.ServiceDesc for Data service. +// DataService_ServiceDesc is the grpc.ServiceDesc for DataService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var Data_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "flipt.data.Data", - HandlerType: (*DataServer)(nil), +var DataService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipt.data.DataService", + HandlerType: (*DataServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Snapshot", - Handler: _Data_Snapshot_Handler, + MethodName: "SnapshotNamespace", + Handler: _DataService_SnapshotNamespace_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/rpc/flipt/flipt.yaml b/rpc/flipt/flipt.yaml index 49e96a99cc..c0650e58a2 100644 --- a/rpc/flipt/flipt.yaml +++ b/rpc/flipt/flipt.yaml @@ -23,6 +23,9 @@ http: - selector: flipt.Flipt.DeleteNamespace delete: /api/v1/namespaces/{key} + - selector: flipt.data.DataService.SnapshotNamespace + get: /api/v1/namespaces/{key}/snapshot + # evaluation # - selector: flipt.Flipt.Evaluate diff --git a/sdk/go/data.sdk.gen.go b/sdk/go/data.sdk.gen.go index 6e0ac6f213..71577f352b 100644 --- a/sdk/go/data.sdk.gen.go +++ b/sdk/go/data.sdk.gen.go @@ -8,14 +8,14 @@ import ( ) type Data struct { - transport data.DataClient + transport data.DataServiceClient tokenProvider ClientTokenProvider } -func (x *Data) Snapshot(ctx context.Context, v *data.NamespaceRequest) (*data.NamespaceResponse, error) { +func (x *Data) SnapshotNamespace(ctx context.Context, v *data.SnapshotNamespaceRequest) (*data.SnapshotNamespaceResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err } - return x.transport.Snapshot(ctx, v) + return x.transport.SnapshotNamespace(ctx, v) } diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index 89d95741a4..757b836741 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -54,16 +54,16 @@ func (t Transport) AuthClient() _go.AuthClient { return authClient{cc: t.cc} } -func (t Transport) DataClient() data.DataClient { - return data.NewDataClient(t.cc) +func (t Transport) FliptClient() flipt.FliptClient { + return flipt.NewFliptClient(t.cc) } -func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { - return evaluation.NewEvaluationServiceClient(t.cc) +func (t Transport) DataClient() data.DataServiceClient { + return data.NewDataServiceClient(t.cc) } -func (t Transport) FliptClient() flipt.FliptClient { - return flipt.NewFliptClient(t.cc) +func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { + return evaluation.NewEvaluationServiceClient(t.cc) } func (t Transport) MetaClient() meta.MetadataServiceClient { diff --git a/sdk/go/http/data.sdk.gen.go b/sdk/go/http/data.sdk.gen.go index e6fbf7982b..97f732a5cc 100644 --- a/sdk/go/http/data.sdk.gen.go +++ b/sdk/go/http/data.sdk.gen.go @@ -3,15 +3,48 @@ package http import ( + context "context" + fmt "fmt" data "go.flipt.io/flipt/rpc/flipt/data" + grpc "google.golang.org/grpc" + protojson "google.golang.org/protobuf/encoding/protojson" + io "io" http "net/http" + url "net/url" ) -type DataClient struct { +type DataServiceClient struct { client *http.Client addr string } -func (t Transport) DataClient() data.DataClient { - return &DataClient{client: t.client, addr: t.addr} +func (x *DataServiceClient) SnapshotNamespace(ctx context.Context, v *data.SnapshotNamespaceRequest, _ ...grpc.CallOption) (*data.SnapshotNamespaceResponse, error) { + var body io.Reader + var values url.Values + req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/api/v1/namespaces/%v/snapshot", v.Key), body) + if err != nil { + return nil, err + } + req.URL.RawQuery = values.Encode() + resp, err := x.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var output data.SnapshotNamespaceResponse + respData, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + if err := checkResponse(resp, respData); err != nil { + return nil, err + } + if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(respData, &output); err != nil { + return nil, err + } + return &output, nil +} + +func (t Transport) DataClient() data.DataServiceClient { + return &DataServiceClient{client: t.client, addr: t.addr} } diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index 04e5ef8ed9..3cc61abba0 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -13,9 +13,9 @@ import ( type Transport interface { AuthClient() AuthClient - DataClient() data.DataClient - EvaluationClient() evaluation.EvaluationServiceClient FliptClient() flipt.FliptClient + DataClient() data.DataServiceClient + EvaluationClient() evaluation.EvaluationServiceClient MetaClient() meta.MetadataServiceClient } @@ -75,6 +75,13 @@ func (s SDK) Auth() *Auth { } } +func (s SDK) Flipt() *Flipt { + return &Flipt{ + transport: s.transport.FliptClient(), + tokenProvider: s.tokenProvider, + } +} + func (s SDK) Data() *Data { return &Data{ transport: s.transport.DataClient(), @@ -89,13 +96,6 @@ func (s SDK) Evaluation() *Evaluation { } } -func (s SDK) Flipt() *Flipt { - return &Flipt{ - transport: s.transport.FliptClient(), - tokenProvider: s.tokenProvider, - } -} - func (s SDK) Meta() *Meta { return &Meta{ transport: s.transport.MetaClient(), From 58179a1e0b88152620ad06ff457a94d0299b7f19 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Thu, 2 Nov 2023 14:44:44 -0400 Subject: [PATCH 16/39] feat: finish proto server --- internal/server/data/server.go | 196 ++++-- rpc/flipt/data/data.pb.go | 1058 +++++++++++++++++++++++++++++--- rpc/flipt/data/data.pb.gw.go | 32 +- rpc/flipt/data/data.proto | 79 ++- rpc/flipt/data/data_grpc.pb.go | 30 +- rpc/flipt/flipt.yaml | 9 +- sdk/go/data.sdk.gen.go | 4 +- sdk/go/http/data.sdk.gen.go | 6 +- 8 files changed, 1215 insertions(+), 199 deletions(-) diff --git a/internal/server/data/server.go b/internal/server/data/server.go index dc92952f9a..8940954d8d 100644 --- a/internal/server/data/server.go +++ b/internal/server/data/server.go @@ -10,34 +10,37 @@ import ( "go.uber.org/zap" ) +type EvaluationStore interface { + ListFlags(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Flag], error) + storage.EvaluationStore +} + type Server struct { logger *zap.Logger - store storage.Store + store EvaluationStore - data.UnimplementedDataServer + data.UnimplementedDataServiceServer } -func NewServer(logger *zap.Logger, store storage.Store) *Server { +func NewServer(logger *zap.Logger, store EvaluationStore) *Server { return &Server{ logger: logger, store: store, } } -func (s *Server) SnapshotNamespace(ctx context.Context, r *data.SnapshotNamespaceRequest) (*data.SnapshotNamespaceResponse, error) { +func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.EvaluationNamespaceSnapshotRequest) (*data.EvaluationNamespaceSnapshot, error) { var ( namespaceKey = r.Key - resp = &data.SnapshotNamespaceResponse{ - Rules: make(map[string]*flipt.RuleList), - Rollouts: make(map[string]*flipt.RolloutList), - } - remaining = true - nextPage string + resp = &data.EvaluationNamespaceSnapshot{} + remaining = true + nextPage string + segments = make(map[string]*data.EvaluationSegment) ) // flags/variants in batches for remaining { - res, err := s.store.ListFlags( + res, err := srv.store.ListFlags( ctx, namespaceKey, storage.WithPageToken(nextPage), @@ -50,55 +53,138 @@ func (s *Server) SnapshotNamespace(ctx context.Context, r *data.SnapshotNamespac nextPage = res.NextPageToken remaining = nextPage != "" - resp.Flags = flags - for _, f := range flags { - // rules for flag - rules, err := s.store.ListRules( - ctx, - namespaceKey, - f.Key, - ) - if err != nil { - return nil, fmt.Errorf("getting rules for flag %q: %w", f.Key, err) - } - - resp.Rules[f.Key] = &flipt.RuleList{ - Rules: rules.Results, - TotalCount: int32(len(rules.Results)), + flag := &data.EvaluationFlag{ + Key: f.Key, + Name: f.Name, + Description: f.Description, + Enabled: f.Enabled, + Type: f.Type, + CreatedAt: f.CreatedAt, + UpdatedAt: f.UpdatedAt, } - rollouts, err := s.store.ListRollouts(ctx, namespaceKey, f.Key) - if err != nil { - return nil, fmt.Errorf("getting rollout rules for flag %q: %w", f.Key, err) + if f.Type == flipt.FlagType_VARIANT_FLAG_TYPE { + rules, err := srv.store.GetEvaluationRules(ctx, namespaceKey, f.Key) + if err != nil { + return nil, fmt.Errorf("getting rules for flag %q: %w", f.Key, err) + } + + for _, r := range rules { + rule := &data.EvaluationRule{ + Id: r.ID, + Rank: r.Rank, + SegmentOperator: r.SegmentOperator, + } + + for _, s := range r.Segments { + // optimization: reuse segment if already seen + if ss, ok := segments[s.SegmentKey]; ok { + rule.Segments = append(rule.Segments, ss) + } else { + + ss := &data.EvaluationSegment{ + Key: s.SegmentKey, + MatchType: s.MatchType, + } + + for _, c := range s.Constraints { + ss.Constraints = append(ss.Constraints, &data.EvaluationConstraint{ + Id: c.ID, + Type: c.Type, + Property: c.Property, + Operator: c.Operator, + Value: c.Value, + }) + } + + segments[s.SegmentKey] = ss + rule.Segments = append(rule.Segments, ss) + } + + distributions, err := srv.store.GetEvaluationDistributions(ctx, r.ID) + if err != nil { + return nil, fmt.Errorf("getting distributions for rule %q: %w", r.ID, err) + } + + // distributions for rule + for _, d := range distributions { + dist := &data.EvaluationDistribution{ + VariantId: d.VariantID, + VariantKey: d.VariantKey, + VariantAttachment: d.VariantAttachment, + Rollout: d.Rollout, + } + rule.Distributions = append(rule.Distributions, dist) + } + + flag.Rules = append(flag.Rules, rule) + } + + } + + if f.Type == flipt.FlagType_BOOLEAN_FLAG_TYPE { + rollouts, err := srv.store.GetEvaluationRollouts(ctx, namespaceKey, f.Key) + if err != nil { + return nil, fmt.Errorf("getting rollout rules for flag %q: %w", f.Key, err) + } + + for _, r := range rollouts { + rollout := &data.EvaluationRollout{ + Type: r.RolloutType, + Rank: r.Rank, + } + + switch r.RolloutType { + case flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE: + rollout.Rule = &data.EvaluationRollout_Threshold{ + Threshold: &data.EvaluationRolloutThreshold{ + Percentage: r.Threshold.Percentage, + Value: r.Threshold.Value, + }, + } + + case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: + segment := &data.EvaluationRolloutSegment{ + Value: r.Segment.Value, + SegmentOperator: r.Segment.SegmentOperator, + } + + for _, s := range r.Segment.Segments { + // optimization: reuse segment if already seen + ss, ok := segments[s.SegmentKey] + if !ok { + ss := &data.EvaluationSegment{ + Key: s.SegmentKey, + MatchType: s.MatchType, + } + + for _, c := range s.Constraints { + ss.Constraints = append(ss.Constraints, &data.EvaluationConstraint{ + Id: c.ID, + Type: c.Type, + Property: c.Property, + Operator: c.Operator, + Value: c.Value, + }) + } + + segments[s.SegmentKey] = ss + } + + segment.Segments = append(segment.Segments, ss) + } + + rollout.Rule = &data.EvaluationRollout_Segment{ + Segment: segment, + } + } + + flag.Rollouts = append(flag.Rollouts, rollout) + } + } } - - resp.Rollouts[f.Key] = &flipt.RolloutList{ - Rules: rollouts.Results, - TotalCount: int32(len(rollouts.Results)), - } - } - } - - remaining = true - nextPage = "" - - // segments/constraints in batches - for remaining { - res, err := s.store.ListSegments( - ctx, - namespaceKey, - storage.WithPageToken(nextPage), - ) - if err != nil { - return nil, fmt.Errorf("getting segments: %w", err) } - - segments := res.Results - nextPage = res.NextPageToken - remaining = nextPage != "" - - resp.Segments = append(resp.Segments, segments...) } return resp, nil diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go index 597cde106b..eca03e9c2a 100644 --- a/rpc/flipt/data/data.pb.go +++ b/rpc/flipt/data/data.pb.go @@ -10,6 +10,7 @@ import ( flipt "go.flipt.io/flipt/rpc/flipt" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -21,16 +22,21 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type SnapshotNamespaceRequest struct { +type EvaluationDistribution struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + RuleId string `protobuf:"bytes,2,opt,name=ruleId,proto3" json:"ruleId,omitempty"` + VariantId string `protobuf:"bytes,3,opt,name=variantId,proto3" json:"variantId,omitempty"` + VariantKey string `protobuf:"bytes,4,opt,name=variantKey,proto3" json:"variantKey,omitempty"` + VariantAttachment string `protobuf:"bytes,5,opt,name=variantAttachment,proto3" json:"variantAttachment,omitempty"` + Rollout float32 `protobuf:"fixed32,6,opt,name=rollout,proto3" json:"rollout,omitempty"` } -func (x *SnapshotNamespaceRequest) Reset() { - *x = SnapshotNamespaceRequest{} +func (x *EvaluationDistribution) Reset() { + *x = EvaluationDistribution{} if protoimpl.UnsafeEnabled { mi := &file_data_data_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -38,13 +44,13 @@ func (x *SnapshotNamespaceRequest) Reset() { } } -func (x *SnapshotNamespaceRequest) String() string { +func (x *EvaluationDistribution) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SnapshotNamespaceRequest) ProtoMessage() {} +func (*EvaluationDistribution) ProtoMessage() {} -func (x *SnapshotNamespaceRequest) ProtoReflect() protoreflect.Message { +func (x *EvaluationDistribution) ProtoReflect() protoreflect.Message { mi := &file_data_data_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -56,32 +62,69 @@ func (x *SnapshotNamespaceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SnapshotNamespaceRequest.ProtoReflect.Descriptor instead. -func (*SnapshotNamespaceRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use EvaluationDistribution.ProtoReflect.Descriptor instead. +func (*EvaluationDistribution) Descriptor() ([]byte, []int) { return file_data_data_proto_rawDescGZIP(), []int{0} } -func (x *SnapshotNamespaceRequest) GetKey() string { +func (x *EvaluationDistribution) GetId() string { if x != nil { - return x.Key + return x.Id + } + return "" +} + +func (x *EvaluationDistribution) GetRuleId() string { + if x != nil { + return x.RuleId + } + return "" +} + +func (x *EvaluationDistribution) GetVariantId() string { + if x != nil { + return x.VariantId + } + return "" +} + +func (x *EvaluationDistribution) GetVariantKey() string { + if x != nil { + return x.VariantKey + } + return "" +} + +func (x *EvaluationDistribution) GetVariantAttachment() string { + if x != nil { + return x.VariantAttachment } return "" } -type SnapshotNamespaceResponse struct { +func (x *EvaluationDistribution) GetRollout() float32 { + if x != nil { + return x.Rollout + } + return 0 +} + +type EvaluationRollout struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Flags []*flipt.Flag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` - Segments []*flipt.Segment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` - Rules map[string]*flipt.RuleList `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Rollouts map[string]*flipt.RolloutList `protobuf:"bytes,5,rep,name=rollouts,proto3" json:"rollouts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Type flipt.RolloutType `protobuf:"varint,1,opt,name=type,proto3,enum=flipt.RolloutType" json:"type,omitempty"` + Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` + // Types that are assignable to Rule: + // + // *EvaluationRollout_Segment + // *EvaluationRollout_Threshold + Rule isEvaluationRollout_Rule `protobuf_oneof:"rule"` } -func (x *SnapshotNamespaceResponse) Reset() { - *x = SnapshotNamespaceResponse{} +func (x *EvaluationRollout) Reset() { + *x = EvaluationRollout{} if protoimpl.UnsafeEnabled { mi := &file_data_data_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -89,13 +132,13 @@ func (x *SnapshotNamespaceResponse) Reset() { } } -func (x *SnapshotNamespaceResponse) String() string { +func (x *EvaluationRollout) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SnapshotNamespaceResponse) ProtoMessage() {} +func (*EvaluationRollout) ProtoMessage() {} -func (x *SnapshotNamespaceResponse) ProtoReflect() protoreflect.Message { +func (x *EvaluationRollout) ProtoReflect() protoreflect.Message { mi := &file_data_data_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -107,92 +150,790 @@ func (x *SnapshotNamespaceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SnapshotNamespaceResponse.ProtoReflect.Descriptor instead. -func (*SnapshotNamespaceResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use EvaluationRollout.ProtoReflect.Descriptor instead. +func (*EvaluationRollout) Descriptor() ([]byte, []int) { return file_data_data_proto_rawDescGZIP(), []int{1} } -func (x *SnapshotNamespaceResponse) GetKey() string { +func (x *EvaluationRollout) GetType() flipt.RolloutType { + if x != nil { + return x.Type + } + return flipt.RolloutType(0) +} + +func (x *EvaluationRollout) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (m *EvaluationRollout) GetRule() isEvaluationRollout_Rule { + if m != nil { + return m.Rule + } + return nil +} + +func (x *EvaluationRollout) GetSegment() *EvaluationRolloutSegment { + if x, ok := x.GetRule().(*EvaluationRollout_Segment); ok { + return x.Segment + } + return nil +} + +func (x *EvaluationRollout) GetThreshold() *EvaluationRolloutThreshold { + if x, ok := x.GetRule().(*EvaluationRollout_Threshold); ok { + return x.Threshold + } + return nil +} + +type isEvaluationRollout_Rule interface { + isEvaluationRollout_Rule() +} + +type EvaluationRollout_Segment struct { + Segment *EvaluationRolloutSegment `protobuf:"bytes,3,opt,name=segment,proto3,oneof"` +} + +type EvaluationRollout_Threshold struct { + Threshold *EvaluationRolloutThreshold `protobuf:"bytes,4,opt,name=threshold,proto3,oneof"` +} + +func (*EvaluationRollout_Segment) isEvaluationRollout_Rule() {} + +func (*EvaluationRollout_Threshold) isEvaluationRollout_Rule() {} + +type EvaluationRolloutThreshold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` + Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EvaluationRolloutThreshold) Reset() { + *x = EvaluationRolloutThreshold{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRolloutThreshold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRolloutThreshold) ProtoMessage() {} + +func (x *EvaluationRolloutThreshold) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRolloutThreshold.ProtoReflect.Descriptor instead. +func (*EvaluationRolloutThreshold) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{2} +} + +func (x *EvaluationRolloutThreshold) GetPercentage() float32 { + if x != nil { + return x.Percentage + } + return 0 +} + +func (x *EvaluationRolloutThreshold) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +type EvaluationRolloutSegment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segmentOperator,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` +} + +func (x *EvaluationRolloutSegment) Reset() { + *x = EvaluationRolloutSegment{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRolloutSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRolloutSegment) ProtoMessage() {} + +func (x *EvaluationRolloutSegment) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRolloutSegment.ProtoReflect.Descriptor instead. +func (*EvaluationRolloutSegment) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{3} +} + +func (x *EvaluationRolloutSegment) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +func (x *EvaluationRolloutSegment) GetSegmentOperator() flipt.SegmentOperator { + if x != nil { + return x.SegmentOperator + } + return flipt.SegmentOperator(0) +} + +func (x *EvaluationRolloutSegment) GetSegments() []*EvaluationSegment { + if x != nil { + return x.Segments + } + return nil +} + +type EvaluationSegment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + MatchType flipt.MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=flipt.MatchType" json:"match_type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Constraints []*EvaluationConstraint `protobuf:"bytes,7,rep,name=constraints,proto3" json:"constraints,omitempty"` +} + +func (x *EvaluationSegment) Reset() { + *x = EvaluationSegment{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationSegment) ProtoMessage() {} + +func (x *EvaluationSegment) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationSegment.ProtoReflect.Descriptor instead. +func (*EvaluationSegment) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{4} +} + +func (x *EvaluationSegment) GetKey() string { if x != nil { return x.Key } return "" } -func (x *SnapshotNamespaceResponse) GetFlags() []*flipt.Flag { +func (x *EvaluationSegment) GetName() string { if x != nil { - return x.Flags + return x.Name + } + return "" +} + +func (x *EvaluationSegment) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *EvaluationSegment) GetMatchType() flipt.MatchType { + if x != nil { + return x.MatchType + } + return flipt.MatchType(0) +} + +func (x *EvaluationSegment) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt } return nil } -func (x *SnapshotNamespaceResponse) GetSegments() []*flipt.Segment { +func (x *EvaluationSegment) GetUpdatedAt() *timestamppb.Timestamp { if x != nil { - return x.Segments + return x.UpdatedAt } return nil } -func (x *SnapshotNamespaceResponse) GetRules() map[string]*flipt.RuleList { +func (x *EvaluationSegment) GetConstraints() []*EvaluationConstraint { + if x != nil { + return x.Constraints + } + return nil +} + +type EvaluationFlag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` + Type flipt.FlagType `protobuf:"varint,5,opt,name=type,proto3,enum=flipt.FlagType" json:"type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Rules []*EvaluationRule `protobuf:"bytes,8,rep,name=rules,proto3" json:"rules,omitempty"` + Rollouts []*EvaluationRollout `protobuf:"bytes,9,rep,name=rollouts,proto3" json:"rollouts,omitempty"` +} + +func (x *EvaluationFlag) Reset() { + *x = EvaluationFlag{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationFlag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationFlag) ProtoMessage() {} + +func (x *EvaluationFlag) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationFlag.ProtoReflect.Descriptor instead. +func (*EvaluationFlag) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{5} +} + +func (x *EvaluationFlag) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EvaluationFlag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EvaluationFlag) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *EvaluationFlag) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *EvaluationFlag) GetType() flipt.FlagType { + if x != nil { + return x.Type + } + return flipt.FlagType(0) +} + +func (x *EvaluationFlag) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *EvaluationFlag) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *EvaluationFlag) GetRules() []*EvaluationRule { if x != nil { return x.Rules } return nil } -func (x *SnapshotNamespaceResponse) GetRollouts() map[string]*flipt.RolloutList { +func (x *EvaluationFlag) GetRollouts() []*EvaluationRollout { if x != nil { return x.Rollouts } return nil } +type EvaluationConstraint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type flipt.ComparisonType `protobuf:"varint,2,opt,name=type,proto3,enum=flipt.ComparisonType" json:"type,omitempty"` + Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"` + Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EvaluationConstraint) Reset() { + *x = EvaluationConstraint{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationConstraint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationConstraint) ProtoMessage() {} + +func (x *EvaluationConstraint) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationConstraint.ProtoReflect.Descriptor instead. +func (*EvaluationConstraint) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{6} +} + +func (x *EvaluationConstraint) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationConstraint) GetType() flipt.ComparisonType { + if x != nil { + return x.Type + } + return flipt.ComparisonType(0) +} + +func (x *EvaluationConstraint) GetProperty() string { + if x != nil { + return x.Property + } + return "" +} + +func (x *EvaluationConstraint) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *EvaluationConstraint) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type EvaluationRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,2,rep,name=segments,proto3" json:"segments,omitempty"` + Rank int32 `protobuf:"varint,3,opt,name=rank,proto3" json:"rank,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,4,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` + Distributions []*EvaluationDistribution `protobuf:"bytes,5,rep,name=distributions,proto3" json:"distributions,omitempty"` +} + +func (x *EvaluationRule) Reset() { + *x = EvaluationRule{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRule) ProtoMessage() {} + +func (x *EvaluationRule) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRule.ProtoReflect.Descriptor instead. +func (*EvaluationRule) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{7} +} + +func (x *EvaluationRule) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationRule) GetSegments() []*EvaluationSegment { + if x != nil { + return x.Segments + } + return nil +} + +func (x *EvaluationRule) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *EvaluationRule) GetSegmentOperator() flipt.SegmentOperator { + if x != nil { + return x.SegmentOperator + } + return flipt.SegmentOperator(0) +} + +func (x *EvaluationRule) GetDistributions() []*EvaluationDistribution { + if x != nil { + return x.Distributions + } + return nil +} + +type EvaluationNamespaceSnapshot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace *flipt.Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Flags []*EvaluationFlag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` +} + +func (x *EvaluationNamespaceSnapshot) Reset() { + *x = EvaluationNamespaceSnapshot{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespaceSnapshot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespaceSnapshot) ProtoMessage() {} + +func (x *EvaluationNamespaceSnapshot) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespaceSnapshot.ProtoReflect.Descriptor instead. +func (*EvaluationNamespaceSnapshot) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{8} +} + +func (x *EvaluationNamespaceSnapshot) GetNamespace() *flipt.Namespace { + if x != nil { + return x.Namespace + } + return nil +} + +func (x *EvaluationNamespaceSnapshot) GetFlags() []*EvaluationFlag { + if x != nil { + return x.Flags + } + return nil +} + +type EvaluationNamespaceSnapshotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *EvaluationNamespaceSnapshotRequest) Reset() { + *x = EvaluationNamespaceSnapshotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_data_data_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespaceSnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespaceSnapshotRequest) ProtoMessage() {} + +func (x *EvaluationNamespaceSnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_data_data_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespaceSnapshotRequest.ProtoReflect.Descriptor instead. +func (*EvaluationNamespaceSnapshotRequest) Descriptor() ([]byte, []int) { + return file_data_data_proto_rawDescGZIP(), []int{9} +} + +func (x *EvaluationNamespaceSnapshotRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + var File_data_data_proto protoreflect.FileDescriptor var file_data_data_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0b, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x18, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0xb1, 0x03, 0x0a, 0x19, 0x53, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x08, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x46, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x75, - 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, - 0x4f, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x33, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, - 0x1a, 0x49, 0x0a, 0x0a, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0d, 0x52, - 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x6f, 0x0a, 0x0b, - 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x11, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x22, 0x5a, - 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, - 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x16, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, + 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x11, + 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, + 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, + 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, + 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, + 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xad, 0x01, 0x0a, + 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, + 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x40, 0x0a, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xc6, 0x02, 0x0a, + 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, + 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, + 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, + 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, + 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, 0x0a, 0x0d, 0x64, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, + 0x6c, 0x61, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x32, 0x85, 0x01, 0x0a, + 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x1b, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -207,31 +948,54 @@ func file_data_data_proto_rawDescGZIP() []byte { return file_data_data_proto_rawDescData } -var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_data_data_proto_goTypes = []interface{}{ - (*SnapshotNamespaceRequest)(nil), // 0: flipt.data.SnapshotNamespaceRequest - (*SnapshotNamespaceResponse)(nil), // 1: flipt.data.SnapshotNamespaceResponse - nil, // 2: flipt.data.SnapshotNamespaceResponse.RulesEntry - nil, // 3: flipt.data.SnapshotNamespaceResponse.RolloutsEntry - (*flipt.Flag)(nil), // 4: flipt.Flag - (*flipt.Segment)(nil), // 5: flipt.Segment - (*flipt.RuleList)(nil), // 6: flipt.RuleList - (*flipt.RolloutList)(nil), // 7: flipt.RolloutList + (*EvaluationDistribution)(nil), // 0: flipt.data.EvaluationDistribution + (*EvaluationRollout)(nil), // 1: flipt.data.EvaluationRollout + (*EvaluationRolloutThreshold)(nil), // 2: flipt.data.EvaluationRolloutThreshold + (*EvaluationRolloutSegment)(nil), // 3: flipt.data.EvaluationRolloutSegment + (*EvaluationSegment)(nil), // 4: flipt.data.EvaluationSegment + (*EvaluationFlag)(nil), // 5: flipt.data.EvaluationFlag + (*EvaluationConstraint)(nil), // 6: flipt.data.EvaluationConstraint + (*EvaluationRule)(nil), // 7: flipt.data.EvaluationRule + (*EvaluationNamespaceSnapshot)(nil), // 8: flipt.data.EvaluationNamespaceSnapshot + (*EvaluationNamespaceSnapshotRequest)(nil), // 9: flipt.data.EvaluationNamespaceSnapshotRequest + (flipt.RolloutType)(0), // 10: flipt.RolloutType + (flipt.SegmentOperator)(0), // 11: flipt.SegmentOperator + (flipt.MatchType)(0), // 12: flipt.MatchType + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (flipt.FlagType)(0), // 14: flipt.FlagType + (flipt.ComparisonType)(0), // 15: flipt.ComparisonType + (*flipt.Namespace)(nil), // 16: flipt.Namespace } var file_data_data_proto_depIdxs = []int32{ - 4, // 0: flipt.data.SnapshotNamespaceResponse.flags:type_name -> flipt.Flag - 5, // 1: flipt.data.SnapshotNamespaceResponse.segments:type_name -> flipt.Segment - 2, // 2: flipt.data.SnapshotNamespaceResponse.rules:type_name -> flipt.data.SnapshotNamespaceResponse.RulesEntry - 3, // 3: flipt.data.SnapshotNamespaceResponse.rollouts:type_name -> flipt.data.SnapshotNamespaceResponse.RolloutsEntry - 6, // 4: flipt.data.SnapshotNamespaceResponse.RulesEntry.value:type_name -> flipt.RuleList - 7, // 5: flipt.data.SnapshotNamespaceResponse.RolloutsEntry.value:type_name -> flipt.RolloutList - 0, // 6: flipt.data.DataService.SnapshotNamespace:input_type -> flipt.data.SnapshotNamespaceRequest - 1, // 7: flipt.data.DataService.SnapshotNamespace:output_type -> flipt.data.SnapshotNamespaceResponse - 7, // [7:8] is the sub-list for method output_type - 6, // [6:7] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 10, // 0: flipt.data.EvaluationRollout.type:type_name -> flipt.RolloutType + 3, // 1: flipt.data.EvaluationRollout.segment:type_name -> flipt.data.EvaluationRolloutSegment + 2, // 2: flipt.data.EvaluationRollout.threshold:type_name -> flipt.data.EvaluationRolloutThreshold + 11, // 3: flipt.data.EvaluationRolloutSegment.segmentOperator:type_name -> flipt.SegmentOperator + 4, // 4: flipt.data.EvaluationRolloutSegment.segments:type_name -> flipt.data.EvaluationSegment + 12, // 5: flipt.data.EvaluationSegment.match_type:type_name -> flipt.MatchType + 13, // 6: flipt.data.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp + 13, // 7: flipt.data.EvaluationSegment.updated_at:type_name -> google.protobuf.Timestamp + 6, // 8: flipt.data.EvaluationSegment.constraints:type_name -> flipt.data.EvaluationConstraint + 14, // 9: flipt.data.EvaluationFlag.type:type_name -> flipt.FlagType + 13, // 10: flipt.data.EvaluationFlag.created_at:type_name -> google.protobuf.Timestamp + 13, // 11: flipt.data.EvaluationFlag.updated_at:type_name -> google.protobuf.Timestamp + 7, // 12: flipt.data.EvaluationFlag.rules:type_name -> flipt.data.EvaluationRule + 1, // 13: flipt.data.EvaluationFlag.rollouts:type_name -> flipt.data.EvaluationRollout + 15, // 14: flipt.data.EvaluationConstraint.type:type_name -> flipt.ComparisonType + 4, // 15: flipt.data.EvaluationRule.segments:type_name -> flipt.data.EvaluationSegment + 11, // 16: flipt.data.EvaluationRule.segment_operator:type_name -> flipt.SegmentOperator + 0, // 17: flipt.data.EvaluationRule.distributions:type_name -> flipt.data.EvaluationDistribution + 16, // 18: flipt.data.EvaluationNamespaceSnapshot.namespace:type_name -> flipt.Namespace + 5, // 19: flipt.data.EvaluationNamespaceSnapshot.flags:type_name -> flipt.data.EvaluationFlag + 9, // 20: flipt.data.DataService.EvaluationSnapshotNamespace:input_type -> flipt.data.EvaluationNamespaceSnapshotRequest + 8, // 21: flipt.data.DataService.EvaluationSnapshotNamespace:output_type -> flipt.data.EvaluationNamespaceSnapshot + 21, // [21:22] is the sub-list for method output_type + 20, // [20:21] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_data_data_proto_init() } @@ -241,7 +1005,7 @@ func file_data_data_proto_init() { } if !protoimpl.UnsafeEnabled { file_data_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SnapshotNamespaceRequest); i { + switch v := v.(*EvaluationDistribution); i { case 0: return &v.state case 1: @@ -253,7 +1017,7 @@ func file_data_data_proto_init() { } } file_data_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SnapshotNamespaceResponse); i { + switch v := v.(*EvaluationRollout); i { case 0: return &v.state case 1: @@ -264,6 +1028,106 @@ func file_data_data_proto_init() { return nil } } + file_data_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRolloutThreshold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRolloutSegment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationSegment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationFlag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationConstraint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_data_data_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_data_data_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*EvaluationRollout_Segment)(nil), + (*EvaluationRollout_Threshold)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -271,7 +1135,7 @@ func file_data_data_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_data_data_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/flipt/data/data.pb.gw.go b/rpc/flipt/data/data.pb.gw.go index e436fb99be..b03150d6bd 100644 --- a/rpc/flipt/data/data.pb.gw.go +++ b/rpc/flipt/data/data.pb.gw.go @@ -31,8 +31,8 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = metadata.Join -func request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SnapshotNamespaceRequest +func request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EvaluationNamespaceSnapshotRequest var metadata runtime.ServerMetadata var ( @@ -52,13 +52,13 @@ func request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runt return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) } - msg, err := client.SnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.EvaluationSnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_DataService_SnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SnapshotNamespaceRequest +func local_request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EvaluationNamespaceSnapshotRequest var metadata runtime.ServerMetadata var ( @@ -78,7 +78,7 @@ func local_request_DataService_SnapshotNamespace_0(ctx context.Context, marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) } - msg, err := server.SnapshotNamespace(ctx, &protoReq) + msg, err := server.EvaluationSnapshotNamespace(ctx, &protoReq) return msg, metadata, err } @@ -89,7 +89,7 @@ func local_request_DataService_SnapshotNamespace_0(ctx context.Context, marshale // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataServiceHandlerFromEndpoint instead. func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error { - mux.Handle("GET", pattern_DataService_SnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -97,12 +97,12 @@ func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.data.DataService/SnapshotNamespace", runtime.WithHTTPPathPattern("/api/v1/namespaces/{key}/snapshot")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.data.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_DataService_SnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -110,7 +110,7 @@ func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_DataService_SnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -155,25 +155,25 @@ func RegisterDataServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // "DataServiceClient" to call the correct interceptors. func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataServiceClient) error { - mux.Handle("GET", pattern_DataService_SnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.data.DataService/SnapshotNamespace", runtime.WithHTTPPathPattern("/api/v1/namespaces/{key}/snapshot")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.data.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_DataService_SnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_DataService_SnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -181,9 +181,9 @@ func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux } var ( - pattern_DataService_SnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "namespaces", "key", "snapshot"}, "")) + pattern_DataService_EvaluationSnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"internal", "v1", "evaluation", "snapshot", "namespace", "key"}, "")) ) var ( - forward_DataService_SnapshotNamespace_0 = runtime.ForwardResponseMessage + forward_DataService_EvaluationSnapshotNamespace_0 = runtime.ForwardResponseMessage ) diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto index 57a07ac354..57b464ef0d 100644 --- a/rpc/flipt/data/data.proto +++ b/rpc/flipt/data/data.proto @@ -3,21 +3,86 @@ syntax = "proto3"; package flipt.data; import "flipt.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "go.flipt.io/flipt/rpc/flipt/data"; -message SnapshotNamespaceRequest { +message EvaluationDistribution { + string id = 1; + string ruleId = 2; + string variantId = 3; + string variantKey = 4; + string variantAttachment = 5; + float rollout = 6; +} + +message EvaluationRollout { + flipt.RolloutType type = 1; + int32 rank = 2; + oneof rule { + EvaluationRolloutSegment segment = 3; + EvaluationRolloutThreshold threshold = 4; + } +} + +message EvaluationRolloutThreshold { + float percentage = 1; + bool value = 2; +} + +message EvaluationRolloutSegment { + bool value = 1; + flipt.SegmentOperator segmentOperator = 2; + repeated EvaluationSegment segments = 3; +} + +message EvaluationSegment { string key = 1; + string name = 2; + string description = 3; + flipt.MatchType match_type = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + repeated EvaluationConstraint constraints = 7; +} + +message EvaluationFlag { + string key = 1; + string name = 2; + string description = 3; + bool enabled = 4; + flipt.FlagType type = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; + repeated EvaluationRule rules = 8; + repeated EvaluationRollout rollouts = 9; +} + +message EvaluationConstraint { + string id = 1; + flipt.ComparisonType type = 2; + string property = 3; + string operator = 4; + string value = 5; +} + +message EvaluationRule { + string id = 1; + repeated EvaluationSegment segments = 2; + int32 rank = 3; + flipt.SegmentOperator segment_operator = 4; + repeated EvaluationDistribution distributions = 5; +} + +message EvaluationNamespaceSnapshot { + flipt.Namespace namespace = 1; + repeated EvaluationFlag flags = 2; } -message SnapshotNamespaceResponse { +message EvaluationNamespaceSnapshotRequest { string key = 1; - repeated flipt.Flag flags = 2; - repeated flipt.Segment segments = 3; - map rules = 4; - map rollouts = 5; } service DataService { - rpc SnapshotNamespace(SnapshotNamespaceRequest) returns (SnapshotNamespaceResponse); + rpc EvaluationSnapshotNamespace(EvaluationNamespaceSnapshotRequest) returns (EvaluationNamespaceSnapshot); } diff --git a/rpc/flipt/data/data_grpc.pb.go b/rpc/flipt/data/data_grpc.pb.go index 5325e6773a..ebcb431a77 100644 --- a/rpc/flipt/data/data_grpc.pb.go +++ b/rpc/flipt/data/data_grpc.pb.go @@ -19,14 +19,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - DataService_SnapshotNamespace_FullMethodName = "/flipt.data.DataService/SnapshotNamespace" + DataService_EvaluationSnapshotNamespace_FullMethodName = "/flipt.data.DataService/EvaluationSnapshotNamespace" ) // DataServiceClient is the client API for DataService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type DataServiceClient interface { - SnapshotNamespace(ctx context.Context, in *SnapshotNamespaceRequest, opts ...grpc.CallOption) (*SnapshotNamespaceResponse, error) + EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) } type dataServiceClient struct { @@ -37,9 +37,9 @@ func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient { return &dataServiceClient{cc} } -func (c *dataServiceClient) SnapshotNamespace(ctx context.Context, in *SnapshotNamespaceRequest, opts ...grpc.CallOption) (*SnapshotNamespaceResponse, error) { - out := new(SnapshotNamespaceResponse) - err := c.cc.Invoke(ctx, DataService_SnapshotNamespace_FullMethodName, in, out, opts...) +func (c *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) { + out := new(EvaluationNamespaceSnapshot) + err := c.cc.Invoke(ctx, DataService_EvaluationSnapshotNamespace_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -50,7 +50,7 @@ func (c *dataServiceClient) SnapshotNamespace(ctx context.Context, in *SnapshotN // All implementations must embed UnimplementedDataServiceServer // for forward compatibility type DataServiceServer interface { - SnapshotNamespace(context.Context, *SnapshotNamespaceRequest) (*SnapshotNamespaceResponse, error) + EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) mustEmbedUnimplementedDataServiceServer() } @@ -58,8 +58,8 @@ type DataServiceServer interface { type UnimplementedDataServiceServer struct { } -func (UnimplementedDataServiceServer) SnapshotNamespace(context.Context, *SnapshotNamespaceRequest) (*SnapshotNamespaceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SnapshotNamespace not implemented") +func (UnimplementedDataServiceServer) EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) { + return nil, status.Errorf(codes.Unimplemented, "method EvaluationSnapshotNamespace not implemented") } func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {} @@ -74,20 +74,20 @@ func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) { s.RegisterService(&DataService_ServiceDesc, srv) } -func _DataService_SnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SnapshotNamespaceRequest) +func _DataService_EvaluationSnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EvaluationNamespaceSnapshotRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServiceServer).SnapshotNamespace(ctx, in) + return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DataService_SnapshotNamespace_FullMethodName, + FullMethod: DataService_EvaluationSnapshotNamespace_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServiceServer).SnapshotNamespace(ctx, req.(*SnapshotNamespaceRequest)) + return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, req.(*EvaluationNamespaceSnapshotRequest)) } return interceptor(ctx, in, info, handler) } @@ -100,8 +100,8 @@ var DataService_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*DataServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "SnapshotNamespace", - Handler: _DataService_SnapshotNamespace_Handler, + MethodName: "EvaluationSnapshotNamespace", + Handler: _DataService_EvaluationSnapshotNamespace_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/rpc/flipt/flipt.yaml b/rpc/flipt/flipt.yaml index c0650e58a2..ebad8489a0 100644 --- a/rpc/flipt/flipt.yaml +++ b/rpc/flipt/flipt.yaml @@ -23,9 +23,6 @@ http: - selector: flipt.Flipt.DeleteNamespace delete: /api/v1/namespaces/{key} - - selector: flipt.data.DataService.SnapshotNamespace - get: /api/v1/namespaces/{key}/snapshot - # evaluation # - selector: flipt.Flipt.Evaluate @@ -313,4 +310,8 @@ http: - selector: flipt.auth.AuthenticationMethodGithubService.AuthorizeURL get: /auth/v1/method/github/authorize - selector: flipt.auth.AuthenticationMethodGithubService.Callback - get: /auth/v1/method/github/callback \ No newline at end of file + get: /auth/v1/method/github/callback + + # internal routes + - selector: flipt.data.DataService.EvaluationSnapshotNamespace + get: /internal/v1/evaluation/snapshot/namespace/{key} \ No newline at end of file diff --git a/sdk/go/data.sdk.gen.go b/sdk/go/data.sdk.gen.go index 71577f352b..81c68d3966 100644 --- a/sdk/go/data.sdk.gen.go +++ b/sdk/go/data.sdk.gen.go @@ -12,10 +12,10 @@ type Data struct { tokenProvider ClientTokenProvider } -func (x *Data) SnapshotNamespace(ctx context.Context, v *data.SnapshotNamespaceRequest) (*data.SnapshotNamespaceResponse, error) { +func (x *Data) EvaluationSnapshotNamespace(ctx context.Context, v *data.EvaluationNamespaceSnapshotRequest) (*data.EvaluationNamespaceSnapshot, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err } - return x.transport.SnapshotNamespace(ctx, v) + return x.transport.EvaluationSnapshotNamespace(ctx, v) } diff --git a/sdk/go/http/data.sdk.gen.go b/sdk/go/http/data.sdk.gen.go index 97f732a5cc..57efda9d31 100644 --- a/sdk/go/http/data.sdk.gen.go +++ b/sdk/go/http/data.sdk.gen.go @@ -18,10 +18,10 @@ type DataServiceClient struct { addr string } -func (x *DataServiceClient) SnapshotNamespace(ctx context.Context, v *data.SnapshotNamespaceRequest, _ ...grpc.CallOption) (*data.SnapshotNamespaceResponse, error) { +func (x *DataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, v *data.EvaluationNamespaceSnapshotRequest, _ ...grpc.CallOption) (*data.EvaluationNamespaceSnapshot, error) { var body io.Reader var values url.Values - req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/api/v1/namespaces/%v/snapshot", v.Key), body) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/internal/v1/evaluation/snapshot/namespace/%v", v.Key), body) if err != nil { return nil, err } @@ -31,7 +31,7 @@ func (x *DataServiceClient) SnapshotNamespace(ctx context.Context, v *data.Snaps return nil, err } defer resp.Body.Close() - var output data.SnapshotNamespaceResponse + var output data.EvaluationNamespaceSnapshot respData, err := io.ReadAll(resp.Body) if err != nil { return nil, err From 5cb67a81206433201355be59d383880fe16eb565 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:59:57 -0400 Subject: [PATCH 17/39] chore: fix linter errors --- rpc/flipt/data/data.pb.go | 273 +++++++++++++++++++------------------- rpc/flipt/data/data.proto | 10 +- 2 files changed, 142 insertions(+), 141 deletions(-) diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go index eca03e9c2a..0f9608c8e4 100644 --- a/rpc/flipt/data/data.pb.go +++ b/rpc/flipt/data/data.pb.go @@ -28,10 +28,10 @@ type EvaluationDistribution struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - RuleId string `protobuf:"bytes,2,opt,name=ruleId,proto3" json:"ruleId,omitempty"` - VariantId string `protobuf:"bytes,3,opt,name=variantId,proto3" json:"variantId,omitempty"` - VariantKey string `protobuf:"bytes,4,opt,name=variantKey,proto3" json:"variantKey,omitempty"` - VariantAttachment string `protobuf:"bytes,5,opt,name=variantAttachment,proto3" json:"variantAttachment,omitempty"` + RuleId string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` + VariantId string `protobuf:"bytes,3,opt,name=variant_id,json=variantId,proto3" json:"variant_id,omitempty"` + VariantKey string `protobuf:"bytes,4,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` + VariantAttachment string `protobuf:"bytes,5,opt,name=variant_attachment,json=variantAttachment,proto3" json:"variant_attachment,omitempty"` Rollout float32 `protobuf:"fixed32,6,opt,name=rollout,proto3" json:"rollout,omitempty"` } @@ -267,7 +267,7 @@ type EvaluationRolloutSegment struct { unknownFields protoimpl.UnknownFields Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segmentOperator,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` } @@ -797,143 +797,144 @@ var file_data_data_proto_rawDesc = []byte{ 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0b, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x16, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x01, 0x0a, 0x16, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1c, - 0x0a, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x11, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, - 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, - 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, - 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, - 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x66, 0x6c, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, + 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x26, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, - 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xad, 0x01, 0x0a, - 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, - 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x40, 0x0a, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, - 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xc6, 0x02, 0x0a, - 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x09, + 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, + 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, + 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0xae, 0x01, 0x0a, 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0xc6, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, - 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, + 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x0e, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, - 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, - 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, + 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, 0x0a, 0x0d, 0x64, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, - 0x6c, 0x61, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x32, 0x85, 0x01, 0x0a, - 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x1b, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2e, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x08, + 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x08, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, + 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, + 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x32, 0x85, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x76, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x2e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, + 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -972,7 +973,7 @@ var file_data_data_proto_depIdxs = []int32{ 10, // 0: flipt.data.EvaluationRollout.type:type_name -> flipt.RolloutType 3, // 1: flipt.data.EvaluationRollout.segment:type_name -> flipt.data.EvaluationRolloutSegment 2, // 2: flipt.data.EvaluationRollout.threshold:type_name -> flipt.data.EvaluationRolloutThreshold - 11, // 3: flipt.data.EvaluationRolloutSegment.segmentOperator:type_name -> flipt.SegmentOperator + 11, // 3: flipt.data.EvaluationRolloutSegment.segment_operator:type_name -> flipt.SegmentOperator 4, // 4: flipt.data.EvaluationRolloutSegment.segments:type_name -> flipt.data.EvaluationSegment 12, // 5: flipt.data.EvaluationSegment.match_type:type_name -> flipt.MatchType 13, // 6: flipt.data.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto index 57b464ef0d..e275ae318a 100644 --- a/rpc/flipt/data/data.proto +++ b/rpc/flipt/data/data.proto @@ -9,10 +9,10 @@ option go_package = "go.flipt.io/flipt/rpc/flipt/data"; message EvaluationDistribution { string id = 1; - string ruleId = 2; - string variantId = 3; - string variantKey = 4; - string variantAttachment = 5; + string rule_id = 2; + string variant_id = 3; + string variant_key = 4; + string variant_attachment = 5; float rollout = 6; } @@ -32,7 +32,7 @@ message EvaluationRolloutThreshold { message EvaluationRolloutSegment { bool value = 1; - flipt.SegmentOperator segmentOperator = 2; + flipt.SegmentOperator segment_operator = 2; repeated EvaluationSegment segments = 3; } From e4df56d3d26b4f7416c730dd144e21565647f96d Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:01:10 -0400 Subject: [PATCH 18/39] chore: move --- internal/cmd/grpc.go | 11 +- .../server/{ => evaluation}/data/server.go | 42 +- rpc/flipt/data/data.pb.go | 1151 ------------- rpc/flipt/data/data.pb.gw.go | 189 --- rpc/flipt/data/data.proto | 88 - rpc/flipt/data/data_grpc.pb.go | 109 -- rpc/flipt/evaluation/evaluation.pb.go | 1426 +++++++++++++++-- rpc/flipt/evaluation/evaluation.pb.gw.go | 157 ++ rpc/flipt/evaluation/evaluation.proto | 81 + rpc/flipt/evaluation/evaluation_grpc.pb.go | 90 ++ rpc/flipt/flipt.yaml | 4 +- sdk/go/evaluation.sdk.gen.go | 41 +- sdk/go/grpc/grpc.sdk.gen.go | 15 +- sdk/go/http/evaluation.sdk.gen.go | 59 +- sdk/go/sdk.gen.go | 12 +- 15 files changed, 1712 insertions(+), 1763 deletions(-) rename internal/server/{ => evaluation}/data/server.go (76%) delete mode 100644 rpc/flipt/data/data.pb.go delete mode 100644 rpc/flipt/data/data.pb.gw.go delete mode 100644 rpc/flipt/data/data.proto delete mode 100644 rpc/flipt/data/data_grpc.pb.go diff --git a/internal/cmd/grpc.go b/internal/cmd/grpc.go index e8b9784db2..8c40c58328 100644 --- a/internal/cmd/grpc.go +++ b/internal/cmd/grpc.go @@ -26,6 +26,7 @@ import ( "go.flipt.io/flipt/internal/server/audit/webhook" "go.flipt.io/flipt/internal/server/auth" "go.flipt.io/flipt/internal/server/evaluation" + evaluationdata "go.flipt.io/flipt/internal/server/evaluation/data" "go.flipt.io/flipt/internal/server/metadata" middlewaregrpc "go.flipt.io/flipt/internal/server/middleware/grpc" "go.flipt.io/flipt/internal/storage" @@ -282,10 +283,11 @@ func NewGRPCServer( } var ( - fliptsrv = fliptserver.New(logger, store) - metasrv = metadata.New(cfg, info) - evalsrv = evaluation.New(logger, store) - healthsrv = health.NewServer() + fliptsrv = fliptserver.New(logger, store) + metasrv = metadata.New(cfg, info) + evalsrv = evaluation.New(logger, store) + evalDataSrv = evaluationdata.New(logger, store) + healthsrv = health.NewServer() ) var ( @@ -340,6 +342,7 @@ func NewGRPCServer( register.Add(fliptsrv) register.Add(metasrv) register.Add(evalsrv) + register.Add(evalDataSrv) // forward internal gRPC logging to zap grpcLogLevel, err := zapcore.ParseLevel(cfg.Log.GRPCLevel) diff --git a/internal/server/data/server.go b/internal/server/evaluation/data/server.go similarity index 76% rename from internal/server/data/server.go rename to internal/server/evaluation/data/server.go index 8940954d8d..22ad7139d3 100644 --- a/internal/server/data/server.go +++ b/internal/server/evaluation/data/server.go @@ -6,8 +6,9 @@ import ( "go.flipt.io/flipt/internal/storage" "go.flipt.io/flipt/rpc/flipt" - "go.flipt.io/flipt/rpc/flipt/data" + "go.flipt.io/flipt/rpc/flipt/evaluation" "go.uber.org/zap" + "google.golang.org/grpc" ) type EvaluationStore interface { @@ -19,23 +20,28 @@ type Server struct { logger *zap.Logger store EvaluationStore - data.UnimplementedDataServiceServer + evaluation.UnimplementedDataServiceServer } -func NewServer(logger *zap.Logger, store EvaluationStore) *Server { +func New(logger *zap.Logger, store EvaluationStore) *Server { return &Server{ logger: logger, store: store, } } -func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.EvaluationNamespaceSnapshotRequest) (*data.EvaluationNamespaceSnapshot, error) { +// RegisterGRPC registers the *Server onto the provided grpc Server. +func (srv *Server) RegisterGRPC(server *grpc.Server) { + evaluation.RegisterDataServiceServer(server, srv) +} + +func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluation.EvaluationNamespaceSnapshotRequest) (*evaluation.EvaluationNamespaceSnapshot, error) { var ( namespaceKey = r.Key - resp = &data.EvaluationNamespaceSnapshot{} + resp = &evaluation.EvaluationNamespaceSnapshot{} remaining = true nextPage string - segments = make(map[string]*data.EvaluationSegment) + segments = make(map[string]*evaluation.EvaluationSegment) ) // flags/variants in batches @@ -54,7 +60,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval remaining = nextPage != "" for _, f := range flags { - flag := &data.EvaluationFlag{ + flag := &evaluation.EvaluationFlag{ Key: f.Key, Name: f.Name, Description: f.Description, @@ -71,7 +77,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval } for _, r := range rules { - rule := &data.EvaluationRule{ + rule := &evaluation.EvaluationRule{ Id: r.ID, Rank: r.Rank, SegmentOperator: r.SegmentOperator, @@ -83,13 +89,13 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval rule.Segments = append(rule.Segments, ss) } else { - ss := &data.EvaluationSegment{ + ss := &evaluation.EvaluationSegment{ Key: s.SegmentKey, MatchType: s.MatchType, } for _, c := range s.Constraints { - ss.Constraints = append(ss.Constraints, &data.EvaluationConstraint{ + ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ Id: c.ID, Type: c.Type, Property: c.Property, @@ -109,7 +115,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval // distributions for rule for _, d := range distributions { - dist := &data.EvaluationDistribution{ + dist := &evaluation.EvaluationDistribution{ VariantId: d.VariantID, VariantKey: d.VariantKey, VariantAttachment: d.VariantAttachment, @@ -130,22 +136,22 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval } for _, r := range rollouts { - rollout := &data.EvaluationRollout{ + rollout := &evaluation.EvaluationRollout{ Type: r.RolloutType, Rank: r.Rank, } switch r.RolloutType { case flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE: - rollout.Rule = &data.EvaluationRollout_Threshold{ - Threshold: &data.EvaluationRolloutThreshold{ + rollout.Rule = &evaluation.EvaluationRollout_Threshold{ + Threshold: &evaluation.EvaluationRolloutThreshold{ Percentage: r.Threshold.Percentage, Value: r.Threshold.Value, }, } case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: - segment := &data.EvaluationRolloutSegment{ + segment := &evaluation.EvaluationRolloutSegment{ Value: r.Segment.Value, SegmentOperator: r.Segment.SegmentOperator, } @@ -154,13 +160,13 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval // optimization: reuse segment if already seen ss, ok := segments[s.SegmentKey] if !ok { - ss := &data.EvaluationSegment{ + ss := &evaluation.EvaluationSegment{ Key: s.SegmentKey, MatchType: s.MatchType, } for _, c := range s.Constraints { - ss.Constraints = append(ss.Constraints, &data.EvaluationConstraint{ + ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ Id: c.ID, Type: c.Type, Property: c.Property, @@ -175,7 +181,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *data.Eval segment.Segments = append(segment.Segments, ss) } - rollout.Rule = &data.EvaluationRollout_Segment{ + rollout.Rule = &evaluation.EvaluationRollout_Segment{ Segment: segment, } } diff --git a/rpc/flipt/data/data.pb.go b/rpc/flipt/data/data.pb.go deleted file mode 100644 index 0f9608c8e4..0000000000 --- a/rpc/flipt/data/data.pb.go +++ /dev/null @@ -1,1151 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: data/data.proto - -package data - -import ( - flipt "go.flipt.io/flipt/rpc/flipt" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type EvaluationDistribution struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - RuleId string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` - VariantId string `protobuf:"bytes,3,opt,name=variant_id,json=variantId,proto3" json:"variant_id,omitempty"` - VariantKey string `protobuf:"bytes,4,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` - VariantAttachment string `protobuf:"bytes,5,opt,name=variant_attachment,json=variantAttachment,proto3" json:"variant_attachment,omitempty"` - Rollout float32 `protobuf:"fixed32,6,opt,name=rollout,proto3" json:"rollout,omitempty"` -} - -func (x *EvaluationDistribution) Reset() { - *x = EvaluationDistribution{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationDistribution) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationDistribution) ProtoMessage() {} - -func (x *EvaluationDistribution) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationDistribution.ProtoReflect.Descriptor instead. -func (*EvaluationDistribution) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{0} -} - -func (x *EvaluationDistribution) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EvaluationDistribution) GetRuleId() string { - if x != nil { - return x.RuleId - } - return "" -} - -func (x *EvaluationDistribution) GetVariantId() string { - if x != nil { - return x.VariantId - } - return "" -} - -func (x *EvaluationDistribution) GetVariantKey() string { - if x != nil { - return x.VariantKey - } - return "" -} - -func (x *EvaluationDistribution) GetVariantAttachment() string { - if x != nil { - return x.VariantAttachment - } - return "" -} - -func (x *EvaluationDistribution) GetRollout() float32 { - if x != nil { - return x.Rollout - } - return 0 -} - -type EvaluationRollout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type flipt.RolloutType `protobuf:"varint,1,opt,name=type,proto3,enum=flipt.RolloutType" json:"type,omitempty"` - Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` - // Types that are assignable to Rule: - // - // *EvaluationRollout_Segment - // *EvaluationRollout_Threshold - Rule isEvaluationRollout_Rule `protobuf_oneof:"rule"` -} - -func (x *EvaluationRollout) Reset() { - *x = EvaluationRollout{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationRollout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationRollout) ProtoMessage() {} - -func (x *EvaluationRollout) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationRollout.ProtoReflect.Descriptor instead. -func (*EvaluationRollout) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{1} -} - -func (x *EvaluationRollout) GetType() flipt.RolloutType { - if x != nil { - return x.Type - } - return flipt.RolloutType(0) -} - -func (x *EvaluationRollout) GetRank() int32 { - if x != nil { - return x.Rank - } - return 0 -} - -func (m *EvaluationRollout) GetRule() isEvaluationRollout_Rule { - if m != nil { - return m.Rule - } - return nil -} - -func (x *EvaluationRollout) GetSegment() *EvaluationRolloutSegment { - if x, ok := x.GetRule().(*EvaluationRollout_Segment); ok { - return x.Segment - } - return nil -} - -func (x *EvaluationRollout) GetThreshold() *EvaluationRolloutThreshold { - if x, ok := x.GetRule().(*EvaluationRollout_Threshold); ok { - return x.Threshold - } - return nil -} - -type isEvaluationRollout_Rule interface { - isEvaluationRollout_Rule() -} - -type EvaluationRollout_Segment struct { - Segment *EvaluationRolloutSegment `protobuf:"bytes,3,opt,name=segment,proto3,oneof"` -} - -type EvaluationRollout_Threshold struct { - Threshold *EvaluationRolloutThreshold `protobuf:"bytes,4,opt,name=threshold,proto3,oneof"` -} - -func (*EvaluationRollout_Segment) isEvaluationRollout_Rule() {} - -func (*EvaluationRollout_Threshold) isEvaluationRollout_Rule() {} - -type EvaluationRolloutThreshold struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` - Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *EvaluationRolloutThreshold) Reset() { - *x = EvaluationRolloutThreshold{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationRolloutThreshold) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationRolloutThreshold) ProtoMessage() {} - -func (x *EvaluationRolloutThreshold) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationRolloutThreshold.ProtoReflect.Descriptor instead. -func (*EvaluationRolloutThreshold) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{2} -} - -func (x *EvaluationRolloutThreshold) GetPercentage() float32 { - if x != nil { - return x.Percentage - } - return 0 -} - -func (x *EvaluationRolloutThreshold) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - -type EvaluationRolloutSegment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` - Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` -} - -func (x *EvaluationRolloutSegment) Reset() { - *x = EvaluationRolloutSegment{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationRolloutSegment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationRolloutSegment) ProtoMessage() {} - -func (x *EvaluationRolloutSegment) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationRolloutSegment.ProtoReflect.Descriptor instead. -func (*EvaluationRolloutSegment) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{3} -} - -func (x *EvaluationRolloutSegment) GetValue() bool { - if x != nil { - return x.Value - } - return false -} - -func (x *EvaluationRolloutSegment) GetSegmentOperator() flipt.SegmentOperator { - if x != nil { - return x.SegmentOperator - } - return flipt.SegmentOperator(0) -} - -func (x *EvaluationRolloutSegment) GetSegments() []*EvaluationSegment { - if x != nil { - return x.Segments - } - return nil -} - -type EvaluationSegment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - MatchType flipt.MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=flipt.MatchType" json:"match_type,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Constraints []*EvaluationConstraint `protobuf:"bytes,7,rep,name=constraints,proto3" json:"constraints,omitempty"` -} - -func (x *EvaluationSegment) Reset() { - *x = EvaluationSegment{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationSegment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationSegment) ProtoMessage() {} - -func (x *EvaluationSegment) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationSegment.ProtoReflect.Descriptor instead. -func (*EvaluationSegment) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{4} -} - -func (x *EvaluationSegment) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *EvaluationSegment) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *EvaluationSegment) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *EvaluationSegment) GetMatchType() flipt.MatchType { - if x != nil { - return x.MatchType - } - return flipt.MatchType(0) -} - -func (x *EvaluationSegment) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *EvaluationSegment) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *EvaluationSegment) GetConstraints() []*EvaluationConstraint { - if x != nil { - return x.Constraints - } - return nil -} - -type EvaluationFlag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - Type flipt.FlagType `protobuf:"varint,5,opt,name=type,proto3,enum=flipt.FlagType" json:"type,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Rules []*EvaluationRule `protobuf:"bytes,8,rep,name=rules,proto3" json:"rules,omitempty"` - Rollouts []*EvaluationRollout `protobuf:"bytes,9,rep,name=rollouts,proto3" json:"rollouts,omitempty"` -} - -func (x *EvaluationFlag) Reset() { - *x = EvaluationFlag{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationFlag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationFlag) ProtoMessage() {} - -func (x *EvaluationFlag) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationFlag.ProtoReflect.Descriptor instead. -func (*EvaluationFlag) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{5} -} - -func (x *EvaluationFlag) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *EvaluationFlag) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *EvaluationFlag) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *EvaluationFlag) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *EvaluationFlag) GetType() flipt.FlagType { - if x != nil { - return x.Type - } - return flipt.FlagType(0) -} - -func (x *EvaluationFlag) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *EvaluationFlag) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *EvaluationFlag) GetRules() []*EvaluationRule { - if x != nil { - return x.Rules - } - return nil -} - -func (x *EvaluationFlag) GetRollouts() []*EvaluationRollout { - if x != nil { - return x.Rollouts - } - return nil -} - -type EvaluationConstraint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type flipt.ComparisonType `protobuf:"varint,2,opt,name=type,proto3,enum=flipt.ComparisonType" json:"type,omitempty"` - Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"` - Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator,omitempty"` - Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *EvaluationConstraint) Reset() { - *x = EvaluationConstraint{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationConstraint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationConstraint) ProtoMessage() {} - -func (x *EvaluationConstraint) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationConstraint.ProtoReflect.Descriptor instead. -func (*EvaluationConstraint) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{6} -} - -func (x *EvaluationConstraint) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EvaluationConstraint) GetType() flipt.ComparisonType { - if x != nil { - return x.Type - } - return flipt.ComparisonType(0) -} - -func (x *EvaluationConstraint) GetProperty() string { - if x != nil { - return x.Property - } - return "" -} - -func (x *EvaluationConstraint) GetOperator() string { - if x != nil { - return x.Operator - } - return "" -} - -func (x *EvaluationConstraint) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type EvaluationRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Segments []*EvaluationSegment `protobuf:"bytes,2,rep,name=segments,proto3" json:"segments,omitempty"` - Rank int32 `protobuf:"varint,3,opt,name=rank,proto3" json:"rank,omitempty"` - SegmentOperator flipt.SegmentOperator `protobuf:"varint,4,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` - Distributions []*EvaluationDistribution `protobuf:"bytes,5,rep,name=distributions,proto3" json:"distributions,omitempty"` -} - -func (x *EvaluationRule) Reset() { - *x = EvaluationRule{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationRule) ProtoMessage() {} - -func (x *EvaluationRule) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationRule.ProtoReflect.Descriptor instead. -func (*EvaluationRule) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{7} -} - -func (x *EvaluationRule) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EvaluationRule) GetSegments() []*EvaluationSegment { - if x != nil { - return x.Segments - } - return nil -} - -func (x *EvaluationRule) GetRank() int32 { - if x != nil { - return x.Rank - } - return 0 -} - -func (x *EvaluationRule) GetSegmentOperator() flipt.SegmentOperator { - if x != nil { - return x.SegmentOperator - } - return flipt.SegmentOperator(0) -} - -func (x *EvaluationRule) GetDistributions() []*EvaluationDistribution { - if x != nil { - return x.Distributions - } - return nil -} - -type EvaluationNamespaceSnapshot struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace *flipt.Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Flags []*EvaluationFlag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` -} - -func (x *EvaluationNamespaceSnapshot) Reset() { - *x = EvaluationNamespaceSnapshot{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationNamespaceSnapshot) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationNamespaceSnapshot) ProtoMessage() {} - -func (x *EvaluationNamespaceSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationNamespaceSnapshot.ProtoReflect.Descriptor instead. -func (*EvaluationNamespaceSnapshot) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{8} -} - -func (x *EvaluationNamespaceSnapshot) GetNamespace() *flipt.Namespace { - if x != nil { - return x.Namespace - } - return nil -} - -func (x *EvaluationNamespaceSnapshot) GetFlags() []*EvaluationFlag { - if x != nil { - return x.Flags - } - return nil -} - -type EvaluationNamespaceSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *EvaluationNamespaceSnapshotRequest) Reset() { - *x = EvaluationNamespaceSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_data_data_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvaluationNamespaceSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvaluationNamespaceSnapshotRequest) ProtoMessage() {} - -func (x *EvaluationNamespaceSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_data_data_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EvaluationNamespaceSnapshotRequest.ProtoReflect.Descriptor instead. -func (*EvaluationNamespaceSnapshotRequest) Descriptor() ([]byte, []int) { - return file_data_data_proto_rawDescGZIP(), []int{9} -} - -func (x *EvaluationNamespaceSnapshotRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -var File_data_data_proto protoreflect.FileDescriptor - -var file_data_data_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0a, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0b, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x01, 0x0a, 0x16, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, - 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, - 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, - 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, - 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x12, 0x26, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x65, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x09, - 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, - 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, - 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, - 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0xae, 0x01, 0x0a, 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x22, 0xc6, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x2f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, - 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x0e, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, - 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, - 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x08, - 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, - 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x0e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x08, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, - 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, - 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, - 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x32, 0x85, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x76, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x2e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x6f, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_data_data_proto_rawDescOnce sync.Once - file_data_data_proto_rawDescData = file_data_data_proto_rawDesc -) - -func file_data_data_proto_rawDescGZIP() []byte { - file_data_data_proto_rawDescOnce.Do(func() { - file_data_data_proto_rawDescData = protoimpl.X.CompressGZIP(file_data_data_proto_rawDescData) - }) - return file_data_data_proto_rawDescData -} - -var file_data_data_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_data_data_proto_goTypes = []interface{}{ - (*EvaluationDistribution)(nil), // 0: flipt.data.EvaluationDistribution - (*EvaluationRollout)(nil), // 1: flipt.data.EvaluationRollout - (*EvaluationRolloutThreshold)(nil), // 2: flipt.data.EvaluationRolloutThreshold - (*EvaluationRolloutSegment)(nil), // 3: flipt.data.EvaluationRolloutSegment - (*EvaluationSegment)(nil), // 4: flipt.data.EvaluationSegment - (*EvaluationFlag)(nil), // 5: flipt.data.EvaluationFlag - (*EvaluationConstraint)(nil), // 6: flipt.data.EvaluationConstraint - (*EvaluationRule)(nil), // 7: flipt.data.EvaluationRule - (*EvaluationNamespaceSnapshot)(nil), // 8: flipt.data.EvaluationNamespaceSnapshot - (*EvaluationNamespaceSnapshotRequest)(nil), // 9: flipt.data.EvaluationNamespaceSnapshotRequest - (flipt.RolloutType)(0), // 10: flipt.RolloutType - (flipt.SegmentOperator)(0), // 11: flipt.SegmentOperator - (flipt.MatchType)(0), // 12: flipt.MatchType - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (flipt.FlagType)(0), // 14: flipt.FlagType - (flipt.ComparisonType)(0), // 15: flipt.ComparisonType - (*flipt.Namespace)(nil), // 16: flipt.Namespace -} -var file_data_data_proto_depIdxs = []int32{ - 10, // 0: flipt.data.EvaluationRollout.type:type_name -> flipt.RolloutType - 3, // 1: flipt.data.EvaluationRollout.segment:type_name -> flipt.data.EvaluationRolloutSegment - 2, // 2: flipt.data.EvaluationRollout.threshold:type_name -> flipt.data.EvaluationRolloutThreshold - 11, // 3: flipt.data.EvaluationRolloutSegment.segment_operator:type_name -> flipt.SegmentOperator - 4, // 4: flipt.data.EvaluationRolloutSegment.segments:type_name -> flipt.data.EvaluationSegment - 12, // 5: flipt.data.EvaluationSegment.match_type:type_name -> flipt.MatchType - 13, // 6: flipt.data.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp - 13, // 7: flipt.data.EvaluationSegment.updated_at:type_name -> google.protobuf.Timestamp - 6, // 8: flipt.data.EvaluationSegment.constraints:type_name -> flipt.data.EvaluationConstraint - 14, // 9: flipt.data.EvaluationFlag.type:type_name -> flipt.FlagType - 13, // 10: flipt.data.EvaluationFlag.created_at:type_name -> google.protobuf.Timestamp - 13, // 11: flipt.data.EvaluationFlag.updated_at:type_name -> google.protobuf.Timestamp - 7, // 12: flipt.data.EvaluationFlag.rules:type_name -> flipt.data.EvaluationRule - 1, // 13: flipt.data.EvaluationFlag.rollouts:type_name -> flipt.data.EvaluationRollout - 15, // 14: flipt.data.EvaluationConstraint.type:type_name -> flipt.ComparisonType - 4, // 15: flipt.data.EvaluationRule.segments:type_name -> flipt.data.EvaluationSegment - 11, // 16: flipt.data.EvaluationRule.segment_operator:type_name -> flipt.SegmentOperator - 0, // 17: flipt.data.EvaluationRule.distributions:type_name -> flipt.data.EvaluationDistribution - 16, // 18: flipt.data.EvaluationNamespaceSnapshot.namespace:type_name -> flipt.Namespace - 5, // 19: flipt.data.EvaluationNamespaceSnapshot.flags:type_name -> flipt.data.EvaluationFlag - 9, // 20: flipt.data.DataService.EvaluationSnapshotNamespace:input_type -> flipt.data.EvaluationNamespaceSnapshotRequest - 8, // 21: flipt.data.DataService.EvaluationSnapshotNamespace:output_type -> flipt.data.EvaluationNamespaceSnapshot - 21, // [21:22] is the sub-list for method output_type - 20, // [20:21] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name -} - -func init() { file_data_data_proto_init() } -func file_data_data_proto_init() { - if File_data_data_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_data_data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationDistribution); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationRollout); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationRolloutThreshold); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationRolloutSegment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationSegment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationFlag); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationConstraint); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationNamespaceSnapshot); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_data_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationNamespaceSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_data_data_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*EvaluationRollout_Segment)(nil), - (*EvaluationRollout_Threshold)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_data_data_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_data_data_proto_goTypes, - DependencyIndexes: file_data_data_proto_depIdxs, - MessageInfos: file_data_data_proto_msgTypes, - }.Build() - File_data_data_proto = out.File - file_data_data_proto_rawDesc = nil - file_data_data_proto_goTypes = nil - file_data_data_proto_depIdxs = nil -} diff --git a/rpc/flipt/data/data.pb.gw.go b/rpc/flipt/data/data.pb.gw.go deleted file mode 100644 index b03150d6bd..0000000000 --- a/rpc/flipt/data/data.pb.gw.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: data/data.proto - -/* -Package data is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package data - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join - -func request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq EvaluationNamespaceSnapshotRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["key"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") - } - - protoReq.Key, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) - } - - msg, err := client.EvaluationSnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq EvaluationNamespaceSnapshotRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["key"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") - } - - protoReq.Key, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) - } - - msg, err := server.EvaluationSnapshotNamespace(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterDataServiceHandlerServer registers the http handlers for service DataService to "mux". -// UnaryRPC :call DataServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataServiceHandlerFromEndpoint instead. -func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error { - - mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.data.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterDataServiceHandlerFromEndpoint is same as RegisterDataServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterDataServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterDataServiceHandler(ctx, mux, conn) -} - -// RegisterDataServiceHandler registers the http handlers for service DataService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterDataServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterDataServiceHandlerClient(ctx, mux, NewDataServiceClient(conn)) -} - -// RegisterDataServiceHandlerClient registers the http handlers for service DataService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DataServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DataServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "DataServiceClient" to call the correct interceptors. -func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataServiceClient) error { - - mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.data.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_DataService_EvaluationSnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"internal", "v1", "evaluation", "snapshot", "namespace", "key"}, "")) -) - -var ( - forward_DataService_EvaluationSnapshotNamespace_0 = runtime.ForwardResponseMessage -) diff --git a/rpc/flipt/data/data.proto b/rpc/flipt/data/data.proto deleted file mode 100644 index e275ae318a..0000000000 --- a/rpc/flipt/data/data.proto +++ /dev/null @@ -1,88 +0,0 @@ -syntax = "proto3"; - -package flipt.data; - -import "flipt.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "go.flipt.io/flipt/rpc/flipt/data"; - -message EvaluationDistribution { - string id = 1; - string rule_id = 2; - string variant_id = 3; - string variant_key = 4; - string variant_attachment = 5; - float rollout = 6; -} - -message EvaluationRollout { - flipt.RolloutType type = 1; - int32 rank = 2; - oneof rule { - EvaluationRolloutSegment segment = 3; - EvaluationRolloutThreshold threshold = 4; - } -} - -message EvaluationRolloutThreshold { - float percentage = 1; - bool value = 2; -} - -message EvaluationRolloutSegment { - bool value = 1; - flipt.SegmentOperator segment_operator = 2; - repeated EvaluationSegment segments = 3; -} - -message EvaluationSegment { - string key = 1; - string name = 2; - string description = 3; - flipt.MatchType match_type = 4; - google.protobuf.Timestamp created_at = 5; - google.protobuf.Timestamp updated_at = 6; - repeated EvaluationConstraint constraints = 7; -} - -message EvaluationFlag { - string key = 1; - string name = 2; - string description = 3; - bool enabled = 4; - flipt.FlagType type = 5; - google.protobuf.Timestamp created_at = 6; - google.protobuf.Timestamp updated_at = 7; - repeated EvaluationRule rules = 8; - repeated EvaluationRollout rollouts = 9; -} - -message EvaluationConstraint { - string id = 1; - flipt.ComparisonType type = 2; - string property = 3; - string operator = 4; - string value = 5; -} - -message EvaluationRule { - string id = 1; - repeated EvaluationSegment segments = 2; - int32 rank = 3; - flipt.SegmentOperator segment_operator = 4; - repeated EvaluationDistribution distributions = 5; -} - -message EvaluationNamespaceSnapshot { - flipt.Namespace namespace = 1; - repeated EvaluationFlag flags = 2; -} - -message EvaluationNamespaceSnapshotRequest { - string key = 1; -} - -service DataService { - rpc EvaluationSnapshotNamespace(EvaluationNamespaceSnapshotRequest) returns (EvaluationNamespaceSnapshot); -} diff --git a/rpc/flipt/data/data_grpc.pb.go b/rpc/flipt/data/data_grpc.pb.go deleted file mode 100644 index ebcb431a77..0000000000 --- a/rpc/flipt/data/data_grpc.pb.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: data/data.proto - -package data - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - DataService_EvaluationSnapshotNamespace_FullMethodName = "/flipt.data.DataService/EvaluationSnapshotNamespace" -) - -// DataServiceClient is the client API for DataService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DataServiceClient interface { - EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) -} - -type dataServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient { - return &dataServiceClient{cc} -} - -func (c *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) { - out := new(EvaluationNamespaceSnapshot) - err := c.cc.Invoke(ctx, DataService_EvaluationSnapshotNamespace_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DataServiceServer is the server API for DataService service. -// All implementations must embed UnimplementedDataServiceServer -// for forward compatibility -type DataServiceServer interface { - EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) - mustEmbedUnimplementedDataServiceServer() -} - -// UnimplementedDataServiceServer must be embedded to have forward compatible implementations. -type UnimplementedDataServiceServer struct { -} - -func (UnimplementedDataServiceServer) EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) { - return nil, status.Errorf(codes.Unimplemented, "method EvaluationSnapshotNamespace not implemented") -} -func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {} - -// UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DataServiceServer will -// result in compilation errors. -type UnsafeDataServiceServer interface { - mustEmbedUnimplementedDataServiceServer() -} - -func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) { - s.RegisterService(&DataService_ServiceDesc, srv) -} - -func _DataService_EvaluationSnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EvaluationNamespaceSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DataService_EvaluationSnapshotNamespace_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, req.(*EvaluationNamespaceSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// DataService_ServiceDesc is the grpc.ServiceDesc for DataService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var DataService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "flipt.data.DataService", - HandlerType: (*DataServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EvaluationSnapshotNamespace", - Handler: _DataService_EvaluationSnapshotNamespace_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "data/data.proto", -} diff --git a/rpc/flipt/evaluation/evaluation.pb.go b/rpc/flipt/evaluation/evaluation.pb.go index e58e037923..68560fc048 100644 --- a/rpc/flipt/evaluation/evaluation.pb.go +++ b/rpc/flipt/evaluation/evaluation.pb.go @@ -7,6 +7,7 @@ package evaluation import ( + flipt "go.flipt.io/flipt/rpc/flipt" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -729,6 +730,774 @@ func (x *ErrorEvaluationResponse) GetReason() ErrorEvaluationReason { return ErrorEvaluationReason_UNKNOWN_ERROR_EVALUATION_REASON } +type EvaluationDistribution struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + RuleId string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"` + VariantId string `protobuf:"bytes,3,opt,name=variant_id,json=variantId,proto3" json:"variant_id,omitempty"` + VariantKey string `protobuf:"bytes,4,opt,name=variant_key,json=variantKey,proto3" json:"variant_key,omitempty"` + VariantAttachment string `protobuf:"bytes,5,opt,name=variant_attachment,json=variantAttachment,proto3" json:"variant_attachment,omitempty"` + Rollout float32 `protobuf:"fixed32,6,opt,name=rollout,proto3" json:"rollout,omitempty"` +} + +func (x *EvaluationDistribution) Reset() { + *x = EvaluationDistribution{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationDistribution) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationDistribution) ProtoMessage() {} + +func (x *EvaluationDistribution) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationDistribution.ProtoReflect.Descriptor instead. +func (*EvaluationDistribution) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{7} +} + +func (x *EvaluationDistribution) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationDistribution) GetRuleId() string { + if x != nil { + return x.RuleId + } + return "" +} + +func (x *EvaluationDistribution) GetVariantId() string { + if x != nil { + return x.VariantId + } + return "" +} + +func (x *EvaluationDistribution) GetVariantKey() string { + if x != nil { + return x.VariantKey + } + return "" +} + +func (x *EvaluationDistribution) GetVariantAttachment() string { + if x != nil { + return x.VariantAttachment + } + return "" +} + +func (x *EvaluationDistribution) GetRollout() float32 { + if x != nil { + return x.Rollout + } + return 0 +} + +type EvaluationRollout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type flipt.RolloutType `protobuf:"varint,1,opt,name=type,proto3,enum=flipt.RolloutType" json:"type,omitempty"` + Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` + // Types that are assignable to Rule: + // + // *EvaluationRollout_Segment + // *EvaluationRollout_Threshold + Rule isEvaluationRollout_Rule `protobuf_oneof:"rule"` +} + +func (x *EvaluationRollout) Reset() { + *x = EvaluationRollout{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRollout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRollout) ProtoMessage() {} + +func (x *EvaluationRollout) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRollout.ProtoReflect.Descriptor instead. +func (*EvaluationRollout) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{8} +} + +func (x *EvaluationRollout) GetType() flipt.RolloutType { + if x != nil { + return x.Type + } + return flipt.RolloutType(0) +} + +func (x *EvaluationRollout) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (m *EvaluationRollout) GetRule() isEvaluationRollout_Rule { + if m != nil { + return m.Rule + } + return nil +} + +func (x *EvaluationRollout) GetSegment() *EvaluationRolloutSegment { + if x, ok := x.GetRule().(*EvaluationRollout_Segment); ok { + return x.Segment + } + return nil +} + +func (x *EvaluationRollout) GetThreshold() *EvaluationRolloutThreshold { + if x, ok := x.GetRule().(*EvaluationRollout_Threshold); ok { + return x.Threshold + } + return nil +} + +type isEvaluationRollout_Rule interface { + isEvaluationRollout_Rule() +} + +type EvaluationRollout_Segment struct { + Segment *EvaluationRolloutSegment `protobuf:"bytes,3,opt,name=segment,proto3,oneof"` +} + +type EvaluationRollout_Threshold struct { + Threshold *EvaluationRolloutThreshold `protobuf:"bytes,4,opt,name=threshold,proto3,oneof"` +} + +func (*EvaluationRollout_Segment) isEvaluationRollout_Rule() {} + +func (*EvaluationRollout_Threshold) isEvaluationRollout_Rule() {} + +type EvaluationRolloutThreshold struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Percentage float32 `protobuf:"fixed32,1,opt,name=percentage,proto3" json:"percentage,omitempty"` + Value bool `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EvaluationRolloutThreshold) Reset() { + *x = EvaluationRolloutThreshold{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRolloutThreshold) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRolloutThreshold) ProtoMessage() {} + +func (x *EvaluationRolloutThreshold) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRolloutThreshold.ProtoReflect.Descriptor instead. +func (*EvaluationRolloutThreshold) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{9} +} + +func (x *EvaluationRolloutThreshold) GetPercentage() float32 { + if x != nil { + return x.Percentage + } + return 0 +} + +func (x *EvaluationRolloutThreshold) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +type EvaluationRolloutSegment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` +} + +func (x *EvaluationRolloutSegment) Reset() { + *x = EvaluationRolloutSegment{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRolloutSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRolloutSegment) ProtoMessage() {} + +func (x *EvaluationRolloutSegment) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRolloutSegment.ProtoReflect.Descriptor instead. +func (*EvaluationRolloutSegment) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{10} +} + +func (x *EvaluationRolloutSegment) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +func (x *EvaluationRolloutSegment) GetSegmentOperator() flipt.SegmentOperator { + if x != nil { + return x.SegmentOperator + } + return flipt.SegmentOperator(0) +} + +func (x *EvaluationRolloutSegment) GetSegments() []*EvaluationSegment { + if x != nil { + return x.Segments + } + return nil +} + +type EvaluationSegment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + MatchType flipt.MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=flipt.MatchType" json:"match_type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Constraints []*EvaluationConstraint `protobuf:"bytes,7,rep,name=constraints,proto3" json:"constraints,omitempty"` +} + +func (x *EvaluationSegment) Reset() { + *x = EvaluationSegment{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationSegment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationSegment) ProtoMessage() {} + +func (x *EvaluationSegment) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationSegment.ProtoReflect.Descriptor instead. +func (*EvaluationSegment) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{11} +} + +func (x *EvaluationSegment) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EvaluationSegment) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EvaluationSegment) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *EvaluationSegment) GetMatchType() flipt.MatchType { + if x != nil { + return x.MatchType + } + return flipt.MatchType(0) +} + +func (x *EvaluationSegment) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *EvaluationSegment) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *EvaluationSegment) GetConstraints() []*EvaluationConstraint { + if x != nil { + return x.Constraints + } + return nil +} + +type EvaluationFlag struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` + Type flipt.FlagType `protobuf:"varint,5,opt,name=type,proto3,enum=flipt.FlagType" json:"type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Rules []*EvaluationRule `protobuf:"bytes,8,rep,name=rules,proto3" json:"rules,omitempty"` + Rollouts []*EvaluationRollout `protobuf:"bytes,9,rep,name=rollouts,proto3" json:"rollouts,omitempty"` +} + +func (x *EvaluationFlag) Reset() { + *x = EvaluationFlag{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationFlag) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationFlag) ProtoMessage() {} + +func (x *EvaluationFlag) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationFlag.ProtoReflect.Descriptor instead. +func (*EvaluationFlag) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{12} +} + +func (x *EvaluationFlag) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *EvaluationFlag) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EvaluationFlag) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *EvaluationFlag) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *EvaluationFlag) GetType() flipt.FlagType { + if x != nil { + return x.Type + } + return flipt.FlagType(0) +} + +func (x *EvaluationFlag) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *EvaluationFlag) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *EvaluationFlag) GetRules() []*EvaluationRule { + if x != nil { + return x.Rules + } + return nil +} + +func (x *EvaluationFlag) GetRollouts() []*EvaluationRollout { + if x != nil { + return x.Rollouts + } + return nil +} + +type EvaluationConstraint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type flipt.ComparisonType `protobuf:"varint,2,opt,name=type,proto3,enum=flipt.ComparisonType" json:"type,omitempty"` + Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"` + Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *EvaluationConstraint) Reset() { + *x = EvaluationConstraint{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationConstraint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationConstraint) ProtoMessage() {} + +func (x *EvaluationConstraint) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationConstraint.ProtoReflect.Descriptor instead. +func (*EvaluationConstraint) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{13} +} + +func (x *EvaluationConstraint) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationConstraint) GetType() flipt.ComparisonType { + if x != nil { + return x.Type + } + return flipt.ComparisonType(0) +} + +func (x *EvaluationConstraint) GetProperty() string { + if x != nil { + return x.Property + } + return "" +} + +func (x *EvaluationConstraint) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *EvaluationConstraint) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type EvaluationRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,2,rep,name=segments,proto3" json:"segments,omitempty"` + Rank int32 `protobuf:"varint,3,opt,name=rank,proto3" json:"rank,omitempty"` + SegmentOperator flipt.SegmentOperator `protobuf:"varint,4,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` + Distributions []*EvaluationDistribution `protobuf:"bytes,5,rep,name=distributions,proto3" json:"distributions,omitempty"` +} + +func (x *EvaluationRule) Reset() { + *x = EvaluationRule{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationRule) ProtoMessage() {} + +func (x *EvaluationRule) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationRule.ProtoReflect.Descriptor instead. +func (*EvaluationRule) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{14} +} + +func (x *EvaluationRule) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *EvaluationRule) GetSegments() []*EvaluationSegment { + if x != nil { + return x.Segments + } + return nil +} + +func (x *EvaluationRule) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *EvaluationRule) GetSegmentOperator() flipt.SegmentOperator { + if x != nil { + return x.SegmentOperator + } + return flipt.SegmentOperator(0) +} + +func (x *EvaluationRule) GetDistributions() []*EvaluationDistribution { + if x != nil { + return x.Distributions + } + return nil +} + +type EvaluationNamespaceSnapshot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace *flipt.Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Flags []*EvaluationFlag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` +} + +func (x *EvaluationNamespaceSnapshot) Reset() { + *x = EvaluationNamespaceSnapshot{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespaceSnapshot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespaceSnapshot) ProtoMessage() {} + +func (x *EvaluationNamespaceSnapshot) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespaceSnapshot.ProtoReflect.Descriptor instead. +func (*EvaluationNamespaceSnapshot) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{15} +} + +func (x *EvaluationNamespaceSnapshot) GetNamespace() *flipt.Namespace { + if x != nil { + return x.Namespace + } + return nil +} + +func (x *EvaluationNamespaceSnapshot) GetFlags() []*EvaluationFlag { + if x != nil { + return x.Flags + } + return nil +} + +type EvaluationNamespaceSnapshotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *EvaluationNamespaceSnapshotRequest) Reset() { + *x = EvaluationNamespaceSnapshotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespaceSnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespaceSnapshotRequest) ProtoMessage() {} + +func (x *EvaluationNamespaceSnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespaceSnapshotRequest.ProtoReflect.Descriptor instead. +func (*EvaluationNamespaceSnapshotRequest) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{16} +} + +func (x *EvaluationNamespaceSnapshotRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + var File_evaluation_evaluation_proto protoreflect.FileDescriptor var file_evaluation_evaluation_proto_rawDesc = []byte{ @@ -737,165 +1506,304 @@ var file_evaluation_evaluation_proto_rawDesc = []byte{ 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x97, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, - 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, - 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x3a, - 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x78, 0x0a, 0x16, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, - 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, + 0x1a, 0x0b, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x02, + 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, + 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, + 0x4a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x3a, 0x0a, 0x0c, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x78, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, + 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, + 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0xe6, 0x02, 0x0a, 0x12, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x58, 0x0a, + 0x10, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, + 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x76, 0x61, 0x72, 0x69, 0x61, + 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, + 0x52, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x19, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, + 0x79, 0x22, 0x8c, 0x03, 0x0a, 0x19, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, + 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, + 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0xe6, 0x02, 0x0a, 0x12, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x58, 0x0a, 0x10, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, - 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, - 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x76, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x66, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, + 0x22, 0x9a, 0x01, 0x0a, 0x17, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x3f, 0x0a, 0x06, + 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x19, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x06, - 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, - 0x69, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, - 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xca, 0x01, + 0x0a, 0x16, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, + 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, + 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xed, 0x01, 0x0a, 0x11, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, + 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x46, 0x0a, 0x07, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, + 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb4, + 0x01, 0x0a, 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, + 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xcc, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x63, 0x6f, + 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, + 0x69, 0x6e, 0x74, 0x73, 0x22, 0x86, 0x03, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, - 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, - 0x67, 0x4b, 0x65, 0x79, 0x22, 0x8c, 0x03, 0x0a, 0x19, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, - 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, - 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, - 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, - 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, - 0x4b, 0x65, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x17, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, - 0x3f, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x2a, 0x92, 0x01, 0x0a, 0x10, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x19, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, - 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x44, 0x49, 0x53, - 0x41, 0x42, 0x4c, 0x45, 0x44, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x41, 0x54, - 0x43, 0x48, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, - 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, - 0x54, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, - 0x53, 0x4f, 0x4e, 0x10, 0x03, 0x2a, 0x63, 0x0a, 0x15, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x23, - 0x0a, 0x1f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x36, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, + 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, + 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x22, 0x9f, 0x01, + 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, + 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, + 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x88, 0x02, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, + 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0d, 0x64, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1b, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x66, 0x6c, + 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x52, 0x05, 0x66, 0x6c, 0x61, + 0x67, 0x73, 0x22, 0x36, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x2a, 0x92, 0x01, 0x0a, 0x10, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, + 0x1d, 0x0a, 0x19, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x23, + 0x0a, 0x1f, 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, - 0x4e, 0x10, 0x00, 0x12, 0x25, 0x0a, 0x21, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, - 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x01, 0x2a, 0x88, 0x01, 0x0a, 0x16, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x20, 0x56, 0x41, 0x52, 0x49, 0x41, 0x4e, 0x54, - 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, - 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x24, 0x0a, 0x20, 0x42, - 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, - 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, + 0x4e, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x45, 0x56, 0x41, + 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x02, + 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x45, 0x56, 0x41, 0x4c, + 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x03, 0x2a, + 0x63, 0x0a, 0x15, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x1f, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x25, 0x0a, + 0x21, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, + 0x4f, 0x4e, 0x10, 0x01, 0x2a, 0x88, 0x01, 0x0a, 0x16, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x24, 0x0a, 0x20, 0x56, 0x41, 0x52, 0x49, 0x41, 0x4e, 0x54, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x10, 0x02, 0x32, 0xb1, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x07, 0x42, - 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x07, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x05, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x12, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, + 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x24, 0x0a, 0x20, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, + 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, + 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x45, + 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x02, 0x32, + 0xb1, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x07, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, + 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x07, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, + 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x32, 0x92, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x34, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, + 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -911,23 +1819,39 @@ func file_evaluation_evaluation_proto_rawDescGZIP() []byte { } var file_evaluation_evaluation_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_evaluation_evaluation_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_evaluation_evaluation_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_evaluation_evaluation_proto_goTypes = []interface{}{ - (EvaluationReason)(0), // 0: flipt.evaluation.EvaluationReason - (ErrorEvaluationReason)(0), // 1: flipt.evaluation.ErrorEvaluationReason - (EvaluationResponseType)(0), // 2: flipt.evaluation.EvaluationResponseType - (*EvaluationRequest)(nil), // 3: flipt.evaluation.EvaluationRequest - (*BatchEvaluationRequest)(nil), // 4: flipt.evaluation.BatchEvaluationRequest - (*BatchEvaluationResponse)(nil), // 5: flipt.evaluation.BatchEvaluationResponse - (*EvaluationResponse)(nil), // 6: flipt.evaluation.EvaluationResponse - (*BooleanEvaluationResponse)(nil), // 7: flipt.evaluation.BooleanEvaluationResponse - (*VariantEvaluationResponse)(nil), // 8: flipt.evaluation.VariantEvaluationResponse - (*ErrorEvaluationResponse)(nil), // 9: flipt.evaluation.ErrorEvaluationResponse - nil, // 10: flipt.evaluation.EvaluationRequest.ContextEntry - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (EvaluationReason)(0), // 0: flipt.evaluation.EvaluationReason + (ErrorEvaluationReason)(0), // 1: flipt.evaluation.ErrorEvaluationReason + (EvaluationResponseType)(0), // 2: flipt.evaluation.EvaluationResponseType + (*EvaluationRequest)(nil), // 3: flipt.evaluation.EvaluationRequest + (*BatchEvaluationRequest)(nil), // 4: flipt.evaluation.BatchEvaluationRequest + (*BatchEvaluationResponse)(nil), // 5: flipt.evaluation.BatchEvaluationResponse + (*EvaluationResponse)(nil), // 6: flipt.evaluation.EvaluationResponse + (*BooleanEvaluationResponse)(nil), // 7: flipt.evaluation.BooleanEvaluationResponse + (*VariantEvaluationResponse)(nil), // 8: flipt.evaluation.VariantEvaluationResponse + (*ErrorEvaluationResponse)(nil), // 9: flipt.evaluation.ErrorEvaluationResponse + (*EvaluationDistribution)(nil), // 10: flipt.evaluation.EvaluationDistribution + (*EvaluationRollout)(nil), // 11: flipt.evaluation.EvaluationRollout + (*EvaluationRolloutThreshold)(nil), // 12: flipt.evaluation.EvaluationRolloutThreshold + (*EvaluationRolloutSegment)(nil), // 13: flipt.evaluation.EvaluationRolloutSegment + (*EvaluationSegment)(nil), // 14: flipt.evaluation.EvaluationSegment + (*EvaluationFlag)(nil), // 15: flipt.evaluation.EvaluationFlag + (*EvaluationConstraint)(nil), // 16: flipt.evaluation.EvaluationConstraint + (*EvaluationRule)(nil), // 17: flipt.evaluation.EvaluationRule + (*EvaluationNamespaceSnapshot)(nil), // 18: flipt.evaluation.EvaluationNamespaceSnapshot + (*EvaluationNamespaceSnapshotRequest)(nil), // 19: flipt.evaluation.EvaluationNamespaceSnapshotRequest + nil, // 20: flipt.evaluation.EvaluationRequest.ContextEntry + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp + (flipt.RolloutType)(0), // 22: flipt.RolloutType + (flipt.SegmentOperator)(0), // 23: flipt.SegmentOperator + (flipt.MatchType)(0), // 24: flipt.MatchType + (flipt.FlagType)(0), // 25: flipt.FlagType + (flipt.ComparisonType)(0), // 26: flipt.ComparisonType + (*flipt.Namespace)(nil), // 27: flipt.Namespace } var file_evaluation_evaluation_proto_depIdxs = []int32{ - 10, // 0: flipt.evaluation.EvaluationRequest.context:type_name -> flipt.evaluation.EvaluationRequest.ContextEntry + 20, // 0: flipt.evaluation.EvaluationRequest.context:type_name -> flipt.evaluation.EvaluationRequest.ContextEntry 3, // 1: flipt.evaluation.BatchEvaluationRequest.requests:type_name -> flipt.evaluation.EvaluationRequest 6, // 2: flipt.evaluation.BatchEvaluationResponse.responses:type_name -> flipt.evaluation.EvaluationResponse 2, // 3: flipt.evaluation.EvaluationResponse.type:type_name -> flipt.evaluation.EvaluationResponseType @@ -935,21 +1859,43 @@ var file_evaluation_evaluation_proto_depIdxs = []int32{ 8, // 5: flipt.evaluation.EvaluationResponse.variant_response:type_name -> flipt.evaluation.VariantEvaluationResponse 9, // 6: flipt.evaluation.EvaluationResponse.error_response:type_name -> flipt.evaluation.ErrorEvaluationResponse 0, // 7: flipt.evaluation.BooleanEvaluationResponse.reason:type_name -> flipt.evaluation.EvaluationReason - 11, // 8: flipt.evaluation.BooleanEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp + 21, // 8: flipt.evaluation.BooleanEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp 0, // 9: flipt.evaluation.VariantEvaluationResponse.reason:type_name -> flipt.evaluation.EvaluationReason - 11, // 10: flipt.evaluation.VariantEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp + 21, // 10: flipt.evaluation.VariantEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp 1, // 11: flipt.evaluation.ErrorEvaluationResponse.reason:type_name -> flipt.evaluation.ErrorEvaluationReason - 3, // 12: flipt.evaluation.EvaluationService.Boolean:input_type -> flipt.evaluation.EvaluationRequest - 3, // 13: flipt.evaluation.EvaluationService.Variant:input_type -> flipt.evaluation.EvaluationRequest - 4, // 14: flipt.evaluation.EvaluationService.Batch:input_type -> flipt.evaluation.BatchEvaluationRequest - 7, // 15: flipt.evaluation.EvaluationService.Boolean:output_type -> flipt.evaluation.BooleanEvaluationResponse - 8, // 16: flipt.evaluation.EvaluationService.Variant:output_type -> flipt.evaluation.VariantEvaluationResponse - 5, // 17: flipt.evaluation.EvaluationService.Batch:output_type -> flipt.evaluation.BatchEvaluationResponse - 15, // [15:18] is the sub-list for method output_type - 12, // [12:15] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 22, // 12: flipt.evaluation.EvaluationRollout.type:type_name -> flipt.RolloutType + 13, // 13: flipt.evaluation.EvaluationRollout.segment:type_name -> flipt.evaluation.EvaluationRolloutSegment + 12, // 14: flipt.evaluation.EvaluationRollout.threshold:type_name -> flipt.evaluation.EvaluationRolloutThreshold + 23, // 15: flipt.evaluation.EvaluationRolloutSegment.segment_operator:type_name -> flipt.SegmentOperator + 14, // 16: flipt.evaluation.EvaluationRolloutSegment.segments:type_name -> flipt.evaluation.EvaluationSegment + 24, // 17: flipt.evaluation.EvaluationSegment.match_type:type_name -> flipt.MatchType + 21, // 18: flipt.evaluation.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp + 21, // 19: flipt.evaluation.EvaluationSegment.updated_at:type_name -> google.protobuf.Timestamp + 16, // 20: flipt.evaluation.EvaluationSegment.constraints:type_name -> flipt.evaluation.EvaluationConstraint + 25, // 21: flipt.evaluation.EvaluationFlag.type:type_name -> flipt.FlagType + 21, // 22: flipt.evaluation.EvaluationFlag.created_at:type_name -> google.protobuf.Timestamp + 21, // 23: flipt.evaluation.EvaluationFlag.updated_at:type_name -> google.protobuf.Timestamp + 17, // 24: flipt.evaluation.EvaluationFlag.rules:type_name -> flipt.evaluation.EvaluationRule + 11, // 25: flipt.evaluation.EvaluationFlag.rollouts:type_name -> flipt.evaluation.EvaluationRollout + 26, // 26: flipt.evaluation.EvaluationConstraint.type:type_name -> flipt.ComparisonType + 14, // 27: flipt.evaluation.EvaluationRule.segments:type_name -> flipt.evaluation.EvaluationSegment + 23, // 28: flipt.evaluation.EvaluationRule.segment_operator:type_name -> flipt.SegmentOperator + 10, // 29: flipt.evaluation.EvaluationRule.distributions:type_name -> flipt.evaluation.EvaluationDistribution + 27, // 30: flipt.evaluation.EvaluationNamespaceSnapshot.namespace:type_name -> flipt.Namespace + 15, // 31: flipt.evaluation.EvaluationNamespaceSnapshot.flags:type_name -> flipt.evaluation.EvaluationFlag + 3, // 32: flipt.evaluation.EvaluationService.Boolean:input_type -> flipt.evaluation.EvaluationRequest + 3, // 33: flipt.evaluation.EvaluationService.Variant:input_type -> flipt.evaluation.EvaluationRequest + 4, // 34: flipt.evaluation.EvaluationService.Batch:input_type -> flipt.evaluation.BatchEvaluationRequest + 19, // 35: flipt.evaluation.DataService.EvaluationSnapshotNamespace:input_type -> flipt.evaluation.EvaluationNamespaceSnapshotRequest + 7, // 36: flipt.evaluation.EvaluationService.Boolean:output_type -> flipt.evaluation.BooleanEvaluationResponse + 8, // 37: flipt.evaluation.EvaluationService.Variant:output_type -> flipt.evaluation.VariantEvaluationResponse + 5, // 38: flipt.evaluation.EvaluationService.Batch:output_type -> flipt.evaluation.BatchEvaluationResponse + 18, // 39: flipt.evaluation.DataService.EvaluationSnapshotNamespace:output_type -> flipt.evaluation.EvaluationNamespaceSnapshot + 36, // [36:40] is the sub-list for method output_type + 32, // [32:36] is the sub-list for method input_type + 32, // [32:32] is the sub-list for extension type_name + 32, // [32:32] is the sub-list for extension extendee + 0, // [0:32] is the sub-list for field type_name } func init() { file_evaluation_evaluation_proto_init() } @@ -1042,21 +1988,145 @@ func file_evaluation_evaluation_proto_init() { return nil } } + file_evaluation_evaluation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationDistribution); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRollout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRolloutThreshold); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRolloutSegment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationSegment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationFlag); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationConstraint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationRule); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_evaluation_evaluation_proto_msgTypes[3].OneofWrappers = []interface{}{ (*EvaluationResponse_BooleanResponse)(nil), (*EvaluationResponse_VariantResponse)(nil), (*EvaluationResponse_ErrorResponse)(nil), } + file_evaluation_evaluation_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*EvaluationRollout_Segment)(nil), + (*EvaluationRollout_Threshold)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_evaluation_evaluation_proto_rawDesc, NumEnums: 3, - NumMessages: 8, + NumMessages: 18, NumExtensions: 0, - NumServices: 1, + NumServices: 2, }, GoTypes: file_evaluation_evaluation_proto_goTypes, DependencyIndexes: file_evaluation_evaluation_proto_depIdxs, diff --git a/rpc/flipt/evaluation/evaluation.pb.gw.go b/rpc/flipt/evaluation/evaluation.pb.gw.go index 97ed19b3cc..fe26054cf4 100644 --- a/rpc/flipt/evaluation/evaluation.pb.gw.go +++ b/rpc/flipt/evaluation/evaluation.pb.gw.go @@ -133,6 +133,58 @@ func local_request_EvaluationService_Batch_0(ctx context.Context, marshaler runt } +func request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client DataServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EvaluationNamespaceSnapshotRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + msg, err := client.EvaluationSnapshotNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DataService_EvaluationSnapshotNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server DataServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq EvaluationNamespaceSnapshotRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + msg, err := server.EvaluationSnapshotNamespace(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterEvaluationServiceHandlerServer registers the http handlers for service EvaluationService to "mux". // UnaryRPC :call EvaluationServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -217,6 +269,40 @@ func RegisterEvaluationServiceHandlerServer(ctx context.Context, mux *runtime.Se return nil } +// RegisterDataServiceHandlerServer registers the http handlers for service DataService to "mux". +// UnaryRPC :call DataServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataServiceHandlerFromEndpoint instead. +func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error { + + mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/flipt.evaluation.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + // RegisterEvaluationServiceHandlerFromEndpoint is same as RegisterEvaluationServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterEvaluationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { @@ -339,3 +425,74 @@ var ( forward_EvaluationService_Batch_0 = runtime.ForwardResponseMessage ) + +// RegisterDataServiceHandlerFromEndpoint is same as RegisterDataServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterDataServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterDataServiceHandler(ctx, mux, conn) +} + +// RegisterDataServiceHandler registers the http handlers for service DataService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterDataServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterDataServiceHandlerClient(ctx, mux, NewDataServiceClient(conn)) +} + +// RegisterDataServiceHandlerClient registers the http handlers for service DataService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DataServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DataServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "DataServiceClient" to call the correct interceptors. +func RegisterDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataServiceClient) error { + + mux.Handle("GET", pattern_DataService_EvaluationSnapshotNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/flipt.evaluation.DataService/EvaluationSnapshotNamespace", runtime.WithHTTPPathPattern("/internal/v1/evaluation/snapshot/namespace/{key}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DataService_EvaluationSnapshotNamespace_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataService_EvaluationSnapshotNamespace_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_DataService_EvaluationSnapshotNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"internal", "v1", "evaluation", "snapshot", "namespace", "key"}, "")) +) + +var ( + forward_DataService_EvaluationSnapshotNamespace_0 = runtime.ForwardResponseMessage +) diff --git a/rpc/flipt/evaluation/evaluation.proto b/rpc/flipt/evaluation/evaluation.proto index bb72d10196..df97420fe2 100644 --- a/rpc/flipt/evaluation/evaluation.proto +++ b/rpc/flipt/evaluation/evaluation.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package flipt.evaluation; import "google/protobuf/timestamp.proto"; +import "flipt.proto"; option go_package = "go.flipt.io/flipt/rpc/flipt/evaluation"; @@ -84,3 +85,83 @@ service EvaluationService { rpc Variant(EvaluationRequest) returns (VariantEvaluationResponse) {} rpc Batch(BatchEvaluationRequest) returns (BatchEvaluationResponse) {} } + +message EvaluationDistribution { + string id = 1; + string rule_id = 2; + string variant_id = 3; + string variant_key = 4; + string variant_attachment = 5; + float rollout = 6; +} + +message EvaluationRollout { + flipt.RolloutType type = 1; + int32 rank = 2; + oneof rule { + EvaluationRolloutSegment segment = 3; + EvaluationRolloutThreshold threshold = 4; + } +} + +message EvaluationRolloutThreshold { + float percentage = 1; + bool value = 2; +} + +message EvaluationRolloutSegment { + bool value = 1; + flipt.SegmentOperator segment_operator = 2; + repeated EvaluationSegment segments = 3; +} + +message EvaluationSegment { + string key = 1; + string name = 2; + string description = 3; + flipt.MatchType match_type = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + repeated EvaluationConstraint constraints = 7; +} + +message EvaluationFlag { + string key = 1; + string name = 2; + string description = 3; + bool enabled = 4; + flipt.FlagType type = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; + repeated EvaluationRule rules = 8; + repeated EvaluationRollout rollouts = 9; +} + +message EvaluationConstraint { + string id = 1; + flipt.ComparisonType type = 2; + string property = 3; + string operator = 4; + string value = 5; +} + +message EvaluationRule { + string id = 1; + repeated EvaluationSegment segments = 2; + int32 rank = 3; + flipt.SegmentOperator segment_operator = 4; + repeated EvaluationDistribution distributions = 5; +} + +message EvaluationNamespaceSnapshot { + flipt.Namespace namespace = 1; + repeated EvaluationFlag flags = 2; +} + +message EvaluationNamespaceSnapshotRequest { + string key = 1; +} + +service DataService { + rpc EvaluationSnapshotNamespace(EvaluationNamespaceSnapshotRequest) returns (EvaluationNamespaceSnapshot); +} diff --git a/rpc/flipt/evaluation/evaluation_grpc.pb.go b/rpc/flipt/evaluation/evaluation_grpc.pb.go index 2aff45684e..537d680e50 100644 --- a/rpc/flipt/evaluation/evaluation_grpc.pb.go +++ b/rpc/flipt/evaluation/evaluation_grpc.pb.go @@ -181,3 +181,93 @@ var EvaluationService_ServiceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "evaluation/evaluation.proto", } + +const ( + DataService_EvaluationSnapshotNamespace_FullMethodName = "/flipt.evaluation.DataService/EvaluationSnapshotNamespace" +) + +// DataServiceClient is the client API for DataService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DataServiceClient interface { + EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) +} + +type dataServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient { + return &dataServiceClient{cc} +} + +func (c *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, in *EvaluationNamespaceSnapshotRequest, opts ...grpc.CallOption) (*EvaluationNamespaceSnapshot, error) { + out := new(EvaluationNamespaceSnapshot) + err := c.cc.Invoke(ctx, DataService_EvaluationSnapshotNamespace_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DataServiceServer is the server API for DataService service. +// All implementations must embed UnimplementedDataServiceServer +// for forward compatibility +type DataServiceServer interface { + EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) + mustEmbedUnimplementedDataServiceServer() +} + +// UnimplementedDataServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDataServiceServer struct { +} + +func (UnimplementedDataServiceServer) EvaluationSnapshotNamespace(context.Context, *EvaluationNamespaceSnapshotRequest) (*EvaluationNamespaceSnapshot, error) { + return nil, status.Errorf(codes.Unimplemented, "method EvaluationSnapshotNamespace not implemented") +} +func (UnimplementedDataServiceServer) mustEmbedUnimplementedDataServiceServer() {} + +// UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DataServiceServer will +// result in compilation errors. +type UnsafeDataServiceServer interface { + mustEmbedUnimplementedDataServiceServer() +} + +func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer) { + s.RegisterService(&DataService_ServiceDesc, srv) +} + +func _DataService_EvaluationSnapshotNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EvaluationNamespaceSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DataService_EvaluationSnapshotNamespace_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataServiceServer).EvaluationSnapshotNamespace(ctx, req.(*EvaluationNamespaceSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// DataService_ServiceDesc is the grpc.ServiceDesc for DataService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DataService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipt.evaluation.DataService", + HandlerType: (*DataServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EvaluationSnapshotNamespace", + Handler: _DataService_EvaluationSnapshotNamespace_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "evaluation/evaluation.proto", +} diff --git a/rpc/flipt/flipt.yaml b/rpc/flipt/flipt.yaml index ebad8489a0..8535049bab 100644 --- a/rpc/flipt/flipt.yaml +++ b/rpc/flipt/flipt.yaml @@ -313,5 +313,5 @@ http: get: /auth/v1/method/github/callback # internal routes - - selector: flipt.data.DataService.EvaluationSnapshotNamespace - get: /internal/v1/evaluation/snapshot/namespace/{key} \ No newline at end of file + - selector: flipt.evaluation.DataService.EvaluationSnapshotNamespace + get: /internal/v1/evaluation/snapshot/namespace/{key} diff --git a/sdk/go/evaluation.sdk.gen.go b/sdk/go/evaluation.sdk.gen.go index 2a1c894f75..ed57289df5 100644 --- a/sdk/go/evaluation.sdk.gen.go +++ b/sdk/go/evaluation.sdk.gen.go @@ -7,12 +7,28 @@ import ( evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" ) +type EvaluationClient interface { + EvaluationServiceClient() evaluation.EvaluationServiceClient + DataServiceClient() evaluation.DataServiceClient +} + type Evaluation struct { + transport EvaluationClient + tokenProvider ClientTokenProvider +} + +type EvaluationService struct { transport evaluation.EvaluationServiceClient tokenProvider ClientTokenProvider } -func (x *Evaluation) Boolean(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.BooleanEvaluationResponse, error) { +func (s Evaluation) EvaluationService() *EvaluationService { + return &EvaluationService{ + transport: s.transport.EvaluationServiceClient(), + tokenProvider: s.tokenProvider, + } +} +func (x *EvaluationService) Boolean(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.BooleanEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err @@ -20,7 +36,7 @@ func (x *Evaluation) Boolean(ctx context.Context, v *evaluation.EvaluationReques return x.transport.Boolean(ctx, v) } -func (x *Evaluation) Variant(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.VariantEvaluationResponse, error) { +func (x *EvaluationService) Variant(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.VariantEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err @@ -28,10 +44,29 @@ func (x *Evaluation) Variant(ctx context.Context, v *evaluation.EvaluationReques return x.transport.Variant(ctx, v) } -func (x *Evaluation) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest) (*evaluation.BatchEvaluationResponse, error) { +func (x *EvaluationService) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest) (*evaluation.BatchEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err } return x.transport.Batch(ctx, v) } + +type DataService struct { + transport evaluation.DataServiceClient + tokenProvider ClientTokenProvider +} + +func (s Evaluation) DataService() *DataService { + return &DataService{ + transport: s.transport.DataServiceClient(), + tokenProvider: s.tokenProvider, + } +} +func (x *DataService) EvaluationSnapshotNamespace(ctx context.Context, v *evaluation.EvaluationNamespaceSnapshotRequest) (*evaluation.EvaluationNamespaceSnapshot, error) { + ctx, err := authenticate(ctx, x.tokenProvider) + if err != nil { + return nil, err + } + return x.transport.EvaluationSnapshotNamespace(ctx, v) +} diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index 757b836741..b1387c99a0 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -5,7 +5,6 @@ package grpc import ( flipt "go.flipt.io/flipt/rpc/flipt" auth "go.flipt.io/flipt/rpc/flipt/auth" - data "go.flipt.io/flipt/rpc/flipt/data" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" _go "go.flipt.io/flipt/sdk/go" @@ -58,14 +57,22 @@ func (t Transport) FliptClient() flipt.FliptClient { return flipt.NewFliptClient(t.cc) } -func (t Transport) DataClient() data.DataServiceClient { - return data.NewDataServiceClient(t.cc) +type evaluationClient struct { + cc grpc.ClientConnInterface } -func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { +func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationServiceClient { return evaluation.NewEvaluationServiceClient(t.cc) } +func (t evaluationClient) DataServiceClient() evaluation.DataServiceClient { + return evaluation.NewDataServiceClient(t.cc) +} + +func (t Transport) EvaluationClient() _go.EvaluationClient { + return evaluationClient{cc: t.cc} +} + func (t Transport) MetaClient() meta.MetadataServiceClient { return meta.NewMetadataServiceClient(t.cc) } diff --git a/sdk/go/http/evaluation.sdk.gen.go b/sdk/go/http/evaluation.sdk.gen.go index ac6c812053..1a4bfb1da4 100644 --- a/sdk/go/http/evaluation.sdk.gen.go +++ b/sdk/go/http/evaluation.sdk.gen.go @@ -5,7 +5,9 @@ package http import ( bytes "bytes" context "context" + fmt "fmt" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" + _go "go.flipt.io/flipt/sdk/go" grpc "google.golang.org/grpc" protojson "google.golang.org/protobuf/encoding/protojson" io "io" @@ -13,12 +15,21 @@ import ( url "net/url" ) -type EvaluationServiceClient struct { +type evaluationClient struct { client *http.Client addr string } -func (x *EvaluationServiceClient) Boolean(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.BooleanEvaluationResponse, error) { +func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationServiceClient { + return &evaluationServiceClient{client: t.client, addr: t.addr} +} + +type evaluationServiceClient struct { + client *http.Client + addr string +} + +func (x *evaluationServiceClient) Boolean(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.BooleanEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -50,7 +61,7 @@ func (x *EvaluationServiceClient) Boolean(ctx context.Context, v *evaluation.Eva return &output, nil } -func (x *EvaluationServiceClient) Variant(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.VariantEvaluationResponse, error) { +func (x *evaluationServiceClient) Variant(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.VariantEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -82,7 +93,7 @@ func (x *EvaluationServiceClient) Variant(ctx context.Context, v *evaluation.Eva return &output, nil } -func (x *EvaluationServiceClient) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest, _ ...grpc.CallOption) (*evaluation.BatchEvaluationResponse, error) { +func (x *evaluationServiceClient) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest, _ ...grpc.CallOption) (*evaluation.BatchEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -114,6 +125,42 @@ func (x *EvaluationServiceClient) Batch(ctx context.Context, v *evaluation.Batch return &output, nil } -func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { - return &EvaluationServiceClient{client: t.client, addr: t.addr} +func (t evaluationClient) DataServiceClient() evaluation.DataServiceClient { + return &dataServiceClient{client: t.client, addr: t.addr} +} + +type dataServiceClient struct { + client *http.Client + addr string +} + +func (x *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, v *evaluation.EvaluationNamespaceSnapshotRequest, _ ...grpc.CallOption) (*evaluation.EvaluationNamespaceSnapshot, error) { + var body io.Reader + var values url.Values + req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/internal/v1/evaluation/snapshot/namespace/%v", v.Key), body) + if err != nil { + return nil, err + } + req.URL.RawQuery = values.Encode() + resp, err := x.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + var output evaluation.EvaluationNamespaceSnapshot + respData, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + if err := checkResponse(resp, respData); err != nil { + return nil, err + } + if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(respData, &output); err != nil { + return nil, err + } + return &output, nil +} + +func (t Transport) EvaluationClient() _go.EvaluationClient { + return evaluationClient{client: t.client, addr: t.addr} } diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index 3cc61abba0..a50383b193 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -5,8 +5,6 @@ package sdk import ( context "context" flipt "go.flipt.io/flipt/rpc/flipt" - data "go.flipt.io/flipt/rpc/flipt/data" - evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" metadata "google.golang.org/grpc/metadata" ) @@ -14,8 +12,7 @@ import ( type Transport interface { AuthClient() AuthClient FliptClient() flipt.FliptClient - DataClient() data.DataServiceClient - EvaluationClient() evaluation.EvaluationServiceClient + EvaluationClient() EvaluationClient MetaClient() meta.MetadataServiceClient } @@ -82,13 +79,6 @@ func (s SDK) Flipt() *Flipt { } } -func (s SDK) Data() *Data { - return &Data{ - transport: s.transport.DataClient(), - tokenProvider: s.tokenProvider, - } -} - func (s SDK) Evaluation() *Evaluation { return &Evaluation{ transport: s.transport.EvaluationClient(), From 7baf9086956b712f9753a43ae120eb3a7f375c15 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:47:28 -0400 Subject: [PATCH 19/39] chore: fix build --- sdk/go/data.sdk.gen.go | 21 ---------------- sdk/go/http/data.sdk.gen.go | 50 ------------------------------------- 2 files changed, 71 deletions(-) delete mode 100644 sdk/go/data.sdk.gen.go delete mode 100644 sdk/go/http/data.sdk.gen.go diff --git a/sdk/go/data.sdk.gen.go b/sdk/go/data.sdk.gen.go deleted file mode 100644 index 81c68d3966..0000000000 --- a/sdk/go/data.sdk.gen.go +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by protoc-gen-go-flipt-sdk. DO NOT EDIT. - -package sdk - -import ( - context "context" - data "go.flipt.io/flipt/rpc/flipt/data" -) - -type Data struct { - transport data.DataServiceClient - tokenProvider ClientTokenProvider -} - -func (x *Data) EvaluationSnapshotNamespace(ctx context.Context, v *data.EvaluationNamespaceSnapshotRequest) (*data.EvaluationNamespaceSnapshot, error) { - ctx, err := authenticate(ctx, x.tokenProvider) - if err != nil { - return nil, err - } - return x.transport.EvaluationSnapshotNamespace(ctx, v) -} diff --git a/sdk/go/http/data.sdk.gen.go b/sdk/go/http/data.sdk.gen.go deleted file mode 100644 index 57efda9d31..0000000000 --- a/sdk/go/http/data.sdk.gen.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by protoc-gen-go-flipt-sdk. DO NOT EDIT. - -package http - -import ( - context "context" - fmt "fmt" - data "go.flipt.io/flipt/rpc/flipt/data" - grpc "google.golang.org/grpc" - protojson "google.golang.org/protobuf/encoding/protojson" - io "io" - http "net/http" - url "net/url" -) - -type DataServiceClient struct { - client *http.Client - addr string -} - -func (x *DataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, v *data.EvaluationNamespaceSnapshotRequest, _ ...grpc.CallOption) (*data.EvaluationNamespaceSnapshot, error) { - var body io.Reader - var values url.Values - req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/internal/v1/evaluation/snapshot/namespace/%v", v.Key), body) - if err != nil { - return nil, err - } - req.URL.RawQuery = values.Encode() - resp, err := x.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - var output data.EvaluationNamespaceSnapshot - respData, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - if err := checkResponse(resp, respData); err != nil { - return nil, err - } - if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(respData, &output); err != nil { - return nil, err - } - return &output, nil -} - -func (t Transport) DataClient() data.DataServiceClient { - return &DataServiceClient{client: t.client, addr: t.addr} -} From a2390a3ace9f15aed817a4dd8556187f95deff53 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:19:00 -0400 Subject: [PATCH 20/39] chore: add ability to skip generating sdks --- internal/cmd/protoc-gen-go-flipt-sdk/grpc.go | 15 ++++++++ internal/cmd/protoc-gen-go-flipt-sdk/http.go | 14 ++++++++ internal/cmd/protoc-gen-go-flipt-sdk/main.go | 10 ++++++ rpc/flipt/evaluation/evaluation.proto | 1 + sdk/go/evaluation.sdk.gen.go | 19 ---------- sdk/go/grpc/grpc.sdk.gen.go | 4 --- sdk/go/http/evaluation.sdk.gen.go | 37 -------------------- 7 files changed, 40 insertions(+), 60 deletions(-) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go index 63bd613487..f3fe0fb46f 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go @@ -36,6 +36,14 @@ func generateGRPC(gen *protogen.Plugin) { ) if len(file.Services) < 2 { + srv := file.Services[0] + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + returnType := file.Services[0].GoName + "Client" g.P("func (t Transport) ", method, "() ", relativeImport(g, file, returnType), "{") g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)") @@ -52,6 +60,13 @@ func generateGRPC(gen *protogen.Plugin) { g.P("}\n") for _, srv := range file.Services { + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + returnType := srv.GoName + "Client" g.P("func (t ", groupType, ") ", returnType, "() ", relativeImport(g, file, returnType), " {") g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)") diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/http.go b/internal/cmd/protoc-gen-go-flipt-sdk/http.go index a15656dae6..5ee1f5d930 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/http.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/http.go @@ -141,6 +141,13 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { if len(file.Services) < 2 { srv := file.Services[0] + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + returnType := srv.GoName + "Client" g.P("type ", returnType, " struct {") @@ -168,6 +175,13 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { g.P("}\n") for _, srv := range file.Services { + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + var ( returnType = srv.GoName + "Client" unexportedReturnType = unexport(returnType) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/main.go b/internal/cmd/protoc-gen-go-flipt-sdk/main.go index dfb7e663c4..9a78c5fcc6 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/main.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/main.go @@ -13,6 +13,8 @@ import ( const ( importPath = "go.flipt.io/flipt/sdk/go" emptyImport = "google.golang.org/protobuf/types/known/emptypb" + + ignoreDecl = "flipt:sdk:ignore" ) func main() { @@ -30,6 +32,7 @@ func main() { // warning. gen.SupportedFeatures |= uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) for _, f := range gen.Files { + if !f.Generate { continue } @@ -129,6 +132,13 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri } for _, srv := range file.Services { + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + if strings.TrimSpace(leading) == ignoreDecl { + continue + } + } + serviceName := srv.GoName if oneServicePackage { serviceName = typ diff --git a/rpc/flipt/evaluation/evaluation.proto b/rpc/flipt/evaluation/evaluation.proto index df97420fe2..8b5b2c7599 100644 --- a/rpc/flipt/evaluation/evaluation.proto +++ b/rpc/flipt/evaluation/evaluation.proto @@ -162,6 +162,7 @@ message EvaluationNamespaceSnapshotRequest { string key = 1; } +// flipt:sdk:ignore service DataService { rpc EvaluationSnapshotNamespace(EvaluationNamespaceSnapshotRequest) returns (EvaluationNamespaceSnapshot); } diff --git a/sdk/go/evaluation.sdk.gen.go b/sdk/go/evaluation.sdk.gen.go index ed57289df5..0dac688afd 100644 --- a/sdk/go/evaluation.sdk.gen.go +++ b/sdk/go/evaluation.sdk.gen.go @@ -51,22 +51,3 @@ func (x *EvaluationService) Batch(ctx context.Context, v *evaluation.BatchEvalua } return x.transport.Batch(ctx, v) } - -type DataService struct { - transport evaluation.DataServiceClient - tokenProvider ClientTokenProvider -} - -func (s Evaluation) DataService() *DataService { - return &DataService{ - transport: s.transport.DataServiceClient(), - tokenProvider: s.tokenProvider, - } -} -func (x *DataService) EvaluationSnapshotNamespace(ctx context.Context, v *evaluation.EvaluationNamespaceSnapshotRequest) (*evaluation.EvaluationNamespaceSnapshot, error) { - ctx, err := authenticate(ctx, x.tokenProvider) - if err != nil { - return nil, err - } - return x.transport.EvaluationSnapshotNamespace(ctx, v) -} diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index b1387c99a0..1cefb6f63e 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -65,10 +65,6 @@ func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationService return evaluation.NewEvaluationServiceClient(t.cc) } -func (t evaluationClient) DataServiceClient() evaluation.DataServiceClient { - return evaluation.NewDataServiceClient(t.cc) -} - func (t Transport) EvaluationClient() _go.EvaluationClient { return evaluationClient{cc: t.cc} } diff --git a/sdk/go/http/evaluation.sdk.gen.go b/sdk/go/http/evaluation.sdk.gen.go index 1a4bfb1da4..ed9dbadee7 100644 --- a/sdk/go/http/evaluation.sdk.gen.go +++ b/sdk/go/http/evaluation.sdk.gen.go @@ -5,7 +5,6 @@ package http import ( bytes "bytes" context "context" - fmt "fmt" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" _go "go.flipt.io/flipt/sdk/go" grpc "google.golang.org/grpc" @@ -125,42 +124,6 @@ func (x *evaluationServiceClient) Batch(ctx context.Context, v *evaluation.Batch return &output, nil } -func (t evaluationClient) DataServiceClient() evaluation.DataServiceClient { - return &dataServiceClient{client: t.client, addr: t.addr} -} - -type dataServiceClient struct { - client *http.Client - addr string -} - -func (x *dataServiceClient) EvaluationSnapshotNamespace(ctx context.Context, v *evaluation.EvaluationNamespaceSnapshotRequest, _ ...grpc.CallOption) (*evaluation.EvaluationNamespaceSnapshot, error) { - var body io.Reader - var values url.Values - req, err := http.NewRequestWithContext(ctx, http.MethodGet, x.addr+fmt.Sprintf("/internal/v1/evaluation/snapshot/namespace/%v", v.Key), body) - if err != nil { - return nil, err - } - req.URL.RawQuery = values.Encode() - resp, err := x.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - var output evaluation.EvaluationNamespaceSnapshot - respData, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - if err := checkResponse(resp, respData); err != nil { - return nil, err - } - if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(respData, &output); err != nil { - return nil, err - } - return &output, nil -} - func (t Transport) EvaluationClient() _go.EvaluationClient { return evaluationClient{client: t.client, addr: t.addr} } From 720accd4c22523db33f2268e0061766d26ebe2de Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:31:58 -0400 Subject: [PATCH 21/39] chore: dont generate interface method --- internal/cmd/protoc-gen-go-flipt-sdk/grpc.go | 14 ++++---------- internal/cmd/protoc-gen-go-flipt-sdk/http.go | 14 ++++---------- internal/cmd/protoc-gen-go-flipt-sdk/main.go | 19 ++++++++++++++----- sdk/go/evaluation.sdk.gen.go | 1 - 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go index f3fe0fb46f..f3878c2efa 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go @@ -37,11 +37,8 @@ func generateGRPC(gen *protogen.Plugin) { if len(file.Services) < 2 { srv := file.Services[0] - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } returnType := file.Services[0].GoName + "Client" @@ -60,11 +57,8 @@ func generateGRPC(gen *protogen.Plugin) { g.P("}\n") for _, srv := range file.Services { - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } returnType := srv.GoName + "Client" diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/http.go b/internal/cmd/protoc-gen-go-flipt-sdk/http.go index 5ee1f5d930..e2c310c8eb 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/http.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/http.go @@ -141,11 +141,8 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { if len(file.Services) < 2 { srv := file.Services[0] - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } returnType := srv.GoName + "Client" @@ -175,11 +172,8 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { g.P("}\n") for _, srv := range file.Services { - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } var ( diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/main.go b/internal/cmd/protoc-gen-go-flipt-sdk/main.go index 9a78c5fcc6..8c7b9dfcd0 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/main.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/main.go @@ -121,6 +121,10 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri g.P("type ", typ, "Client interface {") for _, srv := range file.Services { + if shouldIgnoreService(srv) { + continue + } + g.P(srv.GoName+"Client", "()", relativeImport(g, file, srv.GoName+"Client")) } g.P("}\n") @@ -132,11 +136,8 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri } for _, srv := range file.Services { - if srv.Comments.Leading != "" { - leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") - if strings.TrimSpace(leading) == ignoreDecl { - continue - } + if shouldIgnoreService(srv) { + continue } serviceName := srv.GoName @@ -271,3 +272,11 @@ func New(t Transport, opts ...Option) SDK { return sdk }` + +func shouldIgnoreService(srv *protogen.Service) bool { + if srv.Comments.Leading != "" { + leading := strings.TrimPrefix(string(srv.Comments.Leading), "//") + return strings.TrimSpace(leading) == ignoreDecl + } + return false +} diff --git a/sdk/go/evaluation.sdk.gen.go b/sdk/go/evaluation.sdk.gen.go index 0dac688afd..208f23986c 100644 --- a/sdk/go/evaluation.sdk.gen.go +++ b/sdk/go/evaluation.sdk.gen.go @@ -9,7 +9,6 @@ import ( type EvaluationClient interface { EvaluationServiceClient() evaluation.EvaluationServiceClient - DataServiceClient() evaluation.DataServiceClient } type Evaluation struct { From 672c02e537b4baa8b28a33eb653e35e47c27901f Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:25:23 -0400 Subject: [PATCH 22/39] chore: fix build --- internal/cmd/protoc-gen-go-flipt-sdk/grpc.go | 9 -------- internal/cmd/protoc-gen-go-flipt-sdk/http.go | 8 ------- internal/cmd/protoc-gen-go-flipt-sdk/main.go | 12 +++-------- sdk/go/evaluation.sdk.gen.go | 21 +++---------------- sdk/go/grpc/grpc.sdk.gen.go | 10 +-------- sdk/go/http/evaluation.sdk.gen.go | 22 ++++++-------------- sdk/go/sdk.gen.go | 3 ++- 7 files changed, 15 insertions(+), 70 deletions(-) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go index f3878c2efa..63bd613487 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/grpc.go @@ -36,11 +36,6 @@ func generateGRPC(gen *protogen.Plugin) { ) if len(file.Services) < 2 { - srv := file.Services[0] - if shouldIgnoreService(srv) { - continue - } - returnType := file.Services[0].GoName + "Client" g.P("func (t Transport) ", method, "() ", relativeImport(g, file, returnType), "{") g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)") @@ -57,10 +52,6 @@ func generateGRPC(gen *protogen.Plugin) { g.P("}\n") for _, srv := range file.Services { - if shouldIgnoreService(srv) { - continue - } - returnType := srv.GoName + "Client" g.P("func (t ", groupType, ") ", returnType, "() ", relativeImport(g, file, returnType), " {") g.P("return ", relativeImport(g, file, "New"+returnType), "(t.cc)") diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/http.go b/internal/cmd/protoc-gen-go-flipt-sdk/http.go index e2c310c8eb..a15656dae6 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/http.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/http.go @@ -141,10 +141,6 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { if len(file.Services) < 2 { srv := file.Services[0] - if shouldIgnoreService(srv) { - continue - } - returnType := srv.GoName + "Client" g.P("type ", returnType, " struct {") @@ -172,10 +168,6 @@ func generateHTTP(gen *protogen.Plugin, grpcAPIConfig string) { g.P("}\n") for _, srv := range file.Services { - if shouldIgnoreService(srv) { - continue - } - var ( returnType = srv.GoName + "Client" unexportedReturnType = unexport(returnType) diff --git a/internal/cmd/protoc-gen-go-flipt-sdk/main.go b/internal/cmd/protoc-gen-go-flipt-sdk/main.go index 8c7b9dfcd0..2f8a468135 100644 --- a/internal/cmd/protoc-gen-go-flipt-sdk/main.go +++ b/internal/cmd/protoc-gen-go-flipt-sdk/main.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" "os" + "slices" "strings" "google.golang.org/protobuf/compiler/protogen" @@ -32,11 +33,12 @@ func main() { // warning. gen.SupportedFeatures |= uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) for _, f := range gen.Files { - if !f.Generate { continue } + f.Services = slices.DeleteFunc(f.Services, shouldIgnoreService) + generateSubSDK(gen, f) } @@ -121,10 +123,6 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri g.P("type ", typ, "Client interface {") for _, srv := range file.Services { - if shouldIgnoreService(srv) { - continue - } - g.P(srv.GoName+"Client", "()", relativeImport(g, file, srv.GoName+"Client")) } g.P("}\n") @@ -136,10 +134,6 @@ func generateSubSDK(gen *protogen.Plugin, file *protogen.File) (typ, client stri } for _, srv := range file.Services { - if shouldIgnoreService(srv) { - continue - } - serviceName := srv.GoName if oneServicePackage { serviceName = typ diff --git a/sdk/go/evaluation.sdk.gen.go b/sdk/go/evaluation.sdk.gen.go index 208f23986c..2a1c894f75 100644 --- a/sdk/go/evaluation.sdk.gen.go +++ b/sdk/go/evaluation.sdk.gen.go @@ -7,27 +7,12 @@ import ( evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" ) -type EvaluationClient interface { - EvaluationServiceClient() evaluation.EvaluationServiceClient -} - type Evaluation struct { - transport EvaluationClient - tokenProvider ClientTokenProvider -} - -type EvaluationService struct { transport evaluation.EvaluationServiceClient tokenProvider ClientTokenProvider } -func (s Evaluation) EvaluationService() *EvaluationService { - return &EvaluationService{ - transport: s.transport.EvaluationServiceClient(), - tokenProvider: s.tokenProvider, - } -} -func (x *EvaluationService) Boolean(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.BooleanEvaluationResponse, error) { +func (x *Evaluation) Boolean(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.BooleanEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err @@ -35,7 +20,7 @@ func (x *EvaluationService) Boolean(ctx context.Context, v *evaluation.Evaluatio return x.transport.Boolean(ctx, v) } -func (x *EvaluationService) Variant(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.VariantEvaluationResponse, error) { +func (x *Evaluation) Variant(ctx context.Context, v *evaluation.EvaluationRequest) (*evaluation.VariantEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err @@ -43,7 +28,7 @@ func (x *EvaluationService) Variant(ctx context.Context, v *evaluation.Evaluatio return x.transport.Variant(ctx, v) } -func (x *EvaluationService) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest) (*evaluation.BatchEvaluationResponse, error) { +func (x *Evaluation) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest) (*evaluation.BatchEvaluationResponse, error) { ctx, err := authenticate(ctx, x.tokenProvider) if err != nil { return nil, err diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index 1cefb6f63e..d586e1138d 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -57,18 +57,10 @@ func (t Transport) FliptClient() flipt.FliptClient { return flipt.NewFliptClient(t.cc) } -type evaluationClient struct { - cc grpc.ClientConnInterface -} - -func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationServiceClient { +func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { return evaluation.NewEvaluationServiceClient(t.cc) } -func (t Transport) EvaluationClient() _go.EvaluationClient { - return evaluationClient{cc: t.cc} -} - func (t Transport) MetaClient() meta.MetadataServiceClient { return meta.NewMetadataServiceClient(t.cc) } diff --git a/sdk/go/http/evaluation.sdk.gen.go b/sdk/go/http/evaluation.sdk.gen.go index ed9dbadee7..ac6c812053 100644 --- a/sdk/go/http/evaluation.sdk.gen.go +++ b/sdk/go/http/evaluation.sdk.gen.go @@ -6,7 +6,6 @@ import ( bytes "bytes" context "context" evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" - _go "go.flipt.io/flipt/sdk/go" grpc "google.golang.org/grpc" protojson "google.golang.org/protobuf/encoding/protojson" io "io" @@ -14,21 +13,12 @@ import ( url "net/url" ) -type evaluationClient struct { +type EvaluationServiceClient struct { client *http.Client addr string } -func (t evaluationClient) EvaluationServiceClient() evaluation.EvaluationServiceClient { - return &evaluationServiceClient{client: t.client, addr: t.addr} -} - -type evaluationServiceClient struct { - client *http.Client - addr string -} - -func (x *evaluationServiceClient) Boolean(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.BooleanEvaluationResponse, error) { +func (x *EvaluationServiceClient) Boolean(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.BooleanEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -60,7 +50,7 @@ func (x *evaluationServiceClient) Boolean(ctx context.Context, v *evaluation.Eva return &output, nil } -func (x *evaluationServiceClient) Variant(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.VariantEvaluationResponse, error) { +func (x *EvaluationServiceClient) Variant(ctx context.Context, v *evaluation.EvaluationRequest, _ ...grpc.CallOption) (*evaluation.VariantEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -92,7 +82,7 @@ func (x *evaluationServiceClient) Variant(ctx context.Context, v *evaluation.Eva return &output, nil } -func (x *evaluationServiceClient) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest, _ ...grpc.CallOption) (*evaluation.BatchEvaluationResponse, error) { +func (x *EvaluationServiceClient) Batch(ctx context.Context, v *evaluation.BatchEvaluationRequest, _ ...grpc.CallOption) (*evaluation.BatchEvaluationResponse, error) { var body io.Reader var values url.Values reqData, err := protojson.Marshal(v) @@ -124,6 +114,6 @@ func (x *evaluationServiceClient) Batch(ctx context.Context, v *evaluation.Batch return &output, nil } -func (t Transport) EvaluationClient() _go.EvaluationClient { - return evaluationClient{client: t.client, addr: t.addr} +func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { + return &EvaluationServiceClient{client: t.client, addr: t.addr} } diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index a50383b193..ac80f31de7 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -5,6 +5,7 @@ package sdk import ( context "context" flipt "go.flipt.io/flipt/rpc/flipt" + evaluation "go.flipt.io/flipt/rpc/flipt/evaluation" meta "go.flipt.io/flipt/rpc/flipt/meta" metadata "google.golang.org/grpc/metadata" ) @@ -12,7 +13,7 @@ import ( type Transport interface { AuthClient() AuthClient FliptClient() flipt.FliptClient - EvaluationClient() EvaluationClient + EvaluationClient() evaluation.EvaluationServiceClient MetaClient() meta.MetadataServiceClient } From f1767189cc8ab80c79fc17735fbe0ef016a65cd2 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:46:15 -0500 Subject: [PATCH 23/39] chore(wip): fixing tests --- internal/storage/fs/snapshot.go | 16 ++++++++++------ internal/storage/fs/snapshot_test.go | 21 +++++++++++++++++++-- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/internal/storage/fs/snapshot.go b/internal/storage/fs/snapshot.go index ce1e20056b..7133fc49fe 100644 --- a/internal/storage/fs/snapshot.go +++ b/internal/storage/fs/snapshot.go @@ -133,8 +133,10 @@ func SnapshotFromFiles(files ...fs.File) (*StoreSnapshot, error) { return err } - buf := &bytes.Buffer{} - reader := io.TeeReader(fi, buf) + var ( + buf = &bytes.Buffer{} + reader = io.TeeReader(fi, buf) + ) if err := validator.Validate(stat.Name(), reader); err != nil { return err @@ -358,7 +360,7 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { var ( segmentKeys = []string{} - segments = []*storage.EvaluationSegment{} + segments = map[string]*storage.EvaluationSegment{} ) if rule.SegmentKey != "" { @@ -383,18 +385,20 @@ func (ss *StoreSnapshot) addDoc(doc *ext.Document) error { }) } - segments = append(segments, &storage.EvaluationSegment{ + segments[segmentKey] = &storage.EvaluationSegment{ Key: segmentKey, MatchType: segment.MatchType, Constraints: evc, - }) + } } if rule.SegmentOperator == flipt.SegmentOperator_AND_SEGMENT_OPERATOR { evalRule.SegmentOperator = flipt.SegmentOperator_AND_SEGMENT_OPERATOR } - evalRule.Segments = segments + for _, s := range segments { + evalRule.Segments = append(evalRule.Segments, s) + } evalRules = append(evalRules, evalRule) diff --git a/internal/storage/fs/snapshot_test.go b/internal/storage/fs/snapshot_test.go index 8b4b0f02b7..f4d76fbe5f 100644 --- a/internal/storage/fs/snapshot_test.go +++ b/internal/storage/fs/snapshot_test.go @@ -493,7 +493,15 @@ func (fis *FSIndexSuite) TestGetEvaluationRules() { assert.Len(t, rules, 1) assert.Equal(t, int32(1), rules[0].Rank) - assert.Contains(t, rules[0].Segments, "segment1") + + found := false + for _, segment := range rules[0].Segments { + if segment.Key == "segment1" { + found = true + break + } + } + assert.True(t, found, "segment1 should be found in the rule") for i := 0; i < len(tc.constraints); i++ { fc := tc.constraints[i] @@ -1400,7 +1408,16 @@ func (fis *FSWithoutIndexSuite) TestGetEvaluationRules() { assert.Len(t, rules, 1) assert.Equal(t, int32(1), rules[0].Rank) - assert.Contains(t, rules[0].Segments, "segment1") + + found := false + for _, segment := range rules[0].Segments { + if segment.Key == "segment1" { + found = true + break + } + } + + assert.True(t, found, "segment1 should be found in the rule") for i := 0; i < len(tc.constraints); i++ { fc := tc.constraints[i] From 7b965a85b089405bbc98e5e2a1d923cd21dae9f3 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:50:41 -0500 Subject: [PATCH 24/39] fix: mount api --- internal/cmd/http.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/cmd/http.go b/internal/cmd/http.go index 8ca09c8962..6007ab4334 100644 --- a/internal/cmd/http.go +++ b/internal/cmd/http.go @@ -56,10 +56,11 @@ func NewHTTPServer( } isConsole = cfg.Log.Encoding == config.LogEncodingConsole - r = chi.NewRouter() - api = gateway.NewGatewayServeMux(logger) - evaluateAPI = gateway.NewGatewayServeMux(logger) - httpPort = cfg.Server.HTTPPort + r = chi.NewRouter() + api = gateway.NewGatewayServeMux(logger) + evaluateAPI = gateway.NewGatewayServeMux(logger) + evaluateDataAPI = gateway.NewGatewayServeMux(logger) + httpPort = cfg.Server.HTTPPort ) if cfg.Server.Protocol == config.HTTPS { @@ -74,6 +75,10 @@ func NewHTTPServer( return nil, fmt.Errorf("registering grpc gateway: %w", err) } + if err := evaluation.RegisterDataServiceHandler(ctx, evaluateDataAPI, conn); err != nil { + return nil, fmt.Errorf("registering grpc gateway: %w", err) + } + if cfg.Cors.Enabled { cors := cors.New(cors.Options{ AllowedOrigins: cfg.Cors.AllowedOrigins, @@ -140,6 +145,7 @@ func NewHTTPServer( r.Mount("/api/v1", api) r.Mount("/evaluate/v1", evaluateAPI) + r.Mount("/internal/v1", evaluateDataAPI) // mount all authentication related HTTP components // to the chi router. From 8884282a5faec3e1a749ac9f24391ef163202ab8 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:55:52 -0500 Subject: [PATCH 25/39] chore: fix snapshot tests --- internal/storage/fs/snapshot_test.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/internal/storage/fs/snapshot_test.go b/internal/storage/fs/snapshot_test.go index f4d76fbe5f..5e85ab6b0c 100644 --- a/internal/storage/fs/snapshot_test.go +++ b/internal/storage/fs/snapshot_test.go @@ -416,7 +416,16 @@ func (fis *FSIndexSuite) TestGetEvaluationRollouts() { assert.Equal(t, int32(1), rollouts[0].Rank) require.NotNil(t, rollouts[0].GetSegment()) - assert.Contains(t, rollouts[0].GetSegment().Segments, "segment1") + + found := false + for _, s := range rollouts[0].GetSegment().Segments { + if s.Key == "segment1" { + found = true + break + } + } + + assert.True(t, found, "segment1 should be found in the rollout") assert.True(t, rollouts[0].GetSegment().Value, "segment value should be true") assert.Equal(t, int32(2), rollouts[1].Rank) @@ -1308,7 +1317,16 @@ func (fis *FSWithoutIndexSuite) TestGetEvaluationRollouts() { assert.Equal(t, int32(1), rollouts[0].Rank) require.NotNil(t, rollouts[0].GetSegment()) - assert.Contains(t, rollouts[0].GetSegment().Segments, "segment1") + + found := false + for _, s := range rollouts[0].GetSegment().Segments { + if s.Key == "segment1" { + found = true + break + } + } + + assert.True(t, found, "segment1 should be found in the rollout") assert.True(t, rollouts[0].GetSegment().Value, "segment value should be true") assert.Equal(t, int32(2), rollouts[1].Rank) From 2365671f8d99a33298b4085db5a1018c58fe804c Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:44:48 -0500 Subject: [PATCH 26/39] chore: use protos for caching evaluation rules --- internal/cache/cache.go | 2 +- internal/cache/cache_test.go | 26 +++++++++++++ internal/storage/cache/cache.go | 55 +++++++++++++++++++--------- internal/storage/cache/cache_test.go | 47 ++---------------------- 4 files changed, 68 insertions(+), 62 deletions(-) create mode 100644 internal/cache/cache_test.go diff --git a/internal/cache/cache.go b/internal/cache/cache.go index bfcdfc3786..820b232fac 100644 --- a/internal/cache/cache.go +++ b/internal/cache/cache.go @@ -18,5 +18,5 @@ type Cacher interface { } func Key(k string) string { - return fmt.Sprintf("flipt:%x", md5.Sum([]byte(k))) + return fmt.Sprintf("flipt:v1:%x", md5.Sum([]byte(k))) } diff --git a/internal/cache/cache_test.go b/internal/cache/cache_test.go new file mode 100644 index 0000000000..6908dfb7dc --- /dev/null +++ b/internal/cache/cache_test.go @@ -0,0 +1,26 @@ +package cache + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestKey(t *testing.T) { + type args struct { + k string + } + tests := []struct { + name string + args args + want string + }{ + {"empty", args{k: ""}, "flipt:v1:d41d8cd98f00b204e9800998ecf8427e"}, + {"non-empty", args{k: "foo"}, "flipt:v1:acbd18db4cc2f85cedef654fccc4a4d8"}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, Key(tt.args.k)) + }) + } +} diff --git a/internal/storage/cache/cache.go b/internal/storage/cache/cache.go index 5ef2a8a6a8..7b27be9577 100644 --- a/internal/storage/cache/cache.go +++ b/internal/storage/cache/cache.go @@ -1,10 +1,12 @@ package cache import ( + "bytes" "context" "encoding/json" "fmt" + "github.com/gogo/protobuf/jsonpb" "go.flipt.io/flipt/internal/cache" "go.flipt.io/flipt/internal/storage" "go.uber.org/zap" @@ -25,43 +27,62 @@ func NewStore(store storage.Store, cacher cache.Cacher, logger *zap.Logger) *Sto return &Store{Store: store, cacher: cacher, logger: logger} } -func (s *Store) set(ctx context.Context, key string, value any) { - cachePayload, err := json.Marshal(value) - if err != nil { - s.logger.Error("marshalling for storage cache", zap.Error(err)) - return +func (s *Store) set(ctx context.Context, key string, values []*storage.EvaluationRule) { + marshaller := jsonpb.Marshaler{EmitDefaults: false} + + var bytes bytes.Buffer + + bytes.WriteByte('[') + + for _, value := range values { + if err := marshaller.Marshal(&bytes, value); err != nil { + s.logger.Error("marshalling for storage cache", zap.Error(err)) + return + } } - err = s.cacher.Set(ctx, key, cachePayload) - if err != nil { + bytes.WriteByte(']') + + if err := s.cacher.Set(ctx, key, bytes.Bytes()); err != nil { s.logger.Error("setting in storage cache", zap.Error(err)) + return } } -func (s *Store) get(ctx context.Context, key string, value any) bool { +func (s *Store) get(ctx context.Context, key string) (bool, []*storage.EvaluationRule) { cachePayload, cacheHit, err := s.cacher.Get(ctx, key) if err != nil { s.logger.Error("getting from storage cache", zap.Error(err)) - return false + return false, nil } else if !cacheHit { - return false + return false, nil } - err = json.Unmarshal(cachePayload, value) + var values []*storage.EvaluationRule + decoder := json.NewDecoder(bytes.NewReader(cachePayload)) + _, err = decoder.Token() // read the opening bracket if err != nil { - s.logger.Error("unmarshalling from storage cache", zap.Error(err)) - return false + s.logger.Error("reading opening bracket from storage cache", zap.Error(err)) + return false, nil + } + + for decoder.More() { + value := &storage.EvaluationRule{} + if err := jsonpb.UnmarshalNext(decoder, value); err != nil { + s.logger.Error("unmarshalling from storage cache", zap.Error(err)) + return false, nil + } + + values = append(values, value) } - return true + return true, values } func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey string) ([]*storage.EvaluationRule, error) { cacheKey := fmt.Sprintf(evaluationRulesCacheKeyFmt, namespaceKey, flagKey) - var rules []*storage.EvaluationRule - - cacheHit := s.get(ctx, cacheKey, &rules) + cacheHit, rules := s.get(ctx, cacheKey) if cacheHit { return rules, nil } diff --git a/internal/storage/cache/cache_test.go b/internal/storage/cache/cache_test.go index 2ed5dad3ad..0e373f6bea 100644 --- a/internal/storage/cache/cache_test.go +++ b/internal/storage/cache/cache_test.go @@ -2,56 +2,15 @@ package cache import ( "context" - "errors" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.flipt.io/flipt/internal/common" "go.flipt.io/flipt/internal/storage" "go.uber.org/zap/zaptest" ) -func TestSetHandleMarshalError(t *testing.T) { - var ( - store = &common.StoreMock{} - cacher = &cacheSpy{} - logger = zaptest.NewLogger(t) - cachedStore = NewStore(store, cacher, logger) - ) - - cachedStore.set(context.TODO(), "key", make(chan int)) - assert.Empty(t, cacher.cacheKey) -} - -func TestGetHandleGetError(t *testing.T) { - var ( - store = &common.StoreMock{} - cacher = &cacheSpy{getErr: errors.New("get error")} - logger = zaptest.NewLogger(t) - cachedStore = NewStore(store, cacher, logger) - ) - - value := make(map[string]string) - cacheHit := cachedStore.get(context.TODO(), "key", &value) - assert.False(t, cacheHit) -} - -func TestGetHandleUnmarshalError(t *testing.T) { - var ( - store = &common.StoreMock{} - cacher = &cacheSpy{ - cached: true, - cachedValue: []byte(`{"invalid":"123"`), - } - logger = zaptest.NewLogger(t) - cachedStore = NewStore(store, cacher, logger) - ) - - value := make(map[string]string) - cacheHit := cachedStore.get(context.TODO(), "key", &value) - assert.False(t, cacheHit) -} - func TestGetEvaluationRules(t *testing.T) { var ( expectedRules = []*storage.EvaluationRule{{Id: "123"}} @@ -69,7 +28,7 @@ func TestGetEvaluationRules(t *testing.T) { ) rules, err := cachedStore.GetEvaluationRules(context.TODO(), "ns", "flag-1") - assert.Nil(t, err) + require.NoError(t, err) assert.Equal(t, expectedRules, rules) assert.Equal(t, "s:er:ns:flag-1", cacher.cacheKey) @@ -95,7 +54,7 @@ func TestGetEvaluationRulesCached(t *testing.T) { ) rules, err := cachedStore.GetEvaluationRules(context.TODO(), "ns", "flag-1") - assert.Nil(t, err) + require.NoError(t, err) assert.Equal(t, expectedRules, rules) assert.Equal(t, "s:er:ns:flag-1", cacher.cacheKey) } From f7fc36991b99b1ea73d9805239e2d0d5207070d3 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:47:15 -0500 Subject: [PATCH 27/39] chore: mod tidy --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 76d430b726..d1ca0dd36f 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ require ( github.com/go-sql-driver/mysql v1.7.1 github.com/gobwas/glob v0.2.3 github.com/gofrs/uuid v4.4.0+incompatible + github.com/gogo/protobuf v1.3.2 github.com/golang-migrate/migrate/v4 v4.16.2 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v32 v32.1.0 @@ -127,7 +128,6 @@ require ( github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-querystring v1.1.0 // indirect From 4a35fda40ba0890d5fc8aefcd597746d0575d1af Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:56:14 -0500 Subject: [PATCH 28/39] chore: rename cache getters/setters --- internal/storage/cache/cache.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/storage/cache/cache.go b/internal/storage/cache/cache.go index 7b27be9577..4f95e628df 100644 --- a/internal/storage/cache/cache.go +++ b/internal/storage/cache/cache.go @@ -27,7 +27,7 @@ func NewStore(store storage.Store, cacher cache.Cacher, logger *zap.Logger) *Sto return &Store{Store: store, cacher: cacher, logger: logger} } -func (s *Store) set(ctx context.Context, key string, values []*storage.EvaluationRule) { +func (s *Store) setEvaluationRules(ctx context.Context, key string, values []*storage.EvaluationRule) { marshaller := jsonpb.Marshaler{EmitDefaults: false} var bytes bytes.Buffer @@ -49,7 +49,7 @@ func (s *Store) set(ctx context.Context, key string, values []*storage.Evaluatio } } -func (s *Store) get(ctx context.Context, key string) (bool, []*storage.EvaluationRule) { +func (s *Store) getEvaluationRules(ctx context.Context, key string) (bool, []*storage.EvaluationRule) { cachePayload, cacheHit, err := s.cacher.Get(ctx, key) if err != nil { s.logger.Error("getting from storage cache", zap.Error(err)) @@ -82,7 +82,7 @@ func (s *Store) get(ctx context.Context, key string) (bool, []*storage.Evaluatio func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey string) ([]*storage.EvaluationRule, error) { cacheKey := fmt.Sprintf(evaluationRulesCacheKeyFmt, namespaceKey, flagKey) - cacheHit, rules := s.get(ctx, cacheKey) + cacheHit, rules := s.getEvaluationRules(ctx, cacheKey) if cacheHit { return rules, nil } @@ -92,6 +92,6 @@ func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey, flagKey st return nil, err } - s.set(ctx, cacheKey, rules) + s.setEvaluationRules(ctx, cacheKey, rules) return rules, nil } From f6a455bc3fbc1173501ff8dad04d8889b9995dc6 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:58:38 -0500 Subject: [PATCH 29/39] chore: add namespace key to resp --- go.work.sum | 3 +-- internal/server/evaluation/data/server.go | 12 ++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/go.work.sum b/go.work.sum index 65a09505ee..e157a83a06 100644 --- a/go.work.sum +++ b/go.work.sum @@ -60,7 +60,6 @@ cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOV cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute v1.21.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute v1.23.2/go.mod h1:JJ0atRC0J/oWYiiVBmsSsrRnh92DhZPG4hFDcR04Rns= cloud.google.com/go/contactcenterinsights v1.11.0/go.mod h1:hutBdImE4XNZ1NV4vbPJKSFOnQruhC5Lj9bZqWMTKiU= cloud.google.com/go/contactcenterinsights v1.11.2/go.mod h1:A9PIR5ov5cRcd28KlDbmmXE8Aay+Gccer2h4wzkYFso= cloud.google.com/go/container v1.26.0/go.mod h1:YJCmRet6+6jnYYRS000T6k0D0xUXQgBSaJ7VwI8FBj4= @@ -648,7 +647,6 @@ github.com/google/go-containerregistry v0.14.0/go.mod h1:aiJ2fp/SXvkWgmYHioXnbMd github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -769,6 +767,7 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/ktrysmt/go-bitbucket v0.6.4/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= github.com/lestrrat-go/blackmagic v1.0.0/go.mod h1:TNgH//0vYSs8VXDCfkZLgIrVTTXQELZffUV0tz3MtdQ= diff --git a/internal/server/evaluation/data/server.go b/internal/server/evaluation/data/server.go index 22ad7139d3..9e357c1be1 100644 --- a/internal/server/evaluation/data/server.go +++ b/internal/server/evaluation/data/server.go @@ -38,10 +38,14 @@ func (srv *Server) RegisterGRPC(server *grpc.Server) { func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluation.EvaluationNamespaceSnapshotRequest) (*evaluation.EvaluationNamespaceSnapshot, error) { var ( namespaceKey = r.Key - resp = &evaluation.EvaluationNamespaceSnapshot{} - remaining = true - nextPage string - segments = make(map[string]*evaluation.EvaluationSegment) + resp = &evaluation.EvaluationNamespaceSnapshot{ + Namespace: &flipt.Namespace{ // TODO: should we get from store? + Key: namespaceKey, + }, + } + remaining = true + nextPage string + segments = make(map[string]*evaluation.EvaluationSegment) ) // flags/variants in batches From 8d45d51ebfce61d41ebefc8d580f847c886e8a2d Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:19:29 -0500 Subject: [PATCH 30/39] chore: dont fail db unit tests fast --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b72f118a7..8b67256e72 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,7 @@ jobs: name: "Tests (Go)" runs-on: ubuntu-latest strategy: + fail-fast: false matrix: database: ["mysql", "postgres", "cockroachdb", "sqlite", "libsql"] steps: From 3227839bfa371ca771f5e9801b930b17fd0f1a53 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:01:21 -0500 Subject: [PATCH 31/39] chore: try to fix mysql/postgres tests --- internal/storage/sql/common/evaluation.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/storage/sql/common/evaluation.go b/internal/storage/sql/common/evaluation.go index f08b48a4f7..3f0cffde02 100644 --- a/internal/storage/sql/common/evaluation.go +++ b/internal/storage/sql/common/evaluation.go @@ -326,7 +326,7 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey var ( // rolloutId -> rollout - uniqueEvaluationRollouts = make(map[string]*storage.EvaluationRollout) + uniqueSegmentedEvaluationRollouts = make(map[string]*storage.EvaluationRollout) // rolloutId -> segmentKey -> segment uniqueEvaluationRolloutsSegments = make(map[string]map[string]*storage.EvaluationSegment) evaluationRollouts = []*storage.EvaluationRollout{} @@ -387,7 +387,7 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey } // check if we've seen this rollout before - if rollout, ok := uniqueEvaluationRollouts[rolloutId]; ok { + if rollout, ok := uniqueSegmentedEvaluationRollouts[rolloutId]; ok { // check if segment exists and either append constraints to an already existing segment, // or add another segment to the map. if segment, ok := uniqueEvaluationRolloutsSegments[rolloutId][rsSegmentKey.String]; ok { @@ -445,7 +445,13 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey }, } - uniqueEvaluationRollouts[rolloutId] = &evaluationRollout + uniqueSegmentedEvaluationRollouts[rolloutId] = &evaluationRollout + + if _, ok := uniqueEvaluationRolloutsSegments[rolloutId]; !ok { + uniqueEvaluationRolloutsSegments[rolloutId] = make(map[string]*storage.EvaluationSegment) + } + + uniqueEvaluationRolloutsSegments[rolloutId][rsSegmentKey.String] = segment } evaluationRollouts = append(evaluationRollouts, &evaluationRollout) From a743c0578b42942bff1795ac8875133e5e236536 Mon Sep 17 00:00:00 2001 From: Yoofi Quansah Date: Mon, 6 Nov 2023 14:29:20 -0600 Subject: [PATCH 32/39] chore: detect boolean flag types --- internal/server/evaluation/data/server.go | 95 ++++++++++++----------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/internal/server/evaluation/data/server.go b/internal/server/evaluation/data/server.go index 9e357c1be1..2bc9f7a43d 100644 --- a/internal/server/evaluation/data/server.go +++ b/internal/server/evaluation/data/server.go @@ -42,6 +42,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio Namespace: &flipt.Namespace{ // TODO: should we get from store? Key: namespaceKey, }, + Flags: make([]*evaluation.EvaluationFlag, 0), } remaining = true nextPage string @@ -132,68 +133,70 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio } } + } + + if f.Type == flipt.FlagType_BOOLEAN_FLAG_TYPE { + rollouts, err := srv.store.GetEvaluationRollouts(ctx, namespaceKey, f.Key) + if err != nil { + return nil, fmt.Errorf("getting rollout rules for flag %q: %w", f.Key, err) + } - if f.Type == flipt.FlagType_BOOLEAN_FLAG_TYPE { - rollouts, err := srv.store.GetEvaluationRollouts(ctx, namespaceKey, f.Key) - if err != nil { - return nil, fmt.Errorf("getting rollout rules for flag %q: %w", f.Key, err) + for _, r := range rollouts { + rollout := &evaluation.EvaluationRollout{ + Type: r.RolloutType, + Rank: r.Rank, } - for _, r := range rollouts { - rollout := &evaluation.EvaluationRollout{ - Type: r.RolloutType, - Rank: r.Rank, + switch r.RolloutType { + case flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE: + rollout.Rule = &evaluation.EvaluationRollout_Threshold{ + Threshold: &evaluation.EvaluationRolloutThreshold{ + Percentage: r.Threshold.Percentage, + Value: r.Threshold.Value, + }, } - switch r.RolloutType { - case flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE: - rollout.Rule = &evaluation.EvaluationRollout_Threshold{ - Threshold: &evaluation.EvaluationRolloutThreshold{ - Percentage: r.Threshold.Percentage, - Value: r.Threshold.Value, - }, - } + case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: + segment := &evaluation.EvaluationRolloutSegment{ + Value: r.Segment.Value, + SegmentOperator: r.Segment.SegmentOperator, + } - case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: - segment := &evaluation.EvaluationRolloutSegment{ - Value: r.Segment.Value, - SegmentOperator: r.Segment.SegmentOperator, - } + for _, s := range r.Segment.Segments { + // optimization: reuse segment if already seen + ss, ok := segments[s.SegmentKey] + if !ok { + ss := &evaluation.EvaluationSegment{ + Key: s.SegmentKey, + MatchType: s.MatchType, + } - for _, s := range r.Segment.Segments { - // optimization: reuse segment if already seen - ss, ok := segments[s.SegmentKey] - if !ok { - ss := &evaluation.EvaluationSegment{ - Key: s.SegmentKey, - MatchType: s.MatchType, - } - - for _, c := range s.Constraints { - ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ - Id: c.ID, - Type: c.Type, - Property: c.Property, - Operator: c.Operator, - Value: c.Value, - }) - } - - segments[s.SegmentKey] = ss + for _, c := range s.Constraints { + ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ + Id: c.ID, + Type: c.Type, + Property: c.Property, + Operator: c.Operator, + Value: c.Value, + }) } - segment.Segments = append(segment.Segments, ss) + segments[s.SegmentKey] = ss } - rollout.Rule = &evaluation.EvaluationRollout_Segment{ - Segment: segment, - } + segment.Segments = append(segment.Segments, ss) } - flag.Rollouts = append(flag.Rollouts, rollout) + rollout.Rule = &evaluation.EvaluationRollout_Segment{ + Segment: segment, + } } + + flag.Rollouts = append(flag.Rollouts, rollout) } } + + resp.Flags = append(resp.Flags, flag) } } From 189b5a41c6dd4bcca8cab4c19bfb6bd3aed9be7b Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:38:44 -0500 Subject: [PATCH 33/39] chore: cache woes --- internal/storage/cache/cache.go | 5 ++++- internal/storage/cache/cache_test.go | 13 ++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/internal/storage/cache/cache.go b/internal/storage/cache/cache.go index 4f95e628df..b155944d99 100644 --- a/internal/storage/cache/cache.go +++ b/internal/storage/cache/cache.go @@ -28,7 +28,10 @@ func NewStore(store storage.Store, cacher cache.Cacher, logger *zap.Logger) *Sto } func (s *Store) setEvaluationRules(ctx context.Context, key string, values []*storage.EvaluationRule) { - marshaller := jsonpb.Marshaler{EmitDefaults: false} + marshaller := jsonpb.Marshaler{ + EmitDefaults: false, + EnumsAsInts: true, + } var bytes bytes.Buffer diff --git a/internal/storage/cache/cache_test.go b/internal/storage/cache/cache_test.go index 0e373f6bea..c8bce24b15 100644 --- a/internal/storage/cache/cache_test.go +++ b/internal/storage/cache/cache_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" "go.flipt.io/flipt/internal/common" "go.flipt.io/flipt/internal/storage" + "go.flipt.io/flipt/rpc/flipt" "go.uber.org/zap/zaptest" ) @@ -37,8 +38,14 @@ func TestGetEvaluationRules(t *testing.T) { func TestGetEvaluationRulesCached(t *testing.T) { var ( - expectedRules = []*storage.EvaluationRule{{Id: "123"}} - store = &common.StoreMock{} + expectedRules = []*storage.EvaluationRule{{ + Id: "123", + SegmentOperator: flipt.SegmentOperator_AND_SEGMENT_OPERATOR, + Segments: []*storage.EvaluationSegment{{ + Key: "seg-1", + }}, + }} + store = &common.StoreMock{} ) store.AssertNotCalled(t, "GetEvaluationRules", context.TODO(), "ns", "flag-1") @@ -46,7 +53,7 @@ func TestGetEvaluationRulesCached(t *testing.T) { var ( cacher = &cacheSpy{ cached: true, - cachedValue: []byte(`[{"id":"123"}]`), + cachedValue: []byte(`[{"id":"123", "segmentOperator": 1, "segments": [{"key": "seg-1"}]}]`), } logger = zaptest.NewLogger(t) From 748aae30a7f2d55caee44fc162c2c2f6d0726fef Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:51:09 -0500 Subject: [PATCH 34/39] chore: does having namespace key in teh query matter? --- internal/storage/sql/common/evaluation.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/storage/sql/common/evaluation.go b/internal/storage/sql/common/evaluation.go index 3f0cffde02..8816440f66 100644 --- a/internal/storage/sql/common/evaluation.go +++ b/internal/storage/sql/common/evaluation.go @@ -279,6 +279,7 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey rows, err := s.builder.Select(` r.id, + r.namespace_key, r."type", r."rank", rt.percentage, @@ -335,6 +336,7 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey for rows.Next() { var ( rolloutId string + ns string evaluationRollout storage.EvaluationRollout rtPercentageNumber sql.NullFloat64 rtPercentageValue sql.NullBool @@ -347,6 +349,7 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey if err := rows.Scan( &rolloutId, + &ns, &evaluationRollout.Type, &evaluationRollout.Rank, &rtPercentageNumber, From 3407d5ff3ba1243712e462d951ab04e12a068a9c Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:11:41 -0500 Subject: [PATCH 35/39] chore: try to fix tests --- internal/storage/sql/common/evaluation.go | 3 -- internal/storage/sql/evaluation_test.go | 41 ++++++++++++++++------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/internal/storage/sql/common/evaluation.go b/internal/storage/sql/common/evaluation.go index 8816440f66..3f0cffde02 100644 --- a/internal/storage/sql/common/evaluation.go +++ b/internal/storage/sql/common/evaluation.go @@ -279,7 +279,6 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey rows, err := s.builder.Select(` r.id, - r.namespace_key, r."type", r."rank", rt.percentage, @@ -336,7 +335,6 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey for rows.Next() { var ( rolloutId string - ns string evaluationRollout storage.EvaluationRollout rtPercentageNumber sql.NullFloat64 rtPercentageValue sql.NullBool @@ -349,7 +347,6 @@ func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey if err := rows.Scan( &rolloutId, - &ns, &evaluationRollout.Type, &evaluationRollout.Rank, &rtPercentageNumber, diff --git a/internal/storage/sql/evaluation_test.go b/internal/storage/sql/evaluation_test.go index 7aee3f26c3..fdf96a5709 100644 --- a/internal/storage/sql/evaluation_test.go +++ b/internal/storage/sql/evaluation_test.go @@ -260,15 +260,22 @@ func (s *DBTestSuite) TestGetEvaluationRulesNamespace() { assert.Equal(t, rule1.Id, evaluationRules[0].Id) - assert.Equal(t, firstSegment.Key, evaluationRules[0].Segments[0].Key) - assert.Equal(t, firstSegment.MatchType, evaluationRules[0].Segments[0].MatchType) - assert.Equal(t, rule1.Rank, evaluationRules[0].Rank) - assert.Len(t, evaluationRules[0].Segments[0].Constraints, 2) + found := 0 + + for _, segment := range evaluationRules[0].Segments { + if segment.Key == firstSegment.Key { + assert.Equal(t, firstSegment.MatchType, segment.MatchType) + assert.Equal(t, 2, len(segment.Constraints)) + found++ + } else if segment.Key == secondSegment.Key { + assert.Equal(t, secondSegment.MatchType, segment.MatchType) + assert.Equal(t, 0, len(segment.Constraints)) + found++ + } + } - assert.Equal(t, secondSegment.Key, evaluationRules[0].Segments[1].Key) - assert.Equal(t, secondSegment.MatchType, evaluationRules[0].Segments[1].MatchType) + assert.Equal(t, 2, found) assert.Equal(t, rule1.Rank, evaluationRules[0].Rank) - assert.Len(t, evaluationRules[0].Segments[1].Constraints, 0) } func (s *DBTestSuite) TestGetEvaluationDistributions() { @@ -758,13 +765,23 @@ func (s *DBTestSuite) TestGetEvaluationRollouts_NoNamespace() { assert.Equal(t, int32(2), evaluationRollouts[1].Rank) assert.NotNil(t, evaluationRollouts[1].GetSegment()) - - assert.Equal(t, firstSegment.Key, evaluationRollouts[1].GetSegment().Segments[0].Key) assert.Equal(t, flipt.SegmentOperator_AND_SEGMENT_OPERATOR, evaluationRollouts[1].GetSegment().SegmentOperator) - assert.Len(t, evaluationRollouts[1].GetSegment().Segments[0].Constraints, 1) - assert.Equal(t, secondSegment.Key, evaluationRollouts[1].GetSegment().Segments[1].Key) - assert.Len(t, evaluationRollouts[1].GetSegment().Segments[1].Constraints, 0) + found := 0 + + for _, segment := range evaluationRollouts[1].GetSegment().Segments { + if segment.Key == firstSegment.Key { + assert.Equal(t, firstSegment.MatchType, segment.MatchType) + assert.Equal(t, 1, len(segment.Constraints)) + found++ + } else if segment.Key == secondSegment.Key { + assert.Equal(t, secondSegment.MatchType, segment.MatchType) + assert.Equal(t, 0, len(segment.Constraints)) + found++ + } + } + + assert.Equal(t, 2, found) } func (s *DBTestSuite) TestGetEvaluationRollouts_NonDefaultNamespace() { From 0f8334ecd8e8de86086fff698d043bb4a92d5845 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:29:29 -0500 Subject: [PATCH 36/39] chore: create own types for evaluation service --- internal/server/evaluation/data/server.go | 72 +- rpc/flipt/evaluation/evaluation.pb.go | 1071 ++++++++++++++------- rpc/flipt/evaluation/evaluation.proto | 50 +- sdk/go/grpc/grpc.sdk.gen.go | 8 +- sdk/go/sdk.gen.go | 14 +- 5 files changed, 824 insertions(+), 391 deletions(-) diff --git a/internal/server/evaluation/data/server.go b/internal/server/evaluation/data/server.go index 2bc9f7a43d..69ba69e331 100644 --- a/internal/server/evaluation/data/server.go +++ b/internal/server/evaluation/data/server.go @@ -35,11 +35,65 @@ func (srv *Server) RegisterGRPC(server *grpc.Server) { evaluation.RegisterDataServiceServer(server, srv) } +func toEvaluationFlagType(f flipt.FlagType) evaluation.EvaluationFlagType { + switch f { + case flipt.FlagType_BOOLEAN_FLAG_TYPE: + return evaluation.EvaluationFlagType_BOOLEAN_FLAG_TYPE + case flipt.FlagType_VARIANT_FLAG_TYPE: + return evaluation.EvaluationFlagType_VARIANT_FLAG_TYPE + } + return evaluation.EvaluationFlagType_VARIANT_FLAG_TYPE +} + +func toEvaluationSegmentMatchType(s flipt.MatchType) evaluation.EvaluationSegmentMatchType { + switch s { + case flipt.MatchType_ANY_MATCH_TYPE: + return evaluation.EvaluationSegmentMatchType_ANY_SEGMENT_MATCH_TYPE + case flipt.MatchType_ALL_MATCH_TYPE: + return evaluation.EvaluationSegmentMatchType_ALL_SEGMENT_MATCH_TYPE + } + return evaluation.EvaluationSegmentMatchType_ANY_SEGMENT_MATCH_TYPE +} + +func toEvaluationSegmentOperator(s flipt.SegmentOperator) evaluation.EvaluationSegmentOperator { + switch s { + case flipt.SegmentOperator_OR_SEGMENT_OPERATOR: + return evaluation.EvaluationSegmentOperator_OR_SEGMENT_OPERATOR + case flipt.SegmentOperator_AND_SEGMENT_OPERATOR: + return evaluation.EvaluationSegmentOperator_AND_SEGMENT_OPERATOR + } + return evaluation.EvaluationSegmentOperator_OR_SEGMENT_OPERATOR +} + +func toEvaluationConstraintComparisonType(c flipt.ComparisonType) evaluation.EvaluationConstraintComparisonType { + switch c { + case flipt.ComparisonType_STRING_COMPARISON_TYPE: + return evaluation.EvaluationConstraintComparisonType_STRING_COMPARISON_TYPE + case flipt.ComparisonType_NUMBER_COMPARISON_TYPE: + return evaluation.EvaluationConstraintComparisonType_NUMBER_COMPARISON_TYPE + case flipt.ComparisonType_DATETIME_COMPARISON_TYPE: + return evaluation.EvaluationConstraintComparisonType_DATETIME_COMPARISON_TYPE + case flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE: + return evaluation.EvaluationConstraintComparisonType_BOOLEAN_COMPARISON_TYPE + } + return evaluation.EvaluationConstraintComparisonType_UNKNOWN_COMPARISON_TYPE +} + +func toEvaluationRolloutType(r flipt.RolloutType) evaluation.EvaluationRolloutType { + switch r { + case flipt.RolloutType_THRESHOLD_ROLLOUT_TYPE: + return evaluation.EvaluationRolloutType_THRESHOLD_ROLLOUT_TYPE + case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: + return evaluation.EvaluationRolloutType_SEGMENT_ROLLOUT_TYPE + } + return evaluation.EvaluationRolloutType_UNKNOWN_ROLLOUT_TYPE +} + func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluation.EvaluationNamespaceSnapshotRequest) (*evaluation.EvaluationNamespaceSnapshot, error) { var ( namespaceKey = r.Key resp = &evaluation.EvaluationNamespaceSnapshot{ - Namespace: &flipt.Namespace{ // TODO: should we get from store? + Namespace: &evaluation.EvaluationNamespace{ // TODO: should we get from store? Key: namespaceKey, }, Flags: make([]*evaluation.EvaluationFlag, 0), @@ -70,7 +124,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio Name: f.Name, Description: f.Description, Enabled: f.Enabled, - Type: f.Type, + Type: toEvaluationFlagType(f.Type), CreatedAt: f.CreatedAt, UpdatedAt: f.UpdatedAt, } @@ -85,7 +139,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio rule := &evaluation.EvaluationRule{ Id: r.ID, Rank: r.Rank, - SegmentOperator: r.SegmentOperator, + SegmentOperator: toEvaluationSegmentOperator(r.SegmentOperator), } for _, s := range r.Segments { @@ -96,13 +150,13 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio ss := &evaluation.EvaluationSegment{ Key: s.SegmentKey, - MatchType: s.MatchType, + MatchType: toEvaluationSegmentMatchType(s.MatchType), } for _, c := range s.Constraints { ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ Id: c.ID, - Type: c.Type, + Type: toEvaluationConstraintComparisonType(c.Type), Property: c.Property, Operator: c.Operator, Value: c.Value, @@ -143,7 +197,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio for _, r := range rollouts { rollout := &evaluation.EvaluationRollout{ - Type: r.RolloutType, + Type: toEvaluationRolloutType(r.RolloutType), Rank: r.Rank, } @@ -159,7 +213,7 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio case flipt.RolloutType_SEGMENT_ROLLOUT_TYPE: segment := &evaluation.EvaluationRolloutSegment{ Value: r.Segment.Value, - SegmentOperator: r.Segment.SegmentOperator, + SegmentOperator: toEvaluationSegmentOperator(r.Segment.SegmentOperator), } for _, s := range r.Segment.Segments { @@ -168,13 +222,13 @@ func (srv *Server) EvaluationSnapshotNamespace(ctx context.Context, r *evaluatio if !ok { ss := &evaluation.EvaluationSegment{ Key: s.SegmentKey, - MatchType: s.MatchType, + MatchType: toEvaluationSegmentMatchType(s.MatchType), } for _, c := range s.Constraints { ss.Constraints = append(ss.Constraints, &evaluation.EvaluationConstraint{ Id: c.ID, - Type: c.Type, + Type: toEvaluationConstraintComparisonType(c.Type), Property: c.Property, Operator: c.Operator, Value: c.Value, diff --git a/rpc/flipt/evaluation/evaluation.pb.go b/rpc/flipt/evaluation/evaluation.pb.go index 68560fc048..bc399fcff8 100644 --- a/rpc/flipt/evaluation/evaluation.pb.go +++ b/rpc/flipt/evaluation/evaluation.pb.go @@ -7,7 +7,6 @@ package evaluation import ( - flipt "go.flipt.io/flipt/rpc/flipt" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -169,6 +168,248 @@ func (EvaluationResponseType) EnumDescriptor() ([]byte, []int) { return file_evaluation_evaluation_proto_rawDescGZIP(), []int{2} } +type EvaluationRolloutType int32 + +const ( + EvaluationRolloutType_UNKNOWN_ROLLOUT_TYPE EvaluationRolloutType = 0 + EvaluationRolloutType_SEGMENT_ROLLOUT_TYPE EvaluationRolloutType = 1 + EvaluationRolloutType_THRESHOLD_ROLLOUT_TYPE EvaluationRolloutType = 2 +) + +// Enum value maps for EvaluationRolloutType. +var ( + EvaluationRolloutType_name = map[int32]string{ + 0: "UNKNOWN_ROLLOUT_TYPE", + 1: "SEGMENT_ROLLOUT_TYPE", + 2: "THRESHOLD_ROLLOUT_TYPE", + } + EvaluationRolloutType_value = map[string]int32{ + "UNKNOWN_ROLLOUT_TYPE": 0, + "SEGMENT_ROLLOUT_TYPE": 1, + "THRESHOLD_ROLLOUT_TYPE": 2, + } +) + +func (x EvaluationRolloutType) Enum() *EvaluationRolloutType { + p := new(EvaluationRolloutType) + *p = x + return p +} + +func (x EvaluationRolloutType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EvaluationRolloutType) Descriptor() protoreflect.EnumDescriptor { + return file_evaluation_evaluation_proto_enumTypes[3].Descriptor() +} + +func (EvaluationRolloutType) Type() protoreflect.EnumType { + return &file_evaluation_evaluation_proto_enumTypes[3] +} + +func (x EvaluationRolloutType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EvaluationRolloutType.Descriptor instead. +func (EvaluationRolloutType) EnumDescriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{3} +} + +type EvaluationSegmentOperator int32 + +const ( + EvaluationSegmentOperator_OR_SEGMENT_OPERATOR EvaluationSegmentOperator = 0 + EvaluationSegmentOperator_AND_SEGMENT_OPERATOR EvaluationSegmentOperator = 1 +) + +// Enum value maps for EvaluationSegmentOperator. +var ( + EvaluationSegmentOperator_name = map[int32]string{ + 0: "OR_SEGMENT_OPERATOR", + 1: "AND_SEGMENT_OPERATOR", + } + EvaluationSegmentOperator_value = map[string]int32{ + "OR_SEGMENT_OPERATOR": 0, + "AND_SEGMENT_OPERATOR": 1, + } +) + +func (x EvaluationSegmentOperator) Enum() *EvaluationSegmentOperator { + p := new(EvaluationSegmentOperator) + *p = x + return p +} + +func (x EvaluationSegmentOperator) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EvaluationSegmentOperator) Descriptor() protoreflect.EnumDescriptor { + return file_evaluation_evaluation_proto_enumTypes[4].Descriptor() +} + +func (EvaluationSegmentOperator) Type() protoreflect.EnumType { + return &file_evaluation_evaluation_proto_enumTypes[4] +} + +func (x EvaluationSegmentOperator) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EvaluationSegmentOperator.Descriptor instead. +func (EvaluationSegmentOperator) EnumDescriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{4} +} + +type EvaluationSegmentMatchType int32 + +const ( + EvaluationSegmentMatchType_ALL_SEGMENT_MATCH_TYPE EvaluationSegmentMatchType = 0 + EvaluationSegmentMatchType_ANY_SEGMENT_MATCH_TYPE EvaluationSegmentMatchType = 1 +) + +// Enum value maps for EvaluationSegmentMatchType. +var ( + EvaluationSegmentMatchType_name = map[int32]string{ + 0: "ALL_SEGMENT_MATCH_TYPE", + 1: "ANY_SEGMENT_MATCH_TYPE", + } + EvaluationSegmentMatchType_value = map[string]int32{ + "ALL_SEGMENT_MATCH_TYPE": 0, + "ANY_SEGMENT_MATCH_TYPE": 1, + } +) + +func (x EvaluationSegmentMatchType) Enum() *EvaluationSegmentMatchType { + p := new(EvaluationSegmentMatchType) + *p = x + return p +} + +func (x EvaluationSegmentMatchType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EvaluationSegmentMatchType) Descriptor() protoreflect.EnumDescriptor { + return file_evaluation_evaluation_proto_enumTypes[5].Descriptor() +} + +func (EvaluationSegmentMatchType) Type() protoreflect.EnumType { + return &file_evaluation_evaluation_proto_enumTypes[5] +} + +func (x EvaluationSegmentMatchType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EvaluationSegmentMatchType.Descriptor instead. +func (EvaluationSegmentMatchType) EnumDescriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{5} +} + +type EvaluationFlagType int32 + +const ( + EvaluationFlagType_VARIANT_FLAG_TYPE EvaluationFlagType = 0 + EvaluationFlagType_BOOLEAN_FLAG_TYPE EvaluationFlagType = 1 +) + +// Enum value maps for EvaluationFlagType. +var ( + EvaluationFlagType_name = map[int32]string{ + 0: "VARIANT_FLAG_TYPE", + 1: "BOOLEAN_FLAG_TYPE", + } + EvaluationFlagType_value = map[string]int32{ + "VARIANT_FLAG_TYPE": 0, + "BOOLEAN_FLAG_TYPE": 1, + } +) + +func (x EvaluationFlagType) Enum() *EvaluationFlagType { + p := new(EvaluationFlagType) + *p = x + return p +} + +func (x EvaluationFlagType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EvaluationFlagType) Descriptor() protoreflect.EnumDescriptor { + return file_evaluation_evaluation_proto_enumTypes[6].Descriptor() +} + +func (EvaluationFlagType) Type() protoreflect.EnumType { + return &file_evaluation_evaluation_proto_enumTypes[6] +} + +func (x EvaluationFlagType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EvaluationFlagType.Descriptor instead. +func (EvaluationFlagType) EnumDescriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{6} +} + +type EvaluationConstraintComparisonType int32 + +const ( + EvaluationConstraintComparisonType_UNKNOWN_COMPARISON_TYPE EvaluationConstraintComparisonType = 0 + EvaluationConstraintComparisonType_STRING_COMPARISON_TYPE EvaluationConstraintComparisonType = 1 + EvaluationConstraintComparisonType_NUMBER_COMPARISON_TYPE EvaluationConstraintComparisonType = 2 + EvaluationConstraintComparisonType_BOOLEAN_COMPARISON_TYPE EvaluationConstraintComparisonType = 3 + EvaluationConstraintComparisonType_DATETIME_COMPARISON_TYPE EvaluationConstraintComparisonType = 4 +) + +// Enum value maps for EvaluationConstraintComparisonType. +var ( + EvaluationConstraintComparisonType_name = map[int32]string{ + 0: "UNKNOWN_COMPARISON_TYPE", + 1: "STRING_COMPARISON_TYPE", + 2: "NUMBER_COMPARISON_TYPE", + 3: "BOOLEAN_COMPARISON_TYPE", + 4: "DATETIME_COMPARISON_TYPE", + } + EvaluationConstraintComparisonType_value = map[string]int32{ + "UNKNOWN_COMPARISON_TYPE": 0, + "STRING_COMPARISON_TYPE": 1, + "NUMBER_COMPARISON_TYPE": 2, + "BOOLEAN_COMPARISON_TYPE": 3, + "DATETIME_COMPARISON_TYPE": 4, + } +) + +func (x EvaluationConstraintComparisonType) Enum() *EvaluationConstraintComparisonType { + p := new(EvaluationConstraintComparisonType) + *p = x + return p +} + +func (x EvaluationConstraintComparisonType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EvaluationConstraintComparisonType) Descriptor() protoreflect.EnumDescriptor { + return file_evaluation_evaluation_proto_enumTypes[7].Descriptor() +} + +func (EvaluationConstraintComparisonType) Type() protoreflect.EnumType { + return &file_evaluation_evaluation_proto_enumTypes[7] +} + +func (x EvaluationConstraintComparisonType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EvaluationConstraintComparisonType.Descriptor instead. +func (EvaluationConstraintComparisonType) EnumDescriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{7} +} + type EvaluationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -822,8 +1063,8 @@ type EvaluationRollout struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type flipt.RolloutType `protobuf:"varint,1,opt,name=type,proto3,enum=flipt.RolloutType" json:"type,omitempty"` - Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` + Type EvaluationRolloutType `protobuf:"varint,1,opt,name=type,proto3,enum=flipt.evaluation.EvaluationRolloutType" json:"type,omitempty"` + Rank int32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"` // Types that are assignable to Rule: // // *EvaluationRollout_Segment @@ -863,11 +1104,11 @@ func (*EvaluationRollout) Descriptor() ([]byte, []int) { return file_evaluation_evaluation_proto_rawDescGZIP(), []int{8} } -func (x *EvaluationRollout) GetType() flipt.RolloutType { +func (x *EvaluationRollout) GetType() EvaluationRolloutType { if x != nil { return x.Type } - return flipt.RolloutType(0) + return EvaluationRolloutType_UNKNOWN_ROLLOUT_TYPE } func (x *EvaluationRollout) GetRank() int32 { @@ -974,9 +1215,9 @@ type EvaluationRolloutSegment struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - SegmentOperator flipt.SegmentOperator `protobuf:"varint,2,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` - Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` + Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + SegmentOperator EvaluationSegmentOperator `protobuf:"varint,2,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.evaluation.EvaluationSegmentOperator" json:"segment_operator,omitempty"` + Segments []*EvaluationSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` } func (x *EvaluationRolloutSegment) Reset() { @@ -1018,11 +1259,11 @@ func (x *EvaluationRolloutSegment) GetValue() bool { return false } -func (x *EvaluationRolloutSegment) GetSegmentOperator() flipt.SegmentOperator { +func (x *EvaluationRolloutSegment) GetSegmentOperator() EvaluationSegmentOperator { if x != nil { return x.SegmentOperator } - return flipt.SegmentOperator(0) + return EvaluationSegmentOperator_OR_SEGMENT_OPERATOR } func (x *EvaluationRolloutSegment) GetSegments() []*EvaluationSegment { @@ -1037,13 +1278,13 @@ type EvaluationSegment struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - MatchType flipt.MatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=flipt.MatchType" json:"match_type,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Constraints []*EvaluationConstraint `protobuf:"bytes,7,rep,name=constraints,proto3" json:"constraints,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + MatchType EvaluationSegmentMatchType `protobuf:"varint,4,opt,name=match_type,json=matchType,proto3,enum=flipt.evaluation.EvaluationSegmentMatchType" json:"match_type,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Constraints []*EvaluationConstraint `protobuf:"bytes,7,rep,name=constraints,proto3" json:"constraints,omitempty"` } func (x *EvaluationSegment) Reset() { @@ -1099,11 +1340,11 @@ func (x *EvaluationSegment) GetDescription() string { return "" } -func (x *EvaluationSegment) GetMatchType() flipt.MatchType { +func (x *EvaluationSegment) GetMatchType() EvaluationSegmentMatchType { if x != nil { return x.MatchType } - return flipt.MatchType(0) + return EvaluationSegmentMatchType_ALL_SEGMENT_MATCH_TYPE } func (x *EvaluationSegment) GetCreatedAt() *timestamppb.Timestamp { @@ -1136,7 +1377,7 @@ type EvaluationFlag struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - Type flipt.FlagType `protobuf:"varint,5,opt,name=type,proto3,enum=flipt.FlagType" json:"type,omitempty"` + Type EvaluationFlagType `protobuf:"varint,5,opt,name=type,proto3,enum=flipt.evaluation.EvaluationFlagType" json:"type,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` Rules []*EvaluationRule `protobuf:"bytes,8,rep,name=rules,proto3" json:"rules,omitempty"` @@ -1203,11 +1444,11 @@ func (x *EvaluationFlag) GetEnabled() bool { return false } -func (x *EvaluationFlag) GetType() flipt.FlagType { +func (x *EvaluationFlag) GetType() EvaluationFlagType { if x != nil { return x.Type } - return flipt.FlagType(0) + return EvaluationFlagType_VARIANT_FLAG_TYPE } func (x *EvaluationFlag) GetCreatedAt() *timestamppb.Timestamp { @@ -1243,11 +1484,11 @@ type EvaluationConstraint struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type flipt.ComparisonType `protobuf:"varint,2,opt,name=type,proto3,enum=flipt.ComparisonType" json:"type,omitempty"` - Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"` - Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator,omitempty"` - Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type EvaluationConstraintComparisonType `protobuf:"varint,2,opt,name=type,proto3,enum=flipt.evaluation.EvaluationConstraintComparisonType" json:"type,omitempty"` + Property string `protobuf:"bytes,3,opt,name=property,proto3" json:"property,omitempty"` + Operator string `protobuf:"bytes,4,opt,name=operator,proto3" json:"operator,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` } func (x *EvaluationConstraint) Reset() { @@ -1289,11 +1530,11 @@ func (x *EvaluationConstraint) GetId() string { return "" } -func (x *EvaluationConstraint) GetType() flipt.ComparisonType { +func (x *EvaluationConstraint) GetType() EvaluationConstraintComparisonType { if x != nil { return x.Type } - return flipt.ComparisonType(0) + return EvaluationConstraintComparisonType_UNKNOWN_COMPARISON_TYPE } func (x *EvaluationConstraint) GetProperty() string { @@ -1325,7 +1566,7 @@ type EvaluationRule struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Segments []*EvaluationSegment `protobuf:"bytes,2,rep,name=segments,proto3" json:"segments,omitempty"` Rank int32 `protobuf:"varint,3,opt,name=rank,proto3" json:"rank,omitempty"` - SegmentOperator flipt.SegmentOperator `protobuf:"varint,4,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.SegmentOperator" json:"segment_operator,omitempty"` + SegmentOperator EvaluationSegmentOperator `protobuf:"varint,4,opt,name=segment_operator,json=segmentOperator,proto3,enum=flipt.evaluation.EvaluationSegmentOperator" json:"segment_operator,omitempty"` Distributions []*EvaluationDistribution `protobuf:"bytes,5,rep,name=distributions,proto3" json:"distributions,omitempty"` } @@ -1382,11 +1623,11 @@ func (x *EvaluationRule) GetRank() int32 { return 0 } -func (x *EvaluationRule) GetSegmentOperator() flipt.SegmentOperator { +func (x *EvaluationRule) GetSegmentOperator() EvaluationSegmentOperator { if x != nil { return x.SegmentOperator } - return flipt.SegmentOperator(0) + return EvaluationSegmentOperator_OR_SEGMENT_OPERATOR } func (x *EvaluationRule) GetDistributions() []*EvaluationDistribution { @@ -1396,19 +1637,66 @@ func (x *EvaluationRule) GetDistributions() []*EvaluationDistribution { return nil } +type EvaluationNamespace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *EvaluationNamespace) Reset() { + *x = EvaluationNamespace{} + if protoimpl.UnsafeEnabled { + mi := &file_evaluation_evaluation_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluationNamespace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluationNamespace) ProtoMessage() {} + +func (x *EvaluationNamespace) ProtoReflect() protoreflect.Message { + mi := &file_evaluation_evaluation_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluationNamespace.ProtoReflect.Descriptor instead. +func (*EvaluationNamespace) Descriptor() ([]byte, []int) { + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{15} +} + +func (x *EvaluationNamespace) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + type EvaluationNamespaceSnapshot struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Namespace *flipt.Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Flags []*EvaluationFlag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` + Namespace *EvaluationNamespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Flags []*EvaluationFlag `protobuf:"bytes,2,rep,name=flags,proto3" json:"flags,omitempty"` } func (x *EvaluationNamespaceSnapshot) Reset() { *x = EvaluationNamespaceSnapshot{} if protoimpl.UnsafeEnabled { - mi := &file_evaluation_evaluation_proto_msgTypes[15] + mi := &file_evaluation_evaluation_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1421,7 +1709,7 @@ func (x *EvaluationNamespaceSnapshot) String() string { func (*EvaluationNamespaceSnapshot) ProtoMessage() {} func (x *EvaluationNamespaceSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_evaluation_evaluation_proto_msgTypes[15] + mi := &file_evaluation_evaluation_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1434,10 +1722,10 @@ func (x *EvaluationNamespaceSnapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use EvaluationNamespaceSnapshot.ProtoReflect.Descriptor instead. func (*EvaluationNamespaceSnapshot) Descriptor() ([]byte, []int) { - return file_evaluation_evaluation_proto_rawDescGZIP(), []int{15} + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{16} } -func (x *EvaluationNamespaceSnapshot) GetNamespace() *flipt.Namespace { +func (x *EvaluationNamespaceSnapshot) GetNamespace() *EvaluationNamespace { if x != nil { return x.Namespace } @@ -1462,7 +1750,7 @@ type EvaluationNamespaceSnapshotRequest struct { func (x *EvaluationNamespaceSnapshotRequest) Reset() { *x = EvaluationNamespaceSnapshotRequest{} if protoimpl.UnsafeEnabled { - mi := &file_evaluation_evaluation_proto_msgTypes[16] + mi := &file_evaluation_evaluation_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1475,7 +1763,7 @@ func (x *EvaluationNamespaceSnapshotRequest) String() string { func (*EvaluationNamespaceSnapshotRequest) ProtoMessage() {} func (x *EvaluationNamespaceSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_evaluation_evaluation_proto_msgTypes[16] + mi := &file_evaluation_evaluation_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1488,7 +1776,7 @@ func (x *EvaluationNamespaceSnapshotRequest) ProtoReflect() protoreflect.Message // Deprecated: Use EvaluationNamespaceSnapshotRequest.ProtoReflect.Descriptor instead. func (*EvaluationNamespaceSnapshotRequest) Descriptor() ([]byte, []int) { - return file_evaluation_evaluation_proto_rawDescGZIP(), []int{16} + return file_evaluation_evaluation_proto_rawDescGZIP(), []int{17} } func (x *EvaluationNamespaceSnapshotRequest) GetKey() string { @@ -1506,240 +1794,252 @@ var file_evaluation_evaluation_proto_rawDesc = []byte{ 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x0b, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x02, - 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, - 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, - 0x4a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x3a, 0x0a, 0x0c, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x78, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, - 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, + 0x22, 0x97, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, + 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, + 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x3a, + 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x78, 0x0a, 0x16, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, + 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x73, 0x22, 0xb4, 0x01, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x09, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, - 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0xe6, 0x02, 0x0a, 0x12, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x58, 0x0a, - 0x10, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, - 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x76, 0x61, 0x72, 0x69, 0x61, - 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, - 0x52, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x19, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, - 0x79, 0x22, 0x8c, 0x03, 0x0a, 0x19, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, - 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, - 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, - 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x07, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, - 0x22, 0x9a, 0x01, 0x0a, 0x17, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, - 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x3f, 0x0a, 0x06, - 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x66, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0xe6, 0x02, 0x0a, 0x12, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x58, 0x0a, 0x10, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, + 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x65, + 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x76, 0x61, + 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x48, 0x00, 0x52, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xca, 0x01, - 0x0a, 0x16, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x73, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, - 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x49, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, - 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, - 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0xed, 0x01, 0x0a, 0x11, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, - 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x46, 0x0a, 0x07, - 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, - 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, - 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb4, - 0x01, 0x0a, 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, - 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xcc, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x63, 0x6f, - 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, - 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, - 0x69, 0x6e, 0x74, 0x73, 0x22, 0x86, 0x03, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, - 0x46, 0x6c, 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, - 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x19, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x06, + 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, + 0x69, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, + 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x12, 0x36, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, + 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, + 0x67, 0x4b, 0x65, 0x79, 0x22, 0x8c, 0x03, 0x0a, 0x19, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, + 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, + 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, + 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, + 0x72, 0x69, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, + 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x38, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, + 0x4b, 0x65, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x17, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x66, 0x6c, 0x61, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x12, + 0x3f, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x22, 0xca, 0x01, 0x0a, 0x16, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, + 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, + 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, + 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x5f, + 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x22, 0x82, 0x02, + 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, + 0x6f, 0x75, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x46, 0x0a, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x09, + 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, + 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x48, 0x00, 0x52, + 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x72, 0x75, + 0x6c, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc9, 0x01, 0x0a, 0x18, 0x45, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x56, 0x0a, 0x10, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, - 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, - 0x6f, 0x75, 0x74, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x22, 0x9f, 0x01, - 0x0a, 0x14, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, - 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x43, 0x6f, 0x6d, - 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, - 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x88, 0x02, 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, - 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, + 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x3f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x22, 0xe8, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x4b, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x41, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, - 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0d, 0x64, 0x69, - 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1b, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x09, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x48, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, + 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, + 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x9b, 0x03, + 0x0a, 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, + 0x61, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x36, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x6f, + 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, + 0x74, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x73, 0x22, 0xbe, 0x01, 0x0a, 0x14, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, + 0x61, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x48, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, + 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9d, 0x02, 0x0a, + 0x0e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x3f, 0x0a, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x56, 0x0a, 0x10, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x0f, 0x73, 0x65, 0x67, + 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0d, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x27, 0x0a, 0x13, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, + 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, @@ -1771,39 +2071,72 @@ var file_evaluation_evaluation_proto_rawDesc = []byte{ 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x45, 0x56, 0x41, 0x4c, 0x55, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x02, 0x32, - 0xb1, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x07, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, - 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, - 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x07, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, - 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x28, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, + 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x02, 0x2a, + 0x67, 0x0a, 0x15, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, + 0x6c, 0x6f, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x4c, 0x4f, 0x55, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x45, 0x47, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x52, 0x4f, + 0x4c, 0x4c, 0x4f, 0x55, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, + 0x54, 0x48, 0x52, 0x45, 0x53, 0x48, 0x4f, 0x4c, 0x44, 0x5f, 0x52, 0x4f, 0x4c, 0x4c, 0x4f, 0x55, + 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x02, 0x2a, 0x4e, 0x0a, 0x19, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x52, 0x5f, 0x53, 0x45, 0x47, 0x4d, + 0x45, 0x4e, 0x54, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x18, + 0x0a, 0x14, 0x41, 0x4e, 0x44, 0x5f, 0x53, 0x45, 0x47, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x4f, 0x50, + 0x45, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x01, 0x2a, 0x54, 0x0a, 0x1a, 0x45, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x4c, 0x4c, 0x5f, 0x53, 0x45, + 0x47, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x4e, 0x59, 0x5f, 0x53, 0x45, 0x47, 0x4d, 0x45, 0x4e, + 0x54, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x01, 0x2a, 0x42, + 0x0a, 0x12, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x41, 0x52, 0x49, 0x41, 0x4e, 0x54, 0x5f, + 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x42, + 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x10, 0x01, 0x2a, 0xb4, 0x01, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, + 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, + 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x4d, + 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x02, 0x12, 0x1b, + 0x0a, 0x17, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, + 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x44, + 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, + 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x04, 0x32, 0xb1, 0x02, 0x0a, 0x11, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x5d, 0x0a, 0x07, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, + 0x0a, 0x07, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, + 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x32, 0x92, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x12, 0x34, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x92, 0x01, + 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x82, 0x01, + 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x34, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, - 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, + 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, + 0x74, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1818,79 +2151,79 @@ func file_evaluation_evaluation_proto_rawDescGZIP() []byte { return file_evaluation_evaluation_proto_rawDescData } -var file_evaluation_evaluation_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_evaluation_evaluation_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_evaluation_evaluation_proto_enumTypes = make([]protoimpl.EnumInfo, 8) +var file_evaluation_evaluation_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_evaluation_evaluation_proto_goTypes = []interface{}{ (EvaluationReason)(0), // 0: flipt.evaluation.EvaluationReason (ErrorEvaluationReason)(0), // 1: flipt.evaluation.ErrorEvaluationReason (EvaluationResponseType)(0), // 2: flipt.evaluation.EvaluationResponseType - (*EvaluationRequest)(nil), // 3: flipt.evaluation.EvaluationRequest - (*BatchEvaluationRequest)(nil), // 4: flipt.evaluation.BatchEvaluationRequest - (*BatchEvaluationResponse)(nil), // 5: flipt.evaluation.BatchEvaluationResponse - (*EvaluationResponse)(nil), // 6: flipt.evaluation.EvaluationResponse - (*BooleanEvaluationResponse)(nil), // 7: flipt.evaluation.BooleanEvaluationResponse - (*VariantEvaluationResponse)(nil), // 8: flipt.evaluation.VariantEvaluationResponse - (*ErrorEvaluationResponse)(nil), // 9: flipt.evaluation.ErrorEvaluationResponse - (*EvaluationDistribution)(nil), // 10: flipt.evaluation.EvaluationDistribution - (*EvaluationRollout)(nil), // 11: flipt.evaluation.EvaluationRollout - (*EvaluationRolloutThreshold)(nil), // 12: flipt.evaluation.EvaluationRolloutThreshold - (*EvaluationRolloutSegment)(nil), // 13: flipt.evaluation.EvaluationRolloutSegment - (*EvaluationSegment)(nil), // 14: flipt.evaluation.EvaluationSegment - (*EvaluationFlag)(nil), // 15: flipt.evaluation.EvaluationFlag - (*EvaluationConstraint)(nil), // 16: flipt.evaluation.EvaluationConstraint - (*EvaluationRule)(nil), // 17: flipt.evaluation.EvaluationRule - (*EvaluationNamespaceSnapshot)(nil), // 18: flipt.evaluation.EvaluationNamespaceSnapshot - (*EvaluationNamespaceSnapshotRequest)(nil), // 19: flipt.evaluation.EvaluationNamespaceSnapshotRequest - nil, // 20: flipt.evaluation.EvaluationRequest.ContextEntry - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - (flipt.RolloutType)(0), // 22: flipt.RolloutType - (flipt.SegmentOperator)(0), // 23: flipt.SegmentOperator - (flipt.MatchType)(0), // 24: flipt.MatchType - (flipt.FlagType)(0), // 25: flipt.FlagType - (flipt.ComparisonType)(0), // 26: flipt.ComparisonType - (*flipt.Namespace)(nil), // 27: flipt.Namespace + (EvaluationRolloutType)(0), // 3: flipt.evaluation.EvaluationRolloutType + (EvaluationSegmentOperator)(0), // 4: flipt.evaluation.EvaluationSegmentOperator + (EvaluationSegmentMatchType)(0), // 5: flipt.evaluation.EvaluationSegmentMatchType + (EvaluationFlagType)(0), // 6: flipt.evaluation.EvaluationFlagType + (EvaluationConstraintComparisonType)(0), // 7: flipt.evaluation.EvaluationConstraintComparisonType + (*EvaluationRequest)(nil), // 8: flipt.evaluation.EvaluationRequest + (*BatchEvaluationRequest)(nil), // 9: flipt.evaluation.BatchEvaluationRequest + (*BatchEvaluationResponse)(nil), // 10: flipt.evaluation.BatchEvaluationResponse + (*EvaluationResponse)(nil), // 11: flipt.evaluation.EvaluationResponse + (*BooleanEvaluationResponse)(nil), // 12: flipt.evaluation.BooleanEvaluationResponse + (*VariantEvaluationResponse)(nil), // 13: flipt.evaluation.VariantEvaluationResponse + (*ErrorEvaluationResponse)(nil), // 14: flipt.evaluation.ErrorEvaluationResponse + (*EvaluationDistribution)(nil), // 15: flipt.evaluation.EvaluationDistribution + (*EvaluationRollout)(nil), // 16: flipt.evaluation.EvaluationRollout + (*EvaluationRolloutThreshold)(nil), // 17: flipt.evaluation.EvaluationRolloutThreshold + (*EvaluationRolloutSegment)(nil), // 18: flipt.evaluation.EvaluationRolloutSegment + (*EvaluationSegment)(nil), // 19: flipt.evaluation.EvaluationSegment + (*EvaluationFlag)(nil), // 20: flipt.evaluation.EvaluationFlag + (*EvaluationConstraint)(nil), // 21: flipt.evaluation.EvaluationConstraint + (*EvaluationRule)(nil), // 22: flipt.evaluation.EvaluationRule + (*EvaluationNamespace)(nil), // 23: flipt.evaluation.EvaluationNamespace + (*EvaluationNamespaceSnapshot)(nil), // 24: flipt.evaluation.EvaluationNamespaceSnapshot + (*EvaluationNamespaceSnapshotRequest)(nil), // 25: flipt.evaluation.EvaluationNamespaceSnapshotRequest + nil, // 26: flipt.evaluation.EvaluationRequest.ContextEntry + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp } var file_evaluation_evaluation_proto_depIdxs = []int32{ - 20, // 0: flipt.evaluation.EvaluationRequest.context:type_name -> flipt.evaluation.EvaluationRequest.ContextEntry - 3, // 1: flipt.evaluation.BatchEvaluationRequest.requests:type_name -> flipt.evaluation.EvaluationRequest - 6, // 2: flipt.evaluation.BatchEvaluationResponse.responses:type_name -> flipt.evaluation.EvaluationResponse + 26, // 0: flipt.evaluation.EvaluationRequest.context:type_name -> flipt.evaluation.EvaluationRequest.ContextEntry + 8, // 1: flipt.evaluation.BatchEvaluationRequest.requests:type_name -> flipt.evaluation.EvaluationRequest + 11, // 2: flipt.evaluation.BatchEvaluationResponse.responses:type_name -> flipt.evaluation.EvaluationResponse 2, // 3: flipt.evaluation.EvaluationResponse.type:type_name -> flipt.evaluation.EvaluationResponseType - 7, // 4: flipt.evaluation.EvaluationResponse.boolean_response:type_name -> flipt.evaluation.BooleanEvaluationResponse - 8, // 5: flipt.evaluation.EvaluationResponse.variant_response:type_name -> flipt.evaluation.VariantEvaluationResponse - 9, // 6: flipt.evaluation.EvaluationResponse.error_response:type_name -> flipt.evaluation.ErrorEvaluationResponse + 12, // 4: flipt.evaluation.EvaluationResponse.boolean_response:type_name -> flipt.evaluation.BooleanEvaluationResponse + 13, // 5: flipt.evaluation.EvaluationResponse.variant_response:type_name -> flipt.evaluation.VariantEvaluationResponse + 14, // 6: flipt.evaluation.EvaluationResponse.error_response:type_name -> flipt.evaluation.ErrorEvaluationResponse 0, // 7: flipt.evaluation.BooleanEvaluationResponse.reason:type_name -> flipt.evaluation.EvaluationReason - 21, // 8: flipt.evaluation.BooleanEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp + 27, // 8: flipt.evaluation.BooleanEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp 0, // 9: flipt.evaluation.VariantEvaluationResponse.reason:type_name -> flipt.evaluation.EvaluationReason - 21, // 10: flipt.evaluation.VariantEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp + 27, // 10: flipt.evaluation.VariantEvaluationResponse.timestamp:type_name -> google.protobuf.Timestamp 1, // 11: flipt.evaluation.ErrorEvaluationResponse.reason:type_name -> flipt.evaluation.ErrorEvaluationReason - 22, // 12: flipt.evaluation.EvaluationRollout.type:type_name -> flipt.RolloutType - 13, // 13: flipt.evaluation.EvaluationRollout.segment:type_name -> flipt.evaluation.EvaluationRolloutSegment - 12, // 14: flipt.evaluation.EvaluationRollout.threshold:type_name -> flipt.evaluation.EvaluationRolloutThreshold - 23, // 15: flipt.evaluation.EvaluationRolloutSegment.segment_operator:type_name -> flipt.SegmentOperator - 14, // 16: flipt.evaluation.EvaluationRolloutSegment.segments:type_name -> flipt.evaluation.EvaluationSegment - 24, // 17: flipt.evaluation.EvaluationSegment.match_type:type_name -> flipt.MatchType - 21, // 18: flipt.evaluation.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp - 21, // 19: flipt.evaluation.EvaluationSegment.updated_at:type_name -> google.protobuf.Timestamp - 16, // 20: flipt.evaluation.EvaluationSegment.constraints:type_name -> flipt.evaluation.EvaluationConstraint - 25, // 21: flipt.evaluation.EvaluationFlag.type:type_name -> flipt.FlagType - 21, // 22: flipt.evaluation.EvaluationFlag.created_at:type_name -> google.protobuf.Timestamp - 21, // 23: flipt.evaluation.EvaluationFlag.updated_at:type_name -> google.protobuf.Timestamp - 17, // 24: flipt.evaluation.EvaluationFlag.rules:type_name -> flipt.evaluation.EvaluationRule - 11, // 25: flipt.evaluation.EvaluationFlag.rollouts:type_name -> flipt.evaluation.EvaluationRollout - 26, // 26: flipt.evaluation.EvaluationConstraint.type:type_name -> flipt.ComparisonType - 14, // 27: flipt.evaluation.EvaluationRule.segments:type_name -> flipt.evaluation.EvaluationSegment - 23, // 28: flipt.evaluation.EvaluationRule.segment_operator:type_name -> flipt.SegmentOperator - 10, // 29: flipt.evaluation.EvaluationRule.distributions:type_name -> flipt.evaluation.EvaluationDistribution - 27, // 30: flipt.evaluation.EvaluationNamespaceSnapshot.namespace:type_name -> flipt.Namespace - 15, // 31: flipt.evaluation.EvaluationNamespaceSnapshot.flags:type_name -> flipt.evaluation.EvaluationFlag - 3, // 32: flipt.evaluation.EvaluationService.Boolean:input_type -> flipt.evaluation.EvaluationRequest - 3, // 33: flipt.evaluation.EvaluationService.Variant:input_type -> flipt.evaluation.EvaluationRequest - 4, // 34: flipt.evaluation.EvaluationService.Batch:input_type -> flipt.evaluation.BatchEvaluationRequest - 19, // 35: flipt.evaluation.DataService.EvaluationSnapshotNamespace:input_type -> flipt.evaluation.EvaluationNamespaceSnapshotRequest - 7, // 36: flipt.evaluation.EvaluationService.Boolean:output_type -> flipt.evaluation.BooleanEvaluationResponse - 8, // 37: flipt.evaluation.EvaluationService.Variant:output_type -> flipt.evaluation.VariantEvaluationResponse - 5, // 38: flipt.evaluation.EvaluationService.Batch:output_type -> flipt.evaluation.BatchEvaluationResponse - 18, // 39: flipt.evaluation.DataService.EvaluationSnapshotNamespace:output_type -> flipt.evaluation.EvaluationNamespaceSnapshot + 3, // 12: flipt.evaluation.EvaluationRollout.type:type_name -> flipt.evaluation.EvaluationRolloutType + 18, // 13: flipt.evaluation.EvaluationRollout.segment:type_name -> flipt.evaluation.EvaluationRolloutSegment + 17, // 14: flipt.evaluation.EvaluationRollout.threshold:type_name -> flipt.evaluation.EvaluationRolloutThreshold + 4, // 15: flipt.evaluation.EvaluationRolloutSegment.segment_operator:type_name -> flipt.evaluation.EvaluationSegmentOperator + 19, // 16: flipt.evaluation.EvaluationRolloutSegment.segments:type_name -> flipt.evaluation.EvaluationSegment + 5, // 17: flipt.evaluation.EvaluationSegment.match_type:type_name -> flipt.evaluation.EvaluationSegmentMatchType + 27, // 18: flipt.evaluation.EvaluationSegment.created_at:type_name -> google.protobuf.Timestamp + 27, // 19: flipt.evaluation.EvaluationSegment.updated_at:type_name -> google.protobuf.Timestamp + 21, // 20: flipt.evaluation.EvaluationSegment.constraints:type_name -> flipt.evaluation.EvaluationConstraint + 6, // 21: flipt.evaluation.EvaluationFlag.type:type_name -> flipt.evaluation.EvaluationFlagType + 27, // 22: flipt.evaluation.EvaluationFlag.created_at:type_name -> google.protobuf.Timestamp + 27, // 23: flipt.evaluation.EvaluationFlag.updated_at:type_name -> google.protobuf.Timestamp + 22, // 24: flipt.evaluation.EvaluationFlag.rules:type_name -> flipt.evaluation.EvaluationRule + 16, // 25: flipt.evaluation.EvaluationFlag.rollouts:type_name -> flipt.evaluation.EvaluationRollout + 7, // 26: flipt.evaluation.EvaluationConstraint.type:type_name -> flipt.evaluation.EvaluationConstraintComparisonType + 19, // 27: flipt.evaluation.EvaluationRule.segments:type_name -> flipt.evaluation.EvaluationSegment + 4, // 28: flipt.evaluation.EvaluationRule.segment_operator:type_name -> flipt.evaluation.EvaluationSegmentOperator + 15, // 29: flipt.evaluation.EvaluationRule.distributions:type_name -> flipt.evaluation.EvaluationDistribution + 23, // 30: flipt.evaluation.EvaluationNamespaceSnapshot.namespace:type_name -> flipt.evaluation.EvaluationNamespace + 20, // 31: flipt.evaluation.EvaluationNamespaceSnapshot.flags:type_name -> flipt.evaluation.EvaluationFlag + 8, // 32: flipt.evaluation.EvaluationService.Boolean:input_type -> flipt.evaluation.EvaluationRequest + 8, // 33: flipt.evaluation.EvaluationService.Variant:input_type -> flipt.evaluation.EvaluationRequest + 9, // 34: flipt.evaluation.EvaluationService.Batch:input_type -> flipt.evaluation.BatchEvaluationRequest + 25, // 35: flipt.evaluation.DataService.EvaluationSnapshotNamespace:input_type -> flipt.evaluation.EvaluationNamespaceSnapshotRequest + 12, // 36: flipt.evaluation.EvaluationService.Boolean:output_type -> flipt.evaluation.BooleanEvaluationResponse + 13, // 37: flipt.evaluation.EvaluationService.Variant:output_type -> flipt.evaluation.VariantEvaluationResponse + 10, // 38: flipt.evaluation.EvaluationService.Batch:output_type -> flipt.evaluation.BatchEvaluationResponse + 24, // 39: flipt.evaluation.DataService.EvaluationSnapshotNamespace:output_type -> flipt.evaluation.EvaluationNamespaceSnapshot 36, // [36:40] is the sub-list for method output_type 32, // [32:36] is the sub-list for method input_type 32, // [32:32] is the sub-list for extension type_name @@ -2085,7 +2418,7 @@ func file_evaluation_evaluation_proto_init() { } } file_evaluation_evaluation_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvaluationNamespaceSnapshot); i { + switch v := v.(*EvaluationNamespace); i { case 0: return &v.state case 1: @@ -2097,6 +2430,18 @@ func file_evaluation_evaluation_proto_init() { } } file_evaluation_evaluation_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluationNamespaceSnapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_evaluation_evaluation_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EvaluationNamespaceSnapshotRequest); i { case 0: return &v.state @@ -2123,8 +2468,8 @@ func file_evaluation_evaluation_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_evaluation_evaluation_proto_rawDesc, - NumEnums: 3, - NumMessages: 18, + NumEnums: 8, + NumMessages: 19, NumExtensions: 0, NumServices: 2, }, diff --git a/rpc/flipt/evaluation/evaluation.proto b/rpc/flipt/evaluation/evaluation.proto index 8b5b2c7599..c954470f97 100644 --- a/rpc/flipt/evaluation/evaluation.proto +++ b/rpc/flipt/evaluation/evaluation.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package flipt.evaluation; import "google/protobuf/timestamp.proto"; -import "flipt.proto"; option go_package = "go.flipt.io/flipt/rpc/flipt/evaluation"; @@ -95,8 +94,14 @@ message EvaluationDistribution { float rollout = 6; } +enum EvaluationRolloutType { + UNKNOWN_ROLLOUT_TYPE = 0; + SEGMENT_ROLLOUT_TYPE = 1; + THRESHOLD_ROLLOUT_TYPE = 2; +} + message EvaluationRollout { - flipt.RolloutType type = 1; + EvaluationRolloutType type = 1; int32 rank = 2; oneof rule { EvaluationRolloutSegment segment = 3; @@ -109,37 +114,62 @@ message EvaluationRolloutThreshold { bool value = 2; } +enum EvaluationSegmentOperator { + OR_SEGMENT_OPERATOR = 0; + AND_SEGMENT_OPERATOR = 1; +} + message EvaluationRolloutSegment { bool value = 1; - flipt.SegmentOperator segment_operator = 2; + EvaluationSegmentOperator segment_operator = 2; repeated EvaluationSegment segments = 3; } +enum EvaluationSegmentMatchType { + ALL_SEGMENT_MATCH_TYPE = 0; + ANY_SEGMENT_MATCH_TYPE = 1; +} + message EvaluationSegment { string key = 1; string name = 2; string description = 3; - flipt.MatchType match_type = 4; + EvaluationSegmentMatchType match_type = 4; google.protobuf.Timestamp created_at = 5; google.protobuf.Timestamp updated_at = 6; repeated EvaluationConstraint constraints = 7; } + +enum EvaluationFlagType { + VARIANT_FLAG_TYPE = 0; + BOOLEAN_FLAG_TYPE = 1; +} + message EvaluationFlag { string key = 1; string name = 2; string description = 3; bool enabled = 4; - flipt.FlagType type = 5; + EvaluationFlagType type = 5; google.protobuf.Timestamp created_at = 6; google.protobuf.Timestamp updated_at = 7; repeated EvaluationRule rules = 8; repeated EvaluationRollout rollouts = 9; } + +enum EvaluationConstraintComparisonType { + UNKNOWN_COMPARISON_TYPE = 0; + STRING_COMPARISON_TYPE = 1; + NUMBER_COMPARISON_TYPE = 2; + BOOLEAN_COMPARISON_TYPE = 3; + DATETIME_COMPARISON_TYPE = 4; +} + message EvaluationConstraint { string id = 1; - flipt.ComparisonType type = 2; + EvaluationConstraintComparisonType type = 2; string property = 3; string operator = 4; string value = 5; @@ -149,12 +179,16 @@ message EvaluationRule { string id = 1; repeated EvaluationSegment segments = 2; int32 rank = 3; - flipt.SegmentOperator segment_operator = 4; + EvaluationSegmentOperator segment_operator = 4; repeated EvaluationDistribution distributions = 5; } +message EvaluationNamespace { + string key = 1; +} + message EvaluationNamespaceSnapshot { - flipt.Namespace namespace = 1; + EvaluationNamespace namespace = 1; repeated EvaluationFlag flags = 2; } diff --git a/sdk/go/grpc/grpc.sdk.gen.go b/sdk/go/grpc/grpc.sdk.gen.go index d586e1138d..96f7cd0644 100644 --- a/sdk/go/grpc/grpc.sdk.gen.go +++ b/sdk/go/grpc/grpc.sdk.gen.go @@ -53,14 +53,14 @@ func (t Transport) AuthClient() _go.AuthClient { return authClient{cc: t.cc} } -func (t Transport) FliptClient() flipt.FliptClient { - return flipt.NewFliptClient(t.cc) -} - func (t Transport) EvaluationClient() evaluation.EvaluationServiceClient { return evaluation.NewEvaluationServiceClient(t.cc) } +func (t Transport) FliptClient() flipt.FliptClient { + return flipt.NewFliptClient(t.cc) +} + func (t Transport) MetaClient() meta.MetadataServiceClient { return meta.NewMetadataServiceClient(t.cc) } diff --git a/sdk/go/sdk.gen.go b/sdk/go/sdk.gen.go index ac80f31de7..13952f90bc 100644 --- a/sdk/go/sdk.gen.go +++ b/sdk/go/sdk.gen.go @@ -12,8 +12,8 @@ import ( type Transport interface { AuthClient() AuthClient - FliptClient() flipt.FliptClient EvaluationClient() evaluation.EvaluationServiceClient + FliptClient() flipt.FliptClient MetaClient() meta.MetadataServiceClient } @@ -73,16 +73,16 @@ func (s SDK) Auth() *Auth { } } -func (s SDK) Flipt() *Flipt { - return &Flipt{ - transport: s.transport.FliptClient(), +func (s SDK) Evaluation() *Evaluation { + return &Evaluation{ + transport: s.transport.EvaluationClient(), tokenProvider: s.tokenProvider, } } -func (s SDK) Evaluation() *Evaluation { - return &Evaluation{ - transport: s.transport.EvaluationClient(), +func (s SDK) Flipt() *Flipt { + return &Flipt{ + transport: s.transport.FliptClient(), tokenProvider: s.tokenProvider, } } From 126619ffd4cda10d31edea921a49bf76cae5f8d9 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:31:04 -0500 Subject: [PATCH 37/39] chore: rm spaces --- rpc/flipt/evaluation/evaluation.proto | 2 -- 1 file changed, 2 deletions(-) diff --git a/rpc/flipt/evaluation/evaluation.proto b/rpc/flipt/evaluation/evaluation.proto index c954470f97..3b9bcfe91f 100644 --- a/rpc/flipt/evaluation/evaluation.proto +++ b/rpc/flipt/evaluation/evaluation.proto @@ -140,7 +140,6 @@ message EvaluationSegment { repeated EvaluationConstraint constraints = 7; } - enum EvaluationFlagType { VARIANT_FLAG_TYPE = 0; BOOLEAN_FLAG_TYPE = 1; @@ -158,7 +157,6 @@ message EvaluationFlag { repeated EvaluationRollout rollouts = 9; } - enum EvaluationConstraintComparisonType { UNKNOWN_COMPARISON_TYPE = 0; STRING_COMPARISON_TYPE = 1; From db31e44c59ac5d9e0a743189d8b60d3d6aca9c13 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:35:46 -0500 Subject: [PATCH 38/39] chore: rename cmp type fields --- internal/server/evaluation/data/server.go | 10 +- rpc/flipt/evaluation/evaluation.pb.go | 119 +++++++++++----------- rpc/flipt/evaluation/evaluation.proto | 10 +- 3 files changed, 71 insertions(+), 68 deletions(-) diff --git a/internal/server/evaluation/data/server.go b/internal/server/evaluation/data/server.go index 69ba69e331..57d55c08c1 100644 --- a/internal/server/evaluation/data/server.go +++ b/internal/server/evaluation/data/server.go @@ -68,15 +68,15 @@ func toEvaluationSegmentOperator(s flipt.SegmentOperator) evaluation.EvaluationS func toEvaluationConstraintComparisonType(c flipt.ComparisonType) evaluation.EvaluationConstraintComparisonType { switch c { case flipt.ComparisonType_STRING_COMPARISON_TYPE: - return evaluation.EvaluationConstraintComparisonType_STRING_COMPARISON_TYPE + return evaluation.EvaluationConstraintComparisonType_STRING_CONSTRAINT_COMPARISON_TYPE case flipt.ComparisonType_NUMBER_COMPARISON_TYPE: - return evaluation.EvaluationConstraintComparisonType_NUMBER_COMPARISON_TYPE + return evaluation.EvaluationConstraintComparisonType_NUMBER_CONSTRAINT_COMPARISON_TYPE case flipt.ComparisonType_DATETIME_COMPARISON_TYPE: - return evaluation.EvaluationConstraintComparisonType_DATETIME_COMPARISON_TYPE + return evaluation.EvaluationConstraintComparisonType_DATETIME_CONSTRAINT_COMPARISON_TYPE case flipt.ComparisonType_BOOLEAN_COMPARISON_TYPE: - return evaluation.EvaluationConstraintComparisonType_BOOLEAN_COMPARISON_TYPE + return evaluation.EvaluationConstraintComparisonType_BOOLEAN_CONSTRAINT_COMPARISON_TYPE } - return evaluation.EvaluationConstraintComparisonType_UNKNOWN_COMPARISON_TYPE + return evaluation.EvaluationConstraintComparisonType_UNKNOWN_CONSTRAINT_COMPARISON_TYPE } func toEvaluationRolloutType(r flipt.RolloutType) evaluation.EvaluationRolloutType { diff --git a/rpc/flipt/evaluation/evaluation.pb.go b/rpc/flipt/evaluation/evaluation.pb.go index bc399fcff8..6c19e4beb6 100644 --- a/rpc/flipt/evaluation/evaluation.pb.go +++ b/rpc/flipt/evaluation/evaluation.pb.go @@ -358,28 +358,28 @@ func (EvaluationFlagType) EnumDescriptor() ([]byte, []int) { type EvaluationConstraintComparisonType int32 const ( - EvaluationConstraintComparisonType_UNKNOWN_COMPARISON_TYPE EvaluationConstraintComparisonType = 0 - EvaluationConstraintComparisonType_STRING_COMPARISON_TYPE EvaluationConstraintComparisonType = 1 - EvaluationConstraintComparisonType_NUMBER_COMPARISON_TYPE EvaluationConstraintComparisonType = 2 - EvaluationConstraintComparisonType_BOOLEAN_COMPARISON_TYPE EvaluationConstraintComparisonType = 3 - EvaluationConstraintComparisonType_DATETIME_COMPARISON_TYPE EvaluationConstraintComparisonType = 4 + EvaluationConstraintComparisonType_UNKNOWN_CONSTRAINT_COMPARISON_TYPE EvaluationConstraintComparisonType = 0 + EvaluationConstraintComparisonType_STRING_CONSTRAINT_COMPARISON_TYPE EvaluationConstraintComparisonType = 1 + EvaluationConstraintComparisonType_NUMBER_CONSTRAINT_COMPARISON_TYPE EvaluationConstraintComparisonType = 2 + EvaluationConstraintComparisonType_BOOLEAN_CONSTRAINT_COMPARISON_TYPE EvaluationConstraintComparisonType = 3 + EvaluationConstraintComparisonType_DATETIME_CONSTRAINT_COMPARISON_TYPE EvaluationConstraintComparisonType = 4 ) // Enum value maps for EvaluationConstraintComparisonType. var ( EvaluationConstraintComparisonType_name = map[int32]string{ - 0: "UNKNOWN_COMPARISON_TYPE", - 1: "STRING_COMPARISON_TYPE", - 2: "NUMBER_COMPARISON_TYPE", - 3: "BOOLEAN_COMPARISON_TYPE", - 4: "DATETIME_COMPARISON_TYPE", + 0: "UNKNOWN_CONSTRAINT_COMPARISON_TYPE", + 1: "STRING_CONSTRAINT_COMPARISON_TYPE", + 2: "NUMBER_CONSTRAINT_COMPARISON_TYPE", + 3: "BOOLEAN_CONSTRAINT_COMPARISON_TYPE", + 4: "DATETIME_CONSTRAINT_COMPARISON_TYPE", } EvaluationConstraintComparisonType_value = map[string]int32{ - "UNKNOWN_COMPARISON_TYPE": 0, - "STRING_COMPARISON_TYPE": 1, - "NUMBER_COMPARISON_TYPE": 2, - "BOOLEAN_COMPARISON_TYPE": 3, - "DATETIME_COMPARISON_TYPE": 4, + "UNKNOWN_CONSTRAINT_COMPARISON_TYPE": 0, + "STRING_CONSTRAINT_COMPARISON_TYPE": 1, + "NUMBER_CONSTRAINT_COMPARISON_TYPE": 2, + "BOOLEAN_CONSTRAINT_COMPARISON_TYPE": 3, + "DATETIME_CONSTRAINT_COMPARISON_TYPE": 4, } ) @@ -1534,7 +1534,7 @@ func (x *EvaluationConstraint) GetType() EvaluationConstraintComparisonType { if x != nil { return x.Type } - return EvaluationConstraintComparisonType_UNKNOWN_COMPARISON_TYPE + return EvaluationConstraintComparisonType_UNKNOWN_CONSTRAINT_COMPARISON_TYPE } func (x *EvaluationConstraint) GetProperty() string { @@ -2093,50 +2093,53 @@ var file_evaluation_evaluation_proto_rawDesc = []byte{ 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x41, 0x52, 0x49, 0x41, 0x4e, 0x54, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x10, 0x01, 0x2a, 0xb4, 0x01, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, + 0x10, 0x01, 0x2a, 0xeb, 0x01, 0x0a, 0x22, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, - 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x55, 0x4e, 0x4b, - 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, - 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x4d, - 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x02, 0x12, 0x1b, - 0x0a, 0x17, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, - 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x44, - 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, - 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x04, 0x32, 0xb1, 0x02, 0x0a, 0x11, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x5d, 0x0a, 0x07, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, - 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, - 0x0a, 0x07, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, - 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, - 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, - 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x92, 0x01, - 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x82, 0x01, - 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x34, 0x2e, + 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x22, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x52, 0x41, 0x49, 0x4e, 0x54, 0x5f, + 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, + 0x00, 0x12, 0x25, 0x0a, 0x21, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x53, + 0x54, 0x52, 0x41, 0x49, 0x4e, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, + 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x4e, 0x55, 0x4d, 0x42, + 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x52, 0x41, 0x49, 0x4e, 0x54, 0x5f, 0x43, 0x4f, + 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x02, 0x12, + 0x26, 0x0a, 0x22, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x54, + 0x52, 0x41, 0x49, 0x4e, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x44, 0x41, 0x54, 0x45, 0x54, + 0x49, 0x4d, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x52, 0x41, 0x49, 0x4e, 0x54, 0x5f, 0x43, + 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x04, + 0x32, 0xb1, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x07, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, + 0x6e, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, + 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, + 0x6e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x07, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, + 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x05, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x28, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, - 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, - 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, - 0x74, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, + 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x32, 0x92, 0x01, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x1b, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x12, 0x34, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x76, + 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2e, 0x69, 0x6f, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x72, + 0x70, 0x63, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x74, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/rpc/flipt/evaluation/evaluation.proto b/rpc/flipt/evaluation/evaluation.proto index 3b9bcfe91f..52cd80cc9c 100644 --- a/rpc/flipt/evaluation/evaluation.proto +++ b/rpc/flipt/evaluation/evaluation.proto @@ -158,11 +158,11 @@ message EvaluationFlag { } enum EvaluationConstraintComparisonType { - UNKNOWN_COMPARISON_TYPE = 0; - STRING_COMPARISON_TYPE = 1; - NUMBER_COMPARISON_TYPE = 2; - BOOLEAN_COMPARISON_TYPE = 3; - DATETIME_COMPARISON_TYPE = 4; + UNKNOWN_CONSTRAINT_COMPARISON_TYPE = 0; + STRING_CONSTRAINT_COMPARISON_TYPE = 1; + NUMBER_CONSTRAINT_COMPARISON_TYPE = 2; + BOOLEAN_CONSTRAINT_COMPARISON_TYPE = 3; + DATETIME_CONSTRAINT_COMPARISON_TYPE = 4; } message EvaluationConstraint { From a74551bc3199890ae5a487337756604c1208528f Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:20:50 -0500 Subject: [PATCH 39/39] chore: update tests --- internal/storage/sql/evaluation_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/storage/sql/evaluation_test.go b/internal/storage/sql/evaluation_test.go index fdf96a5709..e12dfa9751 100644 --- a/internal/storage/sql/evaluation_test.go +++ b/internal/storage/sql/evaluation_test.go @@ -90,14 +90,14 @@ func (s *DBTestSuite) TestGetEvaluationRules() { assert.Equal(t, rule1.Id, evaluationRules[0].Id) assert.Equal(t, rule1.SegmentKey, evaluationRules[0].Segments[0].Key) - assert.Equal(t, segment.MatchType, evaluationRules[0].Segments[0].MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(segment.MatchType), evaluationRules[0].Segments[0].MatchType) assert.Equal(t, rule1.Rank, evaluationRules[0].Rank) assert.Len(t, evaluationRules[0].Segments[0].Constraints, 2) assert.Equal(t, rule2.Id, evaluationRules[1].Id) assert.Equal(t, rule2.SegmentKey, evaluationRules[1].Segments[0].Key) - assert.Equal(t, segment.MatchType, evaluationRules[1].Segments[0].MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(segment.MatchType), evaluationRules[1].Segments[0].MatchType) assert.Equal(t, rule2.Rank, evaluationRules[1].Rank) assert.Len(t, evaluationRules[1].Segments[0].Constraints, 2) } @@ -172,14 +172,14 @@ func (s *DBTestSuite) TestGetEvaluationRules_NoNamespace() { assert.Equal(t, rule1.Id, evaluationRules[0].Id) assert.Equal(t, rule1.SegmentKey, evaluationRules[0].Segments[0].Key) - assert.Equal(t, segment.MatchType, evaluationRules[0].Segments[0].MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(segment.MatchType), evaluationRules[0].Segments[0].MatchType) assert.Equal(t, rule1.Rank, evaluationRules[0].Rank) assert.Len(t, evaluationRules[0].Segments[0].Constraints, 2) assert.Equal(t, rule2.Id, evaluationRules[1].Id) assert.Equal(t, rule2.SegmentKey, evaluationRules[1].Segments[0].Key) - assert.Equal(t, segment.MatchType, evaluationRules[1].Segments[0].MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(segment.MatchType), evaluationRules[1].Segments[0].MatchType) assert.Equal(t, rule2.Rank, evaluationRules[1].Rank) assert.Len(t, evaluationRules[1].Segments[0].Constraints, 2) } @@ -264,11 +264,11 @@ func (s *DBTestSuite) TestGetEvaluationRulesNamespace() { for _, segment := range evaluationRules[0].Segments { if segment.Key == firstSegment.Key { - assert.Equal(t, firstSegment.MatchType, segment.MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(firstSegment.MatchType), segment.MatchType) assert.Equal(t, 2, len(segment.Constraints)) found++ } else if segment.Key == secondSegment.Key { - assert.Equal(t, secondSegment.MatchType, segment.MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(secondSegment.MatchType), segment.MatchType) assert.Equal(t, 0, len(segment.Constraints)) found++ } @@ -680,7 +680,7 @@ func (s *DBTestSuite) TestGetEvaluationRollouts() { assert.NotNil(t, evaluationRollouts[1].GetSegment()) assert.Equal(t, evaluationRollouts[1].GetSegment().Segments[0].Key, segment.Key) - assert.Equal(t, segment.MatchType, evaluationRollouts[1].GetSegment().Segments[0].MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(segment.MatchType), evaluationRollouts[1].GetSegment().Segments[0].MatchType) assert.True(t, evaluationRollouts[1].GetSegment().Value, "segment value is true") } @@ -765,17 +765,17 @@ func (s *DBTestSuite) TestGetEvaluationRollouts_NoNamespace() { assert.Equal(t, int32(2), evaluationRollouts[1].Rank) assert.NotNil(t, evaluationRollouts[1].GetSegment()) - assert.Equal(t, flipt.SegmentOperator_AND_SEGMENT_OPERATOR, evaluationRollouts[1].GetSegment().SegmentOperator) + assert.Equal(t, rpcevaluation.EvaluationSegmentOperator_AND_SEGMENT_OPERATOR, evaluationRollouts[1].GetSegment().SegmentOperator) found := 0 for _, segment := range evaluationRollouts[1].GetSegment().Segments { if segment.Key == firstSegment.Key { - assert.Equal(t, firstSegment.MatchType, segment.MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(firstSegment.MatchType), segment.MatchType) assert.Equal(t, 1, len(segment.Constraints)) found++ } else if segment.Key == secondSegment.Key { - assert.Equal(t, secondSegment.MatchType, segment.MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(secondSegment.MatchType), segment.MatchType) assert.Equal(t, 0, len(segment.Constraints)) found++ } @@ -861,7 +861,7 @@ func (s *DBTestSuite) TestGetEvaluationRollouts_NonDefaultNamespace() { assert.NotNil(t, evaluationRollouts[1].GetSegment()) assert.Equal(t, evaluationRollouts[1].GetSegment().Segments[0].Key, segment.Key) - assert.Equal(t, segment.MatchType, evaluationRollouts[1].GetSegment().Segments[0].MatchType) + assert.Equal(t, rpcevaluation.EvaluationSegmentMatchType(segment.MatchType), evaluationRollouts[1].GetSegment().Segments[0].MatchType) assert.True(t, evaluationRollouts[1].GetSegment().Value, "segment value is true") }