From 7d8d32af90228a561cffff3afea26dc47de61b56 Mon Sep 17 00:00:00 2001 From: youfak Date: Fri, 31 Jul 2026 10:44:32 +0800 Subject: [PATCH] build: generate worker control plane grpc contract --- .github/workflows/ci.yml | 11 + gen/controlplane/v1/controlplane.pb.go | 2409 +++++++++++++++++++ gen/controlplane/v1/controlplane_grpc.pb.go | 429 ++++ go.mod | 13 +- go.sum | 34 +- scripts/generate-proto.ps1 | 62 + scripts/install-protoc.ps1 | 61 + scripts/verify-proto.ps1 | 31 +- scripts/verify.ps1 | 7 +- 9 files changed, 3046 insertions(+), 11 deletions(-) create mode 100644 gen/controlplane/v1/controlplane.pb.go create mode 100644 gen/controlplane/v1/controlplane_grpc.pb.go create mode 100644 scripts/generate-proto.ps1 create mode 100644 scripts/install-protoc.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8045aa..30ca6cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,17 @@ permissions: contents: read jobs: + proto: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - shell: pwsh + run: ./scripts/verify-proto.ps1 + test: strategy: matrix: diff --git a/gen/controlplane/v1/controlplane.pb.go b/gen/controlplane/v1/controlplane.pb.go new file mode 100644 index 0000000..315ec5d --- /dev/null +++ b/gen/controlplane/v1/controlplane.pb.go @@ -0,0 +1,2409 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v7.35.0 +// source: controlplane/v1/controlplane.proto + +package controlplanev1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + emptypb "google.golang.org/protobuf/types/known/emptypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 StrategyType int32 + +const ( + StrategyType_STRATEGY_TYPE_UNSPECIFIED StrategyType = 0 + StrategyType_STRATEGY_TYPE_SEQUENTIAL StrategyType = 1 + StrategyType_STRATEGY_TYPE_RANDOM StrategyType = 2 + StrategyType_STRATEGY_TYPE_ROUND_ROBIN StrategyType = 3 + StrategyType_STRATEGY_TYPE_WEIGHTED StrategyType = 4 + StrategyType_STRATEGY_TYPE_LEAST_CONNECTIONS StrategyType = 5 +) + +// Enum value maps for StrategyType. +var ( + StrategyType_name = map[int32]string{ + 0: "STRATEGY_TYPE_UNSPECIFIED", + 1: "STRATEGY_TYPE_SEQUENTIAL", + 2: "STRATEGY_TYPE_RANDOM", + 3: "STRATEGY_TYPE_ROUND_ROBIN", + 4: "STRATEGY_TYPE_WEIGHTED", + 5: "STRATEGY_TYPE_LEAST_CONNECTIONS", + } + StrategyType_value = map[string]int32{ + "STRATEGY_TYPE_UNSPECIFIED": 0, + "STRATEGY_TYPE_SEQUENTIAL": 1, + "STRATEGY_TYPE_RANDOM": 2, + "STRATEGY_TYPE_ROUND_ROBIN": 3, + "STRATEGY_TYPE_WEIGHTED": 4, + "STRATEGY_TYPE_LEAST_CONNECTIONS": 5, + } +) + +func (x StrategyType) Enum() *StrategyType { + p := new(StrategyType) + *p = x + return p +} + +func (x StrategyType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StrategyType) Descriptor() protoreflect.EnumDescriptor { + return file_controlplane_v1_controlplane_proto_enumTypes[0].Descriptor() +} + +func (StrategyType) Type() protoreflect.EnumType { + return &file_controlplane_v1_controlplane_proto_enumTypes[0] +} + +func (x StrategyType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StrategyType.Descriptor instead. +func (StrategyType) EnumDescriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{0} +} + +type UnavailableAction int32 + +const ( + UnavailableAction_UNAVAILABLE_ACTION_UNSPECIFIED UnavailableAction = 0 + UnavailableAction_UNAVAILABLE_ACTION_REJECT UnavailableAction = 1 + UnavailableAction_UNAVAILABLE_ACTION_WAIT UnavailableAction = 2 + UnavailableAction_UNAVAILABLE_ACTION_DIRECT UnavailableAction = 3 +) + +// Enum value maps for UnavailableAction. +var ( + UnavailableAction_name = map[int32]string{ + 0: "UNAVAILABLE_ACTION_UNSPECIFIED", + 1: "UNAVAILABLE_ACTION_REJECT", + 2: "UNAVAILABLE_ACTION_WAIT", + 3: "UNAVAILABLE_ACTION_DIRECT", + } + UnavailableAction_value = map[string]int32{ + "UNAVAILABLE_ACTION_UNSPECIFIED": 0, + "UNAVAILABLE_ACTION_REJECT": 1, + "UNAVAILABLE_ACTION_WAIT": 2, + "UNAVAILABLE_ACTION_DIRECT": 3, + } +) + +func (x UnavailableAction) Enum() *UnavailableAction { + p := new(UnavailableAction) + *p = x + return p +} + +func (x UnavailableAction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UnavailableAction) Descriptor() protoreflect.EnumDescriptor { + return file_controlplane_v1_controlplane_proto_enumTypes[1].Descriptor() +} + +func (UnavailableAction) Type() protoreflect.EnumType { + return &file_controlplane_v1_controlplane_proto_enumTypes[1] +} + +func (x UnavailableAction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UnavailableAction.Descriptor instead. +func (UnavailableAction) EnumDescriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{1} +} + +type ProxyProtocol int32 + +const ( + ProxyProtocol_PROXY_PROTOCOL_UNSPECIFIED ProxyProtocol = 0 + ProxyProtocol_PROXY_PROTOCOL_HTTP ProxyProtocol = 1 + ProxyProtocol_PROXY_PROTOCOL_HTTPS ProxyProtocol = 2 + ProxyProtocol_PROXY_PROTOCOL_SOCKS5 ProxyProtocol = 3 +) + +// Enum value maps for ProxyProtocol. +var ( + ProxyProtocol_name = map[int32]string{ + 0: "PROXY_PROTOCOL_UNSPECIFIED", + 1: "PROXY_PROTOCOL_HTTP", + 2: "PROXY_PROTOCOL_HTTPS", + 3: "PROXY_PROTOCOL_SOCKS5", + } + ProxyProtocol_value = map[string]int32{ + "PROXY_PROTOCOL_UNSPECIFIED": 0, + "PROXY_PROTOCOL_HTTP": 1, + "PROXY_PROTOCOL_HTTPS": 2, + "PROXY_PROTOCOL_SOCKS5": 3, + } +) + +func (x ProxyProtocol) Enum() *ProxyProtocol { + p := new(ProxyProtocol) + *p = x + return p +} + +func (x ProxyProtocol) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProxyProtocol) Descriptor() protoreflect.EnumDescriptor { + return file_controlplane_v1_controlplane_proto_enumTypes[2].Descriptor() +} + +func (ProxyProtocol) Type() protoreflect.EnumType { + return &file_controlplane_v1_controlplane_proto_enumTypes[2] +} + +func (x ProxyProtocol) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProxyProtocol.Descriptor instead. +func (ProxyProtocol) EnumDescriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{2} +} + +type OutcomeStage int32 + +const ( + OutcomeStage_OUTCOME_STAGE_UNSPECIFIED OutcomeStage = 0 + OutcomeStage_OUTCOME_STAGE_DIAL OutcomeStage = 1 + OutcomeStage_OUTCOME_STAGE_PROXY_HANDSHAKE OutcomeStage = 2 + OutcomeStage_OUTCOME_STAGE_RESPONSE_HEADERS OutcomeStage = 3 + OutcomeStage_OUTCOME_STAGE_TUNNEL OutcomeStage = 4 +) + +// Enum value maps for OutcomeStage. +var ( + OutcomeStage_name = map[int32]string{ + 0: "OUTCOME_STAGE_UNSPECIFIED", + 1: "OUTCOME_STAGE_DIAL", + 2: "OUTCOME_STAGE_PROXY_HANDSHAKE", + 3: "OUTCOME_STAGE_RESPONSE_HEADERS", + 4: "OUTCOME_STAGE_TUNNEL", + } + OutcomeStage_value = map[string]int32{ + "OUTCOME_STAGE_UNSPECIFIED": 0, + "OUTCOME_STAGE_DIAL": 1, + "OUTCOME_STAGE_PROXY_HANDSHAKE": 2, + "OUTCOME_STAGE_RESPONSE_HEADERS": 3, + "OUTCOME_STAGE_TUNNEL": 4, + } +) + +func (x OutcomeStage) Enum() *OutcomeStage { + p := new(OutcomeStage) + *p = x + return p +} + +func (x OutcomeStage) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OutcomeStage) Descriptor() protoreflect.EnumDescriptor { + return file_controlplane_v1_controlplane_proto_enumTypes[3].Descriptor() +} + +func (OutcomeStage) Type() protoreflect.EnumType { + return &file_controlplane_v1_controlplane_proto_enumTypes[3] +} + +func (x OutcomeStage) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OutcomeStage.Descriptor instead. +func (OutcomeStage) EnumDescriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{3} +} + +type CheckLevel int32 + +const ( + CheckLevel_CHECK_LEVEL_UNSPECIFIED CheckLevel = 0 + CheckLevel_CHECK_LEVEL_BASIC CheckLevel = 1 + CheckLevel_CHECK_LEVEL_EGRESS CheckLevel = 2 + CheckLevel_CHECK_LEVEL_TARGET CheckLevel = 3 +) + +// Enum value maps for CheckLevel. +var ( + CheckLevel_name = map[int32]string{ + 0: "CHECK_LEVEL_UNSPECIFIED", + 1: "CHECK_LEVEL_BASIC", + 2: "CHECK_LEVEL_EGRESS", + 3: "CHECK_LEVEL_TARGET", + } + CheckLevel_value = map[string]int32{ + "CHECK_LEVEL_UNSPECIFIED": 0, + "CHECK_LEVEL_BASIC": 1, + "CHECK_LEVEL_EGRESS": 2, + "CHECK_LEVEL_TARGET": 3, + } +) + +func (x CheckLevel) Enum() *CheckLevel { + p := new(CheckLevel) + *p = x + return p +} + +func (x CheckLevel) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CheckLevel) Descriptor() protoreflect.EnumDescriptor { + return file_controlplane_v1_controlplane_proto_enumTypes[4].Descriptor() +} + +func (CheckLevel) Type() protoreflect.EnumType { + return &file_controlplane_v1_controlplane_proto_enumTypes[4] +} + +func (x CheckLevel) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CheckLevel.Descriptor instead. +func (CheckLevel) EnumDescriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{4} +} + +type RegisterWorkerRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` + SupportedProtocolVersion uint32 `protobuf:"varint,4,opt,name=supported_protocol_version,json=supportedProtocolVersion,proto3" json:"supported_protocol_version,omitempty"` + Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegisterWorkerRequest) Reset() { + *x = RegisterWorkerRequest{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegisterWorkerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterWorkerRequest) ProtoMessage() {} + +func (x *RegisterWorkerRequest) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterWorkerRequest.ProtoReflect.Descriptor instead. +func (*RegisterWorkerRequest) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{0} +} + +func (x *RegisterWorkerRequest) GetWorkerId() string { + if x != nil { + return x.WorkerId + } + return "" +} + +func (x *RegisterWorkerRequest) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *RegisterWorkerRequest) GetZone() string { + if x != nil { + return x.Zone + } + return "" +} + +func (x *RegisterWorkerRequest) GetSupportedProtocolVersion() uint32 { + if x != nil { + return x.SupportedProtocolVersion + } + return 0 +} + +func (x *RegisterWorkerRequest) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type RegisterWorkerResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + OwnershipEpoch uint64 `protobuf:"varint,3,opt,name=ownership_epoch,json=ownershipEpoch,proto3" json:"ownership_epoch,omitempty"` + HeartbeatInterval *durationpb.Duration `protobuf:"bytes,4,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"` + MaxStaleAge *durationpb.Duration `protobuf:"bytes,5,opt,name=max_stale_age,json=maxStaleAge,proto3" json:"max_stale_age,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegisterWorkerResponse) Reset() { + *x = RegisterWorkerResponse{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegisterWorkerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterWorkerResponse) ProtoMessage() {} + +func (x *RegisterWorkerResponse) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegisterWorkerResponse.ProtoReflect.Descriptor instead. +func (*RegisterWorkerResponse) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{1} +} + +func (x *RegisterWorkerResponse) GetWorkerId() string { + if x != nil { + return x.WorkerId + } + return "" +} + +func (x *RegisterWorkerResponse) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *RegisterWorkerResponse) GetOwnershipEpoch() uint64 { + if x != nil { + return x.OwnershipEpoch + } + return 0 +} + +func (x *RegisterWorkerResponse) GetHeartbeatInterval() *durationpb.Duration { + if x != nil { + return x.HeartbeatInterval + } + return nil +} + +func (x *RegisterWorkerResponse) GetMaxStaleAge() *durationpb.Duration { + if x != nil { + return x.MaxStaleAge + } + return nil +} + +type WatchSnapshotsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + LastAppliedVersion uint64 `protobuf:"varint,3,opt,name=last_applied_version,json=lastAppliedVersion,proto3" json:"last_applied_version,omitempty"` + LastChecksum []byte `protobuf:"bytes,4,opt,name=last_checksum,json=lastChecksum,proto3" json:"last_checksum,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WatchSnapshotsRequest) Reset() { + *x = WatchSnapshotsRequest{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WatchSnapshotsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WatchSnapshotsRequest) ProtoMessage() {} + +func (x *WatchSnapshotsRequest) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WatchSnapshotsRequest.ProtoReflect.Descriptor instead. +func (*WatchSnapshotsRequest) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{2} +} + +func (x *WatchSnapshotsRequest) GetWorkerId() string { + if x != nil { + return x.WorkerId + } + return "" +} + +func (x *WatchSnapshotsRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *WatchSnapshotsRequest) GetLastAppliedVersion() uint64 { + if x != nil { + return x.LastAppliedVersion + } + return 0 +} + +func (x *WatchSnapshotsRequest) GetLastChecksum() []byte { + if x != nil { + return x.LastChecksum + } + return nil +} + +type SnapshotEnvelope struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Payload: + // + // *SnapshotEnvelope_Full + // *SnapshotEnvelope_Delta + Payload isSnapshotEnvelope_Payload `protobuf_oneof:"payload"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SnapshotEnvelope) Reset() { + *x = SnapshotEnvelope{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SnapshotEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SnapshotEnvelope) ProtoMessage() {} + +func (x *SnapshotEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SnapshotEnvelope.ProtoReflect.Descriptor instead. +func (*SnapshotEnvelope) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{3} +} + +func (x *SnapshotEnvelope) GetPayload() isSnapshotEnvelope_Payload { + if x != nil { + return x.Payload + } + return nil +} + +func (x *SnapshotEnvelope) GetFull() *WorkerSnapshot { + if x != nil { + if x, ok := x.Payload.(*SnapshotEnvelope_Full); ok { + return x.Full + } + } + return nil +} + +func (x *SnapshotEnvelope) GetDelta() *SnapshotDelta { + if x != nil { + if x, ok := x.Payload.(*SnapshotEnvelope_Delta); ok { + return x.Delta + } + } + return nil +} + +type isSnapshotEnvelope_Payload interface { + isSnapshotEnvelope_Payload() +} + +type SnapshotEnvelope_Full struct { + Full *WorkerSnapshot `protobuf:"bytes,1,opt,name=full,proto3,oneof"` +} + +type SnapshotEnvelope_Delta struct { + Delta *SnapshotDelta `protobuf:"bytes,2,opt,name=delta,proto3,oneof"` +} + +func (*SnapshotEnvelope_Full) isSnapshotEnvelope_Payload() {} + +func (*SnapshotEnvelope_Delta) isSnapshotEnvelope_Payload() {} + +type WorkerSnapshot struct { + state protoimpl.MessageState `protogen:"open.v1"` + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + OwnershipEpoch uint64 `protobuf:"varint,2,opt,name=ownership_epoch,json=ownershipEpoch,proto3" json:"ownership_epoch,omitempty"` + GeneratedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=generated_at,json=generatedAt,proto3" json:"generated_at,omitempty"` + ValidUntil *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=valid_until,json=validUntil,proto3" json:"valid_until,omitempty"` + Checksum []byte `protobuf:"bytes,5,opt,name=checksum,proto3" json:"checksum,omitempty"` + Routing []*RoutingRule `protobuf:"bytes,6,rep,name=routing,proto3" json:"routing,omitempty"` + Proxies []*OwnedProxy `protobuf:"bytes,7,rep,name=proxies,proto3" json:"proxies,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkerSnapshot) Reset() { + *x = WorkerSnapshot{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkerSnapshot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkerSnapshot) ProtoMessage() {} + +func (x *WorkerSnapshot) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkerSnapshot.ProtoReflect.Descriptor instead. +func (*WorkerSnapshot) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{4} +} + +func (x *WorkerSnapshot) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *WorkerSnapshot) GetOwnershipEpoch() uint64 { + if x != nil { + return x.OwnershipEpoch + } + return 0 +} + +func (x *WorkerSnapshot) GetGeneratedAt() *timestamppb.Timestamp { + if x != nil { + return x.GeneratedAt + } + return nil +} + +func (x *WorkerSnapshot) GetValidUntil() *timestamppb.Timestamp { + if x != nil { + return x.ValidUntil + } + return nil +} + +func (x *WorkerSnapshot) GetChecksum() []byte { + if x != nil { + return x.Checksum + } + return nil +} + +func (x *WorkerSnapshot) GetRouting() []*RoutingRule { + if x != nil { + return x.Routing + } + return nil +} + +func (x *WorkerSnapshot) GetProxies() []*OwnedProxy { + if x != nil { + return x.Proxies + } + return nil +} + +type SnapshotDelta struct { + state protoimpl.MessageState `protogen:"open.v1"` + BaseVersion uint64 `protobuf:"varint,1,opt,name=base_version,json=baseVersion,proto3" json:"base_version,omitempty"` + Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + OwnershipEpoch uint64 `protobuf:"varint,3,opt,name=ownership_epoch,json=ownershipEpoch,proto3" json:"ownership_epoch,omitempty"` + GeneratedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=generated_at,json=generatedAt,proto3" json:"generated_at,omitempty"` + Checksum []byte `protobuf:"bytes,5,opt,name=checksum,proto3" json:"checksum,omitempty"` + UpsertedRouting []*RoutingRule `protobuf:"bytes,6,rep,name=upserted_routing,json=upsertedRouting,proto3" json:"upserted_routing,omitempty"` + RemovedRoutingNames []string `protobuf:"bytes,7,rep,name=removed_routing_names,json=removedRoutingNames,proto3" json:"removed_routing_names,omitempty"` + UpsertedProxies []*OwnedProxy `protobuf:"bytes,8,rep,name=upserted_proxies,json=upsertedProxies,proto3" json:"upserted_proxies,omitempty"` + RemovedProxyIds []string `protobuf:"bytes,9,rep,name=removed_proxy_ids,json=removedProxyIds,proto3" json:"removed_proxy_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SnapshotDelta) Reset() { + *x = SnapshotDelta{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SnapshotDelta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SnapshotDelta) ProtoMessage() {} + +func (x *SnapshotDelta) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SnapshotDelta.ProtoReflect.Descriptor instead. +func (*SnapshotDelta) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{5} +} + +func (x *SnapshotDelta) GetBaseVersion() uint64 { + if x != nil { + return x.BaseVersion + } + return 0 +} + +func (x *SnapshotDelta) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *SnapshotDelta) GetOwnershipEpoch() uint64 { + if x != nil { + return x.OwnershipEpoch + } + return 0 +} + +func (x *SnapshotDelta) GetGeneratedAt() *timestamppb.Timestamp { + if x != nil { + return x.GeneratedAt + } + return nil +} + +func (x *SnapshotDelta) GetChecksum() []byte { + if x != nil { + return x.Checksum + } + return nil +} + +func (x *SnapshotDelta) GetUpsertedRouting() []*RoutingRule { + if x != nil { + return x.UpsertedRouting + } + return nil +} + +func (x *SnapshotDelta) GetRemovedRoutingNames() []string { + if x != nil { + return x.RemovedRoutingNames + } + return nil +} + +func (x *SnapshotDelta) GetUpsertedProxies() []*OwnedProxy { + if x != nil { + return x.UpsertedProxies + } + return nil +} + +func (x *SnapshotDelta) GetRemovedProxyIds() []string { + if x != nil { + return x.RemovedProxyIds + } + return nil +} + +type RoutingRule struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` + HostRegex string `protobuf:"bytes,3,opt,name=host_regex,json=hostRegex,proto3" json:"host_regex,omitempty"` + Methods []string `protobuf:"bytes,4,rep,name=methods,proto3" json:"methods,omitempty"` + PathRegex string `protobuf:"bytes,5,opt,name=path_regex,json=pathRegex,proto3" json:"path_regex,omitempty"` + Headers map[string]string `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Upstreams []string `protobuf:"bytes,7,rep,name=upstreams,proto3" json:"upstreams,omitempty"` + Strategy *RoutingStrategy `protobuf:"bytes,8,opt,name=strategy,proto3" json:"strategy,omitempty"` + OnUnavailable UnavailableAction `protobuf:"varint,9,opt,name=on_unavailable,json=onUnavailable,proto3,enum=proxy_pool.controlplane.v1.UnavailableAction" json:"on_unavailable,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoutingRule) Reset() { + *x = RoutingRule{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoutingRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoutingRule) ProtoMessage() {} + +func (x *RoutingRule) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoutingRule.ProtoReflect.Descriptor instead. +func (*RoutingRule) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{6} +} + +func (x *RoutingRule) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RoutingRule) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *RoutingRule) GetHostRegex() string { + if x != nil { + return x.HostRegex + } + return "" +} + +func (x *RoutingRule) GetMethods() []string { + if x != nil { + return x.Methods + } + return nil +} + +func (x *RoutingRule) GetPathRegex() string { + if x != nil { + return x.PathRegex + } + return "" +} + +func (x *RoutingRule) GetHeaders() map[string]string { + if x != nil { + return x.Headers + } + return nil +} + +func (x *RoutingRule) GetUpstreams() []string { + if x != nil { + return x.Upstreams + } + return nil +} + +func (x *RoutingRule) GetStrategy() *RoutingStrategy { + if x != nil { + return x.Strategy + } + return nil +} + +func (x *RoutingRule) GetOnUnavailable() UnavailableAction { + if x != nil { + return x.OnUnavailable + } + return UnavailableAction_UNAVAILABLE_ACTION_UNSPECIFIED +} + +type RoutingStrategy struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type StrategyType `protobuf:"varint,1,opt,name=type,proto3,enum=proxy_pool.controlplane.v1.StrategyType" json:"type,omitempty"` + CurrentUpstream string `protobuf:"bytes,2,opt,name=current_upstream,json=currentUpstream,proto3" json:"current_upstream,omitempty"` + Weights map[string]uint32 `protobuf:"bytes,3,rep,name=weights,proto3" json:"weights,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoutingStrategy) Reset() { + *x = RoutingStrategy{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoutingStrategy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoutingStrategy) ProtoMessage() {} + +func (x *RoutingStrategy) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoutingStrategy.ProtoReflect.Descriptor instead. +func (*RoutingStrategy) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{7} +} + +func (x *RoutingStrategy) GetType() StrategyType { + if x != nil { + return x.Type + } + return StrategyType_STRATEGY_TYPE_UNSPECIFIED +} + +func (x *RoutingStrategy) GetCurrentUpstream() string { + if x != nil { + return x.CurrentUpstream + } + return "" +} + +func (x *RoutingStrategy) GetWeights() map[string]uint32 { + if x != nil { + return x.Weights + } + return nil +} + +type OwnedProxy struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Upstream string `protobuf:"bytes,2,opt,name=upstream,proto3" json:"upstream,omitempty"` + Protocol ProxyProtocol `protobuf:"varint,3,opt,name=protocol,proto3,enum=proxy_pool.controlplane.v1.ProxyProtocol" json:"protocol,omitempty"` + Host string `protobuf:"bytes,4,opt,name=host,proto3" json:"host,omitempty"` + Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` + Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` + CredentialVersion string `protobuf:"bytes,7,opt,name=credential_version,json=credentialVersion,proto3" json:"credential_version,omitempty"` + SecretRef string `protobuf:"bytes,8,opt,name=secret_ref,json=secretRef,proto3" json:"secret_ref,omitempty"` + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + MaxConcurrency uint32 `protobuf:"varint,10,opt,name=max_concurrency,json=maxConcurrency,proto3" json:"max_concurrency,omitempty"` + Tags map[string]string `protobuf:"bytes,11,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + OwnershipEpoch uint64 `protobuf:"varint,12,opt,name=ownership_epoch,json=ownershipEpoch,proto3" json:"ownership_epoch,omitempty"` + UsableUntil *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=usable_until,json=usableUntil,proto3" json:"usable_until,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OwnedProxy) Reset() { + *x = OwnedProxy{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OwnedProxy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OwnedProxy) ProtoMessage() {} + +func (x *OwnedProxy) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OwnedProxy.ProtoReflect.Descriptor instead. +func (*OwnedProxy) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{8} +} + +func (x *OwnedProxy) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *OwnedProxy) GetUpstream() string { + if x != nil { + return x.Upstream + } + return "" +} + +func (x *OwnedProxy) GetProtocol() ProxyProtocol { + if x != nil { + return x.Protocol + } + return ProxyProtocol_PROXY_PROTOCOL_UNSPECIFIED +} + +func (x *OwnedProxy) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *OwnedProxy) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *OwnedProxy) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *OwnedProxy) GetCredentialVersion() string { + if x != nil { + return x.CredentialVersion + } + return "" +} + +func (x *OwnedProxy) GetSecretRef() string { + if x != nil { + return x.SecretRef + } + return "" +} + +func (x *OwnedProxy) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +func (x *OwnedProxy) GetMaxConcurrency() uint32 { + if x != nil { + return x.MaxConcurrency + } + return 0 +} + +func (x *OwnedProxy) GetTags() map[string]string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *OwnedProxy) GetOwnershipEpoch() uint64 { + if x != nil { + return x.OwnershipEpoch + } + return 0 +} + +func (x *OwnedProxy) GetUsableUntil() *timestamppb.Timestamp { + if x != nil { + return x.UsableUntil + } + return nil +} + +type AcknowledgeSnapshotRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Version uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + OwnershipEpoch uint64 `protobuf:"varint,4,opt,name=ownership_epoch,json=ownershipEpoch,proto3" json:"ownership_epoch,omitempty"` + Checksum []byte `protobuf:"bytes,5,opt,name=checksum,proto3" json:"checksum,omitempty"` + Applied bool `protobuf:"varint,6,opt,name=applied,proto3" json:"applied,omitempty"` + ErrorCode string `protobuf:"bytes,7,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` + ErrorMessage string `protobuf:"bytes,8,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AcknowledgeSnapshotRequest) Reset() { + *x = AcknowledgeSnapshotRequest{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AcknowledgeSnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcknowledgeSnapshotRequest) ProtoMessage() {} + +func (x *AcknowledgeSnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AcknowledgeSnapshotRequest.ProtoReflect.Descriptor instead. +func (*AcknowledgeSnapshotRequest) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{9} +} + +func (x *AcknowledgeSnapshotRequest) GetWorkerId() string { + if x != nil { + return x.WorkerId + } + return "" +} + +func (x *AcknowledgeSnapshotRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *AcknowledgeSnapshotRequest) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *AcknowledgeSnapshotRequest) GetOwnershipEpoch() uint64 { + if x != nil { + return x.OwnershipEpoch + } + return 0 +} + +func (x *AcknowledgeSnapshotRequest) GetChecksum() []byte { + if x != nil { + return x.Checksum + } + return nil +} + +func (x *AcknowledgeSnapshotRequest) GetApplied() bool { + if x != nil { + return x.Applied + } + return false +} + +func (x *AcknowledgeSnapshotRequest) GetErrorCode() string { + if x != nil { + return x.ErrorCode + } + return "" +} + +func (x *AcknowledgeSnapshotRequest) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +type OutcomeBatch struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Sequence uint64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"` + Outcomes []*ProxyOutcome `protobuf:"bytes,4,rep,name=outcomes,proto3" json:"outcomes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OutcomeBatch) Reset() { + *x = OutcomeBatch{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OutcomeBatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OutcomeBatch) ProtoMessage() {} + +func (x *OutcomeBatch) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OutcomeBatch.ProtoReflect.Descriptor instead. +func (*OutcomeBatch) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{10} +} + +func (x *OutcomeBatch) GetWorkerId() string { + if x != nil { + return x.WorkerId + } + return "" +} + +func (x *OutcomeBatch) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *OutcomeBatch) GetSequence() uint64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *OutcomeBatch) GetOutcomes() []*ProxyOutcome { + if x != nil { + return x.Outcomes + } + return nil +} + +type ProxyOutcome struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProxyId string `protobuf:"bytes,1,opt,name=proxy_id,json=proxyId,proto3" json:"proxy_id,omitempty"` + RoutingName string `protobuf:"bytes,2,opt,name=routing_name,json=routingName,proto3" json:"routing_name,omitempty"` + Stage OutcomeStage `protobuf:"varint,3,opt,name=stage,proto3,enum=proxy_pool.controlplane.v1.OutcomeStage" json:"stage,omitempty"` + Success bool `protobuf:"varint,4,opt,name=success,proto3" json:"success,omitempty"` + Latency *durationpb.Duration `protobuf:"bytes,5,opt,name=latency,proto3" json:"latency,omitempty"` + ErrorClass string `protobuf:"bytes,6,opt,name=error_class,json=errorClass,proto3" json:"error_class,omitempty"` + ObservedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=observed_at,json=observedAt,proto3" json:"observed_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProxyOutcome) Reset() { + *x = ProxyOutcome{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProxyOutcome) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProxyOutcome) ProtoMessage() {} + +func (x *ProxyOutcome) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProxyOutcome.ProtoReflect.Descriptor instead. +func (*ProxyOutcome) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{11} +} + +func (x *ProxyOutcome) GetProxyId() string { + if x != nil { + return x.ProxyId + } + return "" +} + +func (x *ProxyOutcome) GetRoutingName() string { + if x != nil { + return x.RoutingName + } + return "" +} + +func (x *ProxyOutcome) GetStage() OutcomeStage { + if x != nil { + return x.Stage + } + return OutcomeStage_OUTCOME_STAGE_UNSPECIFIED +} + +func (x *ProxyOutcome) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ProxyOutcome) GetLatency() *durationpb.Duration { + if x != nil { + return x.Latency + } + return nil +} + +func (x *ProxyOutcome) GetErrorClass() string { + if x != nil { + return x.ErrorClass + } + return "" +} + +func (x *ProxyOutcome) GetObservedAt() *timestamppb.Timestamp { + if x != nil { + return x.ObservedAt + } + return nil +} + +type ReportOutcomesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AcceptedThroughSequence uint64 `protobuf:"varint,1,opt,name=accepted_through_sequence,json=acceptedThroughSequence,proto3" json:"accepted_through_sequence,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportOutcomesResponse) Reset() { + *x = ReportOutcomesResponse{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportOutcomesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportOutcomesResponse) ProtoMessage() {} + +func (x *ReportOutcomesResponse) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportOutcomesResponse.ProtoReflect.Descriptor instead. +func (*ReportOutcomesResponse) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{12} +} + +func (x *ReportOutcomesResponse) GetAcceptedThroughSequence() uint64 { + if x != nil { + return x.AcceptedThroughSequence + } + return 0 +} + +type ReportRuntimeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkerId string `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SnapshotVersion uint64 `protobuf:"varint,3,opt,name=snapshot_version,json=snapshotVersion,proto3" json:"snapshot_version,omitempty"` + OwnershipEpoch uint64 `protobuf:"varint,4,opt,name=ownership_epoch,json=ownershipEpoch,proto3" json:"ownership_epoch,omitempty"` + Counters []*ProxyRuntime `protobuf:"bytes,5,rep,name=counters,proto3" json:"counters,omitempty"` + ObservedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=observed_at,json=observedAt,proto3" json:"observed_at,omitempty"` + ReportSequence uint64 `protobuf:"varint,7,opt,name=report_sequence,json=reportSequence,proto3" json:"report_sequence,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportRuntimeRequest) Reset() { + *x = ReportRuntimeRequest{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportRuntimeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportRuntimeRequest) ProtoMessage() {} + +func (x *ReportRuntimeRequest) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportRuntimeRequest.ProtoReflect.Descriptor instead. +func (*ReportRuntimeRequest) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{13} +} + +func (x *ReportRuntimeRequest) GetWorkerId() string { + if x != nil { + return x.WorkerId + } + return "" +} + +func (x *ReportRuntimeRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *ReportRuntimeRequest) GetSnapshotVersion() uint64 { + if x != nil { + return x.SnapshotVersion + } + return 0 +} + +func (x *ReportRuntimeRequest) GetOwnershipEpoch() uint64 { + if x != nil { + return x.OwnershipEpoch + } + return 0 +} + +func (x *ReportRuntimeRequest) GetCounters() []*ProxyRuntime { + if x != nil { + return x.Counters + } + return nil +} + +func (x *ReportRuntimeRequest) GetObservedAt() *timestamppb.Timestamp { + if x != nil { + return x.ObservedAt + } + return nil +} + +func (x *ReportRuntimeRequest) GetReportSequence() uint64 { + if x != nil { + return x.ReportSequence + } + return 0 +} + +type ProxyRuntime struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProxyId string `protobuf:"bytes,1,opt,name=proxy_id,json=proxyId,proto3" json:"proxy_id,omitempty"` + Reserved uint32 `protobuf:"varint,2,opt,name=reserved,proto3" json:"reserved,omitempty"` + Active uint32 `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` + Draining bool `protobuf:"varint,4,opt,name=draining,proto3" json:"draining,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProxyRuntime) Reset() { + *x = ProxyRuntime{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProxyRuntime) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProxyRuntime) ProtoMessage() {} + +func (x *ProxyRuntime) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProxyRuntime.ProtoReflect.Descriptor instead. +func (*ProxyRuntime) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{14} +} + +func (x *ProxyRuntime) GetProxyId() string { + if x != nil { + return x.ProxyId + } + return "" +} + +func (x *ProxyRuntime) GetReserved() uint32 { + if x != nil { + return x.Reserved + } + return 0 +} + +func (x *ProxyRuntime) GetActive() uint32 { + if x != nil { + return x.Active + } + return 0 +} + +func (x *ProxyRuntime) GetDraining() bool { + if x != nil { + return x.Draining + } + return false +} + +type ReportRuntimeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AcceptedOwnershipEpoch uint64 `protobuf:"varint,1,opt,name=accepted_ownership_epoch,json=acceptedOwnershipEpoch,proto3" json:"accepted_ownership_epoch,omitempty"` + RevokeProxyIds []string `protobuf:"bytes,2,rep,name=revoke_proxy_ids,json=revokeProxyIds,proto3" json:"revoke_proxy_ids,omitempty"` + RequireFullSnapshot bool `protobuf:"varint,3,opt,name=require_full_snapshot,json=requireFullSnapshot,proto3" json:"require_full_snapshot,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportRuntimeResponse) Reset() { + *x = ReportRuntimeResponse{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportRuntimeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportRuntimeResponse) ProtoMessage() {} + +func (x *ReportRuntimeResponse) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportRuntimeResponse.ProtoReflect.Descriptor instead. +func (*ReportRuntimeResponse) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{15} +} + +func (x *ReportRuntimeResponse) GetAcceptedOwnershipEpoch() uint64 { + if x != nil { + return x.AcceptedOwnershipEpoch + } + return 0 +} + +func (x *ReportRuntimeResponse) GetRevokeProxyIds() []string { + if x != nil { + return x.RevokeProxyIds + } + return nil +} + +func (x *ReportRuntimeResponse) GetRequireFullSnapshot() bool { + if x != nil { + return x.RequireFullSnapshot + } + return false +} + +type StreamCheckTasksRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + CheckerId string `protobuf:"bytes,1,opt,name=checker_id,json=checkerId,proto3" json:"checker_id,omitempty"` + InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + MaxInFlight uint32 `protobuf:"varint,3,opt,name=max_in_flight,json=maxInFlight,proto3" json:"max_in_flight,omitempty"` + SupportedLevels []CheckLevel `protobuf:"varint,4,rep,packed,name=supported_levels,json=supportedLevels,proto3,enum=proxy_pool.controlplane.v1.CheckLevel" json:"supported_levels,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StreamCheckTasksRequest) Reset() { + *x = StreamCheckTasksRequest{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StreamCheckTasksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamCheckTasksRequest) ProtoMessage() {} + +func (x *StreamCheckTasksRequest) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamCheckTasksRequest.ProtoReflect.Descriptor instead. +func (*StreamCheckTasksRequest) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{16} +} + +func (x *StreamCheckTasksRequest) GetCheckerId() string { + if x != nil { + return x.CheckerId + } + return "" +} + +func (x *StreamCheckTasksRequest) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *StreamCheckTasksRequest) GetMaxInFlight() uint32 { + if x != nil { + return x.MaxInFlight + } + return 0 +} + +func (x *StreamCheckTasksRequest) GetSupportedLevels() []CheckLevel { + if x != nil { + return x.SupportedLevels + } + return nil +} + +type CheckTask struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + ProxyId string `protobuf:"bytes,2,opt,name=proxy_id,json=proxyId,proto3" json:"proxy_id,omitempty"` + Protocol ProxyProtocol `protobuf:"varint,3,opt,name=protocol,proto3,enum=proxy_pool.controlplane.v1.ProxyProtocol" json:"protocol,omitempty"` + Host string `protobuf:"bytes,4,opt,name=host,proto3" json:"host,omitempty"` + Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` + SecretRef string `protobuf:"bytes,6,opt,name=secret_ref,json=secretRef,proto3" json:"secret_ref,omitempty"` + Level CheckLevel `protobuf:"varint,7,opt,name=level,proto3,enum=proxy_pool.controlplane.v1.CheckLevel" json:"level,omitempty"` + RoutingName string `protobuf:"bytes,8,opt,name=routing_name,json=routingName,proto3" json:"routing_name,omitempty"` + TargetUrl string `protobuf:"bytes,9,opt,name=target_url,json=targetUrl,proto3" json:"target_url,omitempty"` + Timeout *durationpb.Duration `protobuf:"bytes,10,opt,name=timeout,proto3" json:"timeout,omitempty"` + Attempt uint32 `protobuf:"varint,11,opt,name=attempt,proto3" json:"attempt,omitempty"` + Deadline *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=deadline,proto3" json:"deadline,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckTask) Reset() { + *x = CheckTask{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckTask) ProtoMessage() {} + +func (x *CheckTask) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckTask.ProtoReflect.Descriptor instead. +func (*CheckTask) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{17} +} + +func (x *CheckTask) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *CheckTask) GetProxyId() string { + if x != nil { + return x.ProxyId + } + return "" +} + +func (x *CheckTask) GetProtocol() ProxyProtocol { + if x != nil { + return x.Protocol + } + return ProxyProtocol_PROXY_PROTOCOL_UNSPECIFIED +} + +func (x *CheckTask) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *CheckTask) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *CheckTask) GetSecretRef() string { + if x != nil { + return x.SecretRef + } + return "" +} + +func (x *CheckTask) GetLevel() CheckLevel { + if x != nil { + return x.Level + } + return CheckLevel_CHECK_LEVEL_UNSPECIFIED +} + +func (x *CheckTask) GetRoutingName() string { + if x != nil { + return x.RoutingName + } + return "" +} + +func (x *CheckTask) GetTargetUrl() string { + if x != nil { + return x.TargetUrl + } + return "" +} + +func (x *CheckTask) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *CheckTask) GetAttempt() uint32 { + if x != nil { + return x.Attempt + } + return 0 +} + +func (x *CheckTask) GetDeadline() *timestamppb.Timestamp { + if x != nil { + return x.Deadline + } + return nil +} + +type ObservationBatch struct { + state protoimpl.MessageState `protogen:"open.v1"` + CheckerId string `protobuf:"bytes,1,opt,name=checker_id,json=checkerId,proto3" json:"checker_id,omitempty"` + Observations []*HealthObservation `protobuf:"bytes,2,rep,name=observations,proto3" json:"observations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ObservationBatch) Reset() { + *x = ObservationBatch{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ObservationBatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObservationBatch) ProtoMessage() {} + +func (x *ObservationBatch) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObservationBatch.ProtoReflect.Descriptor instead. +func (*ObservationBatch) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{18} +} + +func (x *ObservationBatch) GetCheckerId() string { + if x != nil { + return x.CheckerId + } + return "" +} + +func (x *ObservationBatch) GetObservations() []*HealthObservation { + if x != nil { + return x.Observations + } + return nil +} + +type HealthObservation struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + ProxyId string `protobuf:"bytes,2,opt,name=proxy_id,json=proxyId,proto3" json:"proxy_id,omitempty"` + Level CheckLevel `protobuf:"varint,3,opt,name=level,proto3,enum=proxy_pool.controlplane.v1.CheckLevel" json:"level,omitempty"` + RoutingName string `protobuf:"bytes,4,opt,name=routing_name,json=routingName,proto3" json:"routing_name,omitempty"` + TargetUrl string `protobuf:"bytes,5,opt,name=target_url,json=targetUrl,proto3" json:"target_url,omitempty"` + Success bool `protobuf:"varint,6,opt,name=success,proto3" json:"success,omitempty"` + FailureClass string `protobuf:"bytes,7,opt,name=failure_class,json=failureClass,proto3" json:"failure_class,omitempty"` + Latency *durationpb.Duration `protobuf:"bytes,8,opt,name=latency,proto3" json:"latency,omitempty"` + ObservedEgressIp string `protobuf:"bytes,9,opt,name=observed_egress_ip,json=observedEgressIp,proto3" json:"observed_egress_ip,omitempty"` + ObservedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=observed_at,json=observedAt,proto3" json:"observed_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HealthObservation) Reset() { + *x = HealthObservation{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HealthObservation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthObservation) ProtoMessage() {} + +func (x *HealthObservation) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthObservation.ProtoReflect.Descriptor instead. +func (*HealthObservation) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{19} +} + +func (x *HealthObservation) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *HealthObservation) GetProxyId() string { + if x != nil { + return x.ProxyId + } + return "" +} + +func (x *HealthObservation) GetLevel() CheckLevel { + if x != nil { + return x.Level + } + return CheckLevel_CHECK_LEVEL_UNSPECIFIED +} + +func (x *HealthObservation) GetRoutingName() string { + if x != nil { + return x.RoutingName + } + return "" +} + +func (x *HealthObservation) GetTargetUrl() string { + if x != nil { + return x.TargetUrl + } + return "" +} + +func (x *HealthObservation) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *HealthObservation) GetFailureClass() string { + if x != nil { + return x.FailureClass + } + return "" +} + +func (x *HealthObservation) GetLatency() *durationpb.Duration { + if x != nil { + return x.Latency + } + return nil +} + +func (x *HealthObservation) GetObservedEgressIp() string { + if x != nil { + return x.ObservedEgressIp + } + return "" +} + +func (x *HealthObservation) GetObservedAt() *timestamppb.Timestamp { + if x != nil { + return x.ObservedAt + } + return nil +} + +type ReportObservationsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Accepted uint32 `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"` + Rejected uint32 `protobuf:"varint,2,opt,name=rejected,proto3" json:"rejected,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportObservationsResponse) Reset() { + *x = ReportObservationsResponse{} + mi := &file_controlplane_v1_controlplane_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportObservationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportObservationsResponse) ProtoMessage() {} + +func (x *ReportObservationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_controlplane_v1_controlplane_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportObservationsResponse.ProtoReflect.Descriptor instead. +func (*ReportObservationsResponse) Descriptor() ([]byte, []int) { + return file_controlplane_v1_controlplane_proto_rawDescGZIP(), []int{20} +} + +func (x *ReportObservationsResponse) GetAccepted() uint32 { + if x != nil { + return x.Accepted + } + return 0 +} + +func (x *ReportObservationsResponse) GetRejected() uint32 { + if x != nil { + return x.Rejected + } + return 0 +} + +var File_controlplane_v1_controlplane_proto protoreflect.FileDescriptor + +const file_controlplane_v1_controlplane_proto_rawDesc = "" + + "\n" + + "\"controlplane/v1/controlplane.proto\x12\x1aproxy_pool.controlplane.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb9\x02\n" + + "\x15RegisterWorkerRequest\x12\x1b\n" + + "\tworker_id\x18\x01 \x01(\tR\bworkerId\x12\x1f\n" + + "\vinstance_id\x18\x02 \x01(\tR\n" + + "instanceId\x12\x12\n" + + "\x04zone\x18\x03 \x01(\tR\x04zone\x12<\n" + + "\x1asupported_protocol_version\x18\x04 \x01(\rR\x18supportedProtocolVersion\x12U\n" + + "\x06labels\x18\x05 \x03(\v2=.proxy_pool.controlplane.v1.RegisterWorkerRequest.LabelsEntryR\x06labels\x1a9\n" + + "\vLabelsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x86\x02\n" + + "\x16RegisterWorkerResponse\x12\x1b\n" + + "\tworker_id\x18\x01 \x01(\tR\bworkerId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12'\n" + + "\x0fownership_epoch\x18\x03 \x01(\x04R\x0eownershipEpoch\x12H\n" + + "\x12heartbeat_interval\x18\x04 \x01(\v2\x19.google.protobuf.DurationR\x11heartbeatInterval\x12=\n" + + "\rmax_stale_age\x18\x05 \x01(\v2\x19.google.protobuf.DurationR\vmaxStaleAge\"\xaa\x01\n" + + "\x15WatchSnapshotsRequest\x12\x1b\n" + + "\tworker_id\x18\x01 \x01(\tR\bworkerId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x120\n" + + "\x14last_applied_version\x18\x03 \x01(\x04R\x12lastAppliedVersion\x12#\n" + + "\rlast_checksum\x18\x04 \x01(\fR\flastChecksum\"\xa2\x01\n" + + "\x10SnapshotEnvelope\x12@\n" + + "\x04full\x18\x01 \x01(\v2*.proxy_pool.controlplane.v1.WorkerSnapshotH\x00R\x04full\x12A\n" + + "\x05delta\x18\x02 \x01(\v2).proxy_pool.controlplane.v1.SnapshotDeltaH\x00R\x05deltaB\t\n" + + "\apayload\"\xf0\x02\n" + + "\x0eWorkerSnapshot\x12\x18\n" + + "\aversion\x18\x01 \x01(\x04R\aversion\x12'\n" + + "\x0fownership_epoch\x18\x02 \x01(\x04R\x0eownershipEpoch\x12=\n" + + "\fgenerated_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\vgeneratedAt\x12;\n" + + "\vvalid_until\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "validUntil\x12\x1a\n" + + "\bchecksum\x18\x05 \x01(\fR\bchecksum\x12A\n" + + "\arouting\x18\x06 \x03(\v2'.proxy_pool.controlplane.v1.RoutingRuleR\arouting\x12@\n" + + "\aproxies\x18\a \x03(\v2&.proxy_pool.controlplane.v1.OwnedProxyR\aproxies\"\xd7\x03\n" + + "\rSnapshotDelta\x12!\n" + + "\fbase_version\x18\x01 \x01(\x04R\vbaseVersion\x12\x18\n" + + "\aversion\x18\x02 \x01(\x04R\aversion\x12'\n" + + "\x0fownership_epoch\x18\x03 \x01(\x04R\x0eownershipEpoch\x12=\n" + + "\fgenerated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\vgeneratedAt\x12\x1a\n" + + "\bchecksum\x18\x05 \x01(\fR\bchecksum\x12R\n" + + "\x10upserted_routing\x18\x06 \x03(\v2'.proxy_pool.controlplane.v1.RoutingRuleR\x0fupsertedRouting\x122\n" + + "\x15removed_routing_names\x18\a \x03(\tR\x13removedRoutingNames\x12Q\n" + + "\x10upserted_proxies\x18\b \x03(\v2&.proxy_pool.controlplane.v1.OwnedProxyR\x0fupsertedProxies\x12*\n" + + "\x11removed_proxy_ids\x18\t \x03(\tR\x0fremovedProxyIds\"\xdc\x03\n" + + "\vRoutingRule\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + + "\aenabled\x18\x02 \x01(\bR\aenabled\x12\x1d\n" + + "\n" + + "host_regex\x18\x03 \x01(\tR\thostRegex\x12\x18\n" + + "\amethods\x18\x04 \x03(\tR\amethods\x12\x1d\n" + + "\n" + + "path_regex\x18\x05 \x01(\tR\tpathRegex\x12N\n" + + "\aheaders\x18\x06 \x03(\v24.proxy_pool.controlplane.v1.RoutingRule.HeadersEntryR\aheaders\x12\x1c\n" + + "\tupstreams\x18\a \x03(\tR\tupstreams\x12G\n" + + "\bstrategy\x18\b \x01(\v2+.proxy_pool.controlplane.v1.RoutingStrategyR\bstrategy\x12T\n" + + "\x0eon_unavailable\x18\t \x01(\x0e2-.proxy_pool.controlplane.v1.UnavailableActionR\ronUnavailable\x1a:\n" + + "\fHeadersEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x8a\x02\n" + + "\x0fRoutingStrategy\x12<\n" + + "\x04type\x18\x01 \x01(\x0e2(.proxy_pool.controlplane.v1.StrategyTypeR\x04type\x12)\n" + + "\x10current_upstream\x18\x02 \x01(\tR\x0fcurrentUpstream\x12R\n" + + "\aweights\x18\x03 \x03(\v28.proxy_pool.controlplane.v1.RoutingStrategy.WeightsEntryR\aweights\x1a:\n" + + "\fWeightsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\rR\x05value:\x028\x01\"\xdc\x04\n" + + "\n" + + "OwnedProxy\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\bupstream\x18\x02 \x01(\tR\bupstream\x12E\n" + + "\bprotocol\x18\x03 \x01(\x0e2).proxy_pool.controlplane.v1.ProxyProtocolR\bprotocol\x12\x12\n" + + "\x04host\x18\x04 \x01(\tR\x04host\x12\x12\n" + + "\x04port\x18\x05 \x01(\rR\x04port\x12\x1a\n" + + "\busername\x18\x06 \x01(\tR\busername\x12-\n" + + "\x12credential_version\x18\a \x01(\tR\x11credentialVersion\x12\x1d\n" + + "\n" + + "secret_ref\x18\b \x01(\tR\tsecretRef\x129\n" + + "\n" + + "expires_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x12'\n" + + "\x0fmax_concurrency\x18\n" + + " \x01(\rR\x0emaxConcurrency\x12D\n" + + "\x04tags\x18\v \x03(\v20.proxy_pool.controlplane.v1.OwnedProxy.TagsEntryR\x04tags\x12'\n" + + "\x0fownership_epoch\x18\f \x01(\x04R\x0eownershipEpoch\x12=\n" + + "\fusable_until\x18\r \x01(\v2\x1a.google.protobuf.TimestampR\vusableUntil\x1a7\n" + + "\tTagsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x95\x02\n" + + "\x1aAcknowledgeSnapshotRequest\x12\x1b\n" + + "\tworker_id\x18\x01 \x01(\tR\bworkerId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12\x18\n" + + "\aversion\x18\x03 \x01(\x04R\aversion\x12'\n" + + "\x0fownership_epoch\x18\x04 \x01(\x04R\x0eownershipEpoch\x12\x1a\n" + + "\bchecksum\x18\x05 \x01(\fR\bchecksum\x12\x18\n" + + "\aapplied\x18\x06 \x01(\bR\aapplied\x12\x1d\n" + + "\n" + + "error_code\x18\a \x01(\tR\terrorCode\x12#\n" + + "\rerror_message\x18\b \x01(\tR\ferrorMessage\"\xac\x01\n" + + "\fOutcomeBatch\x12\x1b\n" + + "\tworker_id\x18\x01 \x01(\tR\bworkerId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12\x1a\n" + + "\bsequence\x18\x03 \x01(\x04R\bsequence\x12D\n" + + "\boutcomes\x18\x04 \x03(\v2(.proxy_pool.controlplane.v1.ProxyOutcomeR\boutcomes\"\xb9\x02\n" + + "\fProxyOutcome\x12\x19\n" + + "\bproxy_id\x18\x01 \x01(\tR\aproxyId\x12!\n" + + "\frouting_name\x18\x02 \x01(\tR\vroutingName\x12>\n" + + "\x05stage\x18\x03 \x01(\x0e2(.proxy_pool.controlplane.v1.OutcomeStageR\x05stage\x12\x18\n" + + "\asuccess\x18\x04 \x01(\bR\asuccess\x123\n" + + "\alatency\x18\x05 \x01(\v2\x19.google.protobuf.DurationR\alatency\x12\x1f\n" + + "\verror_class\x18\x06 \x01(\tR\n" + + "errorClass\x12;\n" + + "\vobserved_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "observedAt\"T\n" + + "\x16ReportOutcomesResponse\x12:\n" + + "\x19accepted_through_sequence\x18\x01 \x01(\x04R\x17acceptedThroughSequence\"\xd2\x02\n" + + "\x14ReportRuntimeRequest\x12\x1b\n" + + "\tworker_id\x18\x01 \x01(\tR\bworkerId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12)\n" + + "\x10snapshot_version\x18\x03 \x01(\x04R\x0fsnapshotVersion\x12'\n" + + "\x0fownership_epoch\x18\x04 \x01(\x04R\x0eownershipEpoch\x12D\n" + + "\bcounters\x18\x05 \x03(\v2(.proxy_pool.controlplane.v1.ProxyRuntimeR\bcounters\x12;\n" + + "\vobserved_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "observedAt\x12'\n" + + "\x0freport_sequence\x18\a \x01(\x04R\x0ereportSequence\"y\n" + + "\fProxyRuntime\x12\x19\n" + + "\bproxy_id\x18\x01 \x01(\tR\aproxyId\x12\x1a\n" + + "\breserved\x18\x02 \x01(\rR\breserved\x12\x16\n" + + "\x06active\x18\x03 \x01(\rR\x06active\x12\x1a\n" + + "\bdraining\x18\x04 \x01(\bR\bdraining\"\xaf\x01\n" + + "\x15ReportRuntimeResponse\x128\n" + + "\x18accepted_ownership_epoch\x18\x01 \x01(\x04R\x16acceptedOwnershipEpoch\x12(\n" + + "\x10revoke_proxy_ids\x18\x02 \x03(\tR\x0erevokeProxyIds\x122\n" + + "\x15require_full_snapshot\x18\x03 \x01(\bR\x13requireFullSnapshot\"\xd0\x01\n" + + "\x17StreamCheckTasksRequest\x12\x1d\n" + + "\n" + + "checker_id\x18\x01 \x01(\tR\tcheckerId\x12\x1f\n" + + "\vinstance_id\x18\x02 \x01(\tR\n" + + "instanceId\x12\"\n" + + "\rmax_in_flight\x18\x03 \x01(\rR\vmaxInFlight\x12Q\n" + + "\x10supported_levels\x18\x04 \x03(\x0e2&.proxy_pool.controlplane.v1.CheckLevelR\x0fsupportedLevels\"\xd4\x03\n" + + "\tCheckTask\x12\x17\n" + + "\atask_id\x18\x01 \x01(\tR\x06taskId\x12\x19\n" + + "\bproxy_id\x18\x02 \x01(\tR\aproxyId\x12E\n" + + "\bprotocol\x18\x03 \x01(\x0e2).proxy_pool.controlplane.v1.ProxyProtocolR\bprotocol\x12\x12\n" + + "\x04host\x18\x04 \x01(\tR\x04host\x12\x12\n" + + "\x04port\x18\x05 \x01(\rR\x04port\x12\x1d\n" + + "\n" + + "secret_ref\x18\x06 \x01(\tR\tsecretRef\x12<\n" + + "\x05level\x18\a \x01(\x0e2&.proxy_pool.controlplane.v1.CheckLevelR\x05level\x12!\n" + + "\frouting_name\x18\b \x01(\tR\vroutingName\x12\x1d\n" + + "\n" + + "target_url\x18\t \x01(\tR\ttargetUrl\x123\n" + + "\atimeout\x18\n" + + " \x01(\v2\x19.google.protobuf.DurationR\atimeout\x12\x18\n" + + "\aattempt\x18\v \x01(\rR\aattempt\x126\n" + + "\bdeadline\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\bdeadline\"\x84\x01\n" + + "\x10ObservationBatch\x12\x1d\n" + + "\n" + + "checker_id\x18\x01 \x01(\tR\tcheckerId\x12Q\n" + + "\fobservations\x18\x02 \x03(\v2-.proxy_pool.controlplane.v1.HealthObservationR\fobservations\"\xa6\x03\n" + + "\x11HealthObservation\x12\x17\n" + + "\atask_id\x18\x01 \x01(\tR\x06taskId\x12\x19\n" + + "\bproxy_id\x18\x02 \x01(\tR\aproxyId\x12<\n" + + "\x05level\x18\x03 \x01(\x0e2&.proxy_pool.controlplane.v1.CheckLevelR\x05level\x12!\n" + + "\frouting_name\x18\x04 \x01(\tR\vroutingName\x12\x1d\n" + + "\n" + + "target_url\x18\x05 \x01(\tR\ttargetUrl\x12\x18\n" + + "\asuccess\x18\x06 \x01(\bR\asuccess\x12#\n" + + "\rfailure_class\x18\a \x01(\tR\ffailureClass\x123\n" + + "\alatency\x18\b \x01(\v2\x19.google.protobuf.DurationR\alatency\x12,\n" + + "\x12observed_egress_ip\x18\t \x01(\tR\x10observedEgressIp\x12;\n" + + "\vobserved_at\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "observedAt\"T\n" + + "\x1aReportObservationsResponse\x12\x1a\n" + + "\baccepted\x18\x01 \x01(\rR\baccepted\x12\x1a\n" + + "\brejected\x18\x02 \x01(\rR\brejected*\xc5\x01\n" + + "\fStrategyType\x12\x1d\n" + + "\x19STRATEGY_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n" + + "\x18STRATEGY_TYPE_SEQUENTIAL\x10\x01\x12\x18\n" + + "\x14STRATEGY_TYPE_RANDOM\x10\x02\x12\x1d\n" + + "\x19STRATEGY_TYPE_ROUND_ROBIN\x10\x03\x12\x1a\n" + + "\x16STRATEGY_TYPE_WEIGHTED\x10\x04\x12#\n" + + "\x1fSTRATEGY_TYPE_LEAST_CONNECTIONS\x10\x05*\x92\x01\n" + + "\x11UnavailableAction\x12\"\n" + + "\x1eUNAVAILABLE_ACTION_UNSPECIFIED\x10\x00\x12\x1d\n" + + "\x19UNAVAILABLE_ACTION_REJECT\x10\x01\x12\x1b\n" + + "\x17UNAVAILABLE_ACTION_WAIT\x10\x02\x12\x1d\n" + + "\x19UNAVAILABLE_ACTION_DIRECT\x10\x03*}\n" + + "\rProxyProtocol\x12\x1e\n" + + "\x1aPROXY_PROTOCOL_UNSPECIFIED\x10\x00\x12\x17\n" + + "\x13PROXY_PROTOCOL_HTTP\x10\x01\x12\x18\n" + + "\x14PROXY_PROTOCOL_HTTPS\x10\x02\x12\x19\n" + + "\x15PROXY_PROTOCOL_SOCKS5\x10\x03*\xa6\x01\n" + + "\fOutcomeStage\x12\x1d\n" + + "\x19OUTCOME_STAGE_UNSPECIFIED\x10\x00\x12\x16\n" + + "\x12OUTCOME_STAGE_DIAL\x10\x01\x12!\n" + + "\x1dOUTCOME_STAGE_PROXY_HANDSHAKE\x10\x02\x12\"\n" + + "\x1eOUTCOME_STAGE_RESPONSE_HEADERS\x10\x03\x12\x18\n" + + "\x14OUTCOME_STAGE_TUNNEL\x10\x04*p\n" + + "\n" + + "CheckLevel\x12\x1b\n" + + "\x17CHECK_LEVEL_UNSPECIFIED\x10\x00\x12\x15\n" + + "\x11CHECK_LEVEL_BASIC\x10\x01\x12\x16\n" + + "\x12CHECK_LEVEL_EGRESS\x10\x02\x12\x16\n" + + "\x12CHECK_LEVEL_TARGET\x10\x032\xd1\x04\n" + + "\x12WorkerControlPlane\x12w\n" + + "\x0eRegisterWorker\x121.proxy_pool.controlplane.v1.RegisterWorkerRequest\x1a2.proxy_pool.controlplane.v1.RegisterWorkerResponse\x12s\n" + + "\x0eWatchSnapshots\x121.proxy_pool.controlplane.v1.WatchSnapshotsRequest\x1a,.proxy_pool.controlplane.v1.SnapshotEnvelope0\x01\x12e\n" + + "\x13AcknowledgeSnapshot\x126.proxy_pool.controlplane.v1.AcknowledgeSnapshotRequest\x1a\x16.google.protobuf.Empty\x12p\n" + + "\x0eReportOutcomes\x12(.proxy_pool.controlplane.v1.OutcomeBatch\x1a2.proxy_pool.controlplane.v1.ReportOutcomesResponse(\x01\x12t\n" + + "\rReportRuntime\x120.proxy_pool.controlplane.v1.ReportRuntimeRequest\x1a1.proxy_pool.controlplane.v1.ReportRuntimeResponse2\x83\x02\n" + + "\x13CheckerControlPlane\x12p\n" + + "\x10StreamCheckTasks\x123.proxy_pool.controlplane.v1.StreamCheckTasksRequest\x1a%.proxy_pool.controlplane.v1.CheckTask0\x01\x12z\n" + + "\x12ReportObservations\x12,.proxy_pool.controlplane.v1.ObservationBatch\x1a6.proxy_pool.controlplane.v1.ReportObservationsResponseB/Z-proxy-pool/gen/controlplane/v1;controlplanev1b\x06proto3" + +var ( + file_controlplane_v1_controlplane_proto_rawDescOnce sync.Once + file_controlplane_v1_controlplane_proto_rawDescData []byte +) + +func file_controlplane_v1_controlplane_proto_rawDescGZIP() []byte { + file_controlplane_v1_controlplane_proto_rawDescOnce.Do(func() { + file_controlplane_v1_controlplane_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_controlplane_v1_controlplane_proto_rawDesc), len(file_controlplane_v1_controlplane_proto_rawDesc))) + }) + return file_controlplane_v1_controlplane_proto_rawDescData +} + +var file_controlplane_v1_controlplane_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_controlplane_v1_controlplane_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_controlplane_v1_controlplane_proto_goTypes = []any{ + (StrategyType)(0), // 0: proxy_pool.controlplane.v1.StrategyType + (UnavailableAction)(0), // 1: proxy_pool.controlplane.v1.UnavailableAction + (ProxyProtocol)(0), // 2: proxy_pool.controlplane.v1.ProxyProtocol + (OutcomeStage)(0), // 3: proxy_pool.controlplane.v1.OutcomeStage + (CheckLevel)(0), // 4: proxy_pool.controlplane.v1.CheckLevel + (*RegisterWorkerRequest)(nil), // 5: proxy_pool.controlplane.v1.RegisterWorkerRequest + (*RegisterWorkerResponse)(nil), // 6: proxy_pool.controlplane.v1.RegisterWorkerResponse + (*WatchSnapshotsRequest)(nil), // 7: proxy_pool.controlplane.v1.WatchSnapshotsRequest + (*SnapshotEnvelope)(nil), // 8: proxy_pool.controlplane.v1.SnapshotEnvelope + (*WorkerSnapshot)(nil), // 9: proxy_pool.controlplane.v1.WorkerSnapshot + (*SnapshotDelta)(nil), // 10: proxy_pool.controlplane.v1.SnapshotDelta + (*RoutingRule)(nil), // 11: proxy_pool.controlplane.v1.RoutingRule + (*RoutingStrategy)(nil), // 12: proxy_pool.controlplane.v1.RoutingStrategy + (*OwnedProxy)(nil), // 13: proxy_pool.controlplane.v1.OwnedProxy + (*AcknowledgeSnapshotRequest)(nil), // 14: proxy_pool.controlplane.v1.AcknowledgeSnapshotRequest + (*OutcomeBatch)(nil), // 15: proxy_pool.controlplane.v1.OutcomeBatch + (*ProxyOutcome)(nil), // 16: proxy_pool.controlplane.v1.ProxyOutcome + (*ReportOutcomesResponse)(nil), // 17: proxy_pool.controlplane.v1.ReportOutcomesResponse + (*ReportRuntimeRequest)(nil), // 18: proxy_pool.controlplane.v1.ReportRuntimeRequest + (*ProxyRuntime)(nil), // 19: proxy_pool.controlplane.v1.ProxyRuntime + (*ReportRuntimeResponse)(nil), // 20: proxy_pool.controlplane.v1.ReportRuntimeResponse + (*StreamCheckTasksRequest)(nil), // 21: proxy_pool.controlplane.v1.StreamCheckTasksRequest + (*CheckTask)(nil), // 22: proxy_pool.controlplane.v1.CheckTask + (*ObservationBatch)(nil), // 23: proxy_pool.controlplane.v1.ObservationBatch + (*HealthObservation)(nil), // 24: proxy_pool.controlplane.v1.HealthObservation + (*ReportObservationsResponse)(nil), // 25: proxy_pool.controlplane.v1.ReportObservationsResponse + nil, // 26: proxy_pool.controlplane.v1.RegisterWorkerRequest.LabelsEntry + nil, // 27: proxy_pool.controlplane.v1.RoutingRule.HeadersEntry + nil, // 28: proxy_pool.controlplane.v1.RoutingStrategy.WeightsEntry + nil, // 29: proxy_pool.controlplane.v1.OwnedProxy.TagsEntry + (*durationpb.Duration)(nil), // 30: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 32: google.protobuf.Empty +} +var file_controlplane_v1_controlplane_proto_depIdxs = []int32{ + 26, // 0: proxy_pool.controlplane.v1.RegisterWorkerRequest.labels:type_name -> proxy_pool.controlplane.v1.RegisterWorkerRequest.LabelsEntry + 30, // 1: proxy_pool.controlplane.v1.RegisterWorkerResponse.heartbeat_interval:type_name -> google.protobuf.Duration + 30, // 2: proxy_pool.controlplane.v1.RegisterWorkerResponse.max_stale_age:type_name -> google.protobuf.Duration + 9, // 3: proxy_pool.controlplane.v1.SnapshotEnvelope.full:type_name -> proxy_pool.controlplane.v1.WorkerSnapshot + 10, // 4: proxy_pool.controlplane.v1.SnapshotEnvelope.delta:type_name -> proxy_pool.controlplane.v1.SnapshotDelta + 31, // 5: proxy_pool.controlplane.v1.WorkerSnapshot.generated_at:type_name -> google.protobuf.Timestamp + 31, // 6: proxy_pool.controlplane.v1.WorkerSnapshot.valid_until:type_name -> google.protobuf.Timestamp + 11, // 7: proxy_pool.controlplane.v1.WorkerSnapshot.routing:type_name -> proxy_pool.controlplane.v1.RoutingRule + 13, // 8: proxy_pool.controlplane.v1.WorkerSnapshot.proxies:type_name -> proxy_pool.controlplane.v1.OwnedProxy + 31, // 9: proxy_pool.controlplane.v1.SnapshotDelta.generated_at:type_name -> google.protobuf.Timestamp + 11, // 10: proxy_pool.controlplane.v1.SnapshotDelta.upserted_routing:type_name -> proxy_pool.controlplane.v1.RoutingRule + 13, // 11: proxy_pool.controlplane.v1.SnapshotDelta.upserted_proxies:type_name -> proxy_pool.controlplane.v1.OwnedProxy + 27, // 12: proxy_pool.controlplane.v1.RoutingRule.headers:type_name -> proxy_pool.controlplane.v1.RoutingRule.HeadersEntry + 12, // 13: proxy_pool.controlplane.v1.RoutingRule.strategy:type_name -> proxy_pool.controlplane.v1.RoutingStrategy + 1, // 14: proxy_pool.controlplane.v1.RoutingRule.on_unavailable:type_name -> proxy_pool.controlplane.v1.UnavailableAction + 0, // 15: proxy_pool.controlplane.v1.RoutingStrategy.type:type_name -> proxy_pool.controlplane.v1.StrategyType + 28, // 16: proxy_pool.controlplane.v1.RoutingStrategy.weights:type_name -> proxy_pool.controlplane.v1.RoutingStrategy.WeightsEntry + 2, // 17: proxy_pool.controlplane.v1.OwnedProxy.protocol:type_name -> proxy_pool.controlplane.v1.ProxyProtocol + 31, // 18: proxy_pool.controlplane.v1.OwnedProxy.expires_at:type_name -> google.protobuf.Timestamp + 29, // 19: proxy_pool.controlplane.v1.OwnedProxy.tags:type_name -> proxy_pool.controlplane.v1.OwnedProxy.TagsEntry + 31, // 20: proxy_pool.controlplane.v1.OwnedProxy.usable_until:type_name -> google.protobuf.Timestamp + 16, // 21: proxy_pool.controlplane.v1.OutcomeBatch.outcomes:type_name -> proxy_pool.controlplane.v1.ProxyOutcome + 3, // 22: proxy_pool.controlplane.v1.ProxyOutcome.stage:type_name -> proxy_pool.controlplane.v1.OutcomeStage + 30, // 23: proxy_pool.controlplane.v1.ProxyOutcome.latency:type_name -> google.protobuf.Duration + 31, // 24: proxy_pool.controlplane.v1.ProxyOutcome.observed_at:type_name -> google.protobuf.Timestamp + 19, // 25: proxy_pool.controlplane.v1.ReportRuntimeRequest.counters:type_name -> proxy_pool.controlplane.v1.ProxyRuntime + 31, // 26: proxy_pool.controlplane.v1.ReportRuntimeRequest.observed_at:type_name -> google.protobuf.Timestamp + 4, // 27: proxy_pool.controlplane.v1.StreamCheckTasksRequest.supported_levels:type_name -> proxy_pool.controlplane.v1.CheckLevel + 2, // 28: proxy_pool.controlplane.v1.CheckTask.protocol:type_name -> proxy_pool.controlplane.v1.ProxyProtocol + 4, // 29: proxy_pool.controlplane.v1.CheckTask.level:type_name -> proxy_pool.controlplane.v1.CheckLevel + 30, // 30: proxy_pool.controlplane.v1.CheckTask.timeout:type_name -> google.protobuf.Duration + 31, // 31: proxy_pool.controlplane.v1.CheckTask.deadline:type_name -> google.protobuf.Timestamp + 24, // 32: proxy_pool.controlplane.v1.ObservationBatch.observations:type_name -> proxy_pool.controlplane.v1.HealthObservation + 4, // 33: proxy_pool.controlplane.v1.HealthObservation.level:type_name -> proxy_pool.controlplane.v1.CheckLevel + 30, // 34: proxy_pool.controlplane.v1.HealthObservation.latency:type_name -> google.protobuf.Duration + 31, // 35: proxy_pool.controlplane.v1.HealthObservation.observed_at:type_name -> google.protobuf.Timestamp + 5, // 36: proxy_pool.controlplane.v1.WorkerControlPlane.RegisterWorker:input_type -> proxy_pool.controlplane.v1.RegisterWorkerRequest + 7, // 37: proxy_pool.controlplane.v1.WorkerControlPlane.WatchSnapshots:input_type -> proxy_pool.controlplane.v1.WatchSnapshotsRequest + 14, // 38: proxy_pool.controlplane.v1.WorkerControlPlane.AcknowledgeSnapshot:input_type -> proxy_pool.controlplane.v1.AcknowledgeSnapshotRequest + 15, // 39: proxy_pool.controlplane.v1.WorkerControlPlane.ReportOutcomes:input_type -> proxy_pool.controlplane.v1.OutcomeBatch + 18, // 40: proxy_pool.controlplane.v1.WorkerControlPlane.ReportRuntime:input_type -> proxy_pool.controlplane.v1.ReportRuntimeRequest + 21, // 41: proxy_pool.controlplane.v1.CheckerControlPlane.StreamCheckTasks:input_type -> proxy_pool.controlplane.v1.StreamCheckTasksRequest + 23, // 42: proxy_pool.controlplane.v1.CheckerControlPlane.ReportObservations:input_type -> proxy_pool.controlplane.v1.ObservationBatch + 6, // 43: proxy_pool.controlplane.v1.WorkerControlPlane.RegisterWorker:output_type -> proxy_pool.controlplane.v1.RegisterWorkerResponse + 8, // 44: proxy_pool.controlplane.v1.WorkerControlPlane.WatchSnapshots:output_type -> proxy_pool.controlplane.v1.SnapshotEnvelope + 32, // 45: proxy_pool.controlplane.v1.WorkerControlPlane.AcknowledgeSnapshot:output_type -> google.protobuf.Empty + 17, // 46: proxy_pool.controlplane.v1.WorkerControlPlane.ReportOutcomes:output_type -> proxy_pool.controlplane.v1.ReportOutcomesResponse + 20, // 47: proxy_pool.controlplane.v1.WorkerControlPlane.ReportRuntime:output_type -> proxy_pool.controlplane.v1.ReportRuntimeResponse + 22, // 48: proxy_pool.controlplane.v1.CheckerControlPlane.StreamCheckTasks:output_type -> proxy_pool.controlplane.v1.CheckTask + 25, // 49: proxy_pool.controlplane.v1.CheckerControlPlane.ReportObservations:output_type -> proxy_pool.controlplane.v1.ReportObservationsResponse + 43, // [43:50] is the sub-list for method output_type + 36, // [36:43] is the sub-list for method input_type + 36, // [36:36] is the sub-list for extension type_name + 36, // [36:36] is the sub-list for extension extendee + 0, // [0:36] is the sub-list for field type_name +} + +func init() { file_controlplane_v1_controlplane_proto_init() } +func file_controlplane_v1_controlplane_proto_init() { + if File_controlplane_v1_controlplane_proto != nil { + return + } + file_controlplane_v1_controlplane_proto_msgTypes[3].OneofWrappers = []any{ + (*SnapshotEnvelope_Full)(nil), + (*SnapshotEnvelope_Delta)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_controlplane_v1_controlplane_proto_rawDesc), len(file_controlplane_v1_controlplane_proto_rawDesc)), + NumEnums: 5, + NumMessages: 25, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_controlplane_v1_controlplane_proto_goTypes, + DependencyIndexes: file_controlplane_v1_controlplane_proto_depIdxs, + EnumInfos: file_controlplane_v1_controlplane_proto_enumTypes, + MessageInfos: file_controlplane_v1_controlplane_proto_msgTypes, + }.Build() + File_controlplane_v1_controlplane_proto = out.File + file_controlplane_v1_controlplane_proto_goTypes = nil + file_controlplane_v1_controlplane_proto_depIdxs = nil +} diff --git a/gen/controlplane/v1/controlplane_grpc.pb.go b/gen/controlplane/v1/controlplane_grpc.pb.go new file mode 100644 index 0000000..e86a7ea --- /dev/null +++ b/gen/controlplane/v1/controlplane_grpc.pb.go @@ -0,0 +1,429 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc v7.35.0 +// source: controlplane/v1/controlplane.proto + +package controlplanev1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + WorkerControlPlane_RegisterWorker_FullMethodName = "/proxy_pool.controlplane.v1.WorkerControlPlane/RegisterWorker" + WorkerControlPlane_WatchSnapshots_FullMethodName = "/proxy_pool.controlplane.v1.WorkerControlPlane/WatchSnapshots" + WorkerControlPlane_AcknowledgeSnapshot_FullMethodName = "/proxy_pool.controlplane.v1.WorkerControlPlane/AcknowledgeSnapshot" + WorkerControlPlane_ReportOutcomes_FullMethodName = "/proxy_pool.controlplane.v1.WorkerControlPlane/ReportOutcomes" + WorkerControlPlane_ReportRuntime_FullMethodName = "/proxy_pool.controlplane.v1.WorkerControlPlane/ReportRuntime" +) + +// WorkerControlPlaneClient is the client API for WorkerControlPlane 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. +// +// WorkerControlPlane distributes immutable, worker-specific snapshots. The +// gateway hot path does not call this service for individual requests. +type WorkerControlPlaneClient interface { + RegisterWorker(ctx context.Context, in *RegisterWorkerRequest, opts ...grpc.CallOption) (*RegisterWorkerResponse, error) + WatchSnapshots(ctx context.Context, in *WatchSnapshotsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SnapshotEnvelope], error) + AcknowledgeSnapshot(ctx context.Context, in *AcknowledgeSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + ReportOutcomes(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[OutcomeBatch, ReportOutcomesResponse], error) + ReportRuntime(ctx context.Context, in *ReportRuntimeRequest, opts ...grpc.CallOption) (*ReportRuntimeResponse, error) +} + +type workerControlPlaneClient struct { + cc grpc.ClientConnInterface +} + +func NewWorkerControlPlaneClient(cc grpc.ClientConnInterface) WorkerControlPlaneClient { + return &workerControlPlaneClient{cc} +} + +func (c *workerControlPlaneClient) RegisterWorker(ctx context.Context, in *RegisterWorkerRequest, opts ...grpc.CallOption) (*RegisterWorkerResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RegisterWorkerResponse) + err := c.cc.Invoke(ctx, WorkerControlPlane_RegisterWorker_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workerControlPlaneClient) WatchSnapshots(ctx context.Context, in *WatchSnapshotsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SnapshotEnvelope], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &WorkerControlPlane_ServiceDesc.Streams[0], WorkerControlPlane_WatchSnapshots_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[WatchSnapshotsRequest, SnapshotEnvelope]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type WorkerControlPlane_WatchSnapshotsClient = grpc.ServerStreamingClient[SnapshotEnvelope] + +func (c *workerControlPlaneClient) AcknowledgeSnapshot(ctx context.Context, in *AcknowledgeSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, WorkerControlPlane_AcknowledgeSnapshot_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workerControlPlaneClient) ReportOutcomes(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[OutcomeBatch, ReportOutcomesResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &WorkerControlPlane_ServiceDesc.Streams[1], WorkerControlPlane_ReportOutcomes_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[OutcomeBatch, ReportOutcomesResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type WorkerControlPlane_ReportOutcomesClient = grpc.ClientStreamingClient[OutcomeBatch, ReportOutcomesResponse] + +func (c *workerControlPlaneClient) ReportRuntime(ctx context.Context, in *ReportRuntimeRequest, opts ...grpc.CallOption) (*ReportRuntimeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ReportRuntimeResponse) + err := c.cc.Invoke(ctx, WorkerControlPlane_ReportRuntime_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WorkerControlPlaneServer is the server API for WorkerControlPlane service. +// All implementations must embed UnimplementedWorkerControlPlaneServer +// for forward compatibility. +// +// WorkerControlPlane distributes immutable, worker-specific snapshots. The +// gateway hot path does not call this service for individual requests. +type WorkerControlPlaneServer interface { + RegisterWorker(context.Context, *RegisterWorkerRequest) (*RegisterWorkerResponse, error) + WatchSnapshots(*WatchSnapshotsRequest, grpc.ServerStreamingServer[SnapshotEnvelope]) error + AcknowledgeSnapshot(context.Context, *AcknowledgeSnapshotRequest) (*emptypb.Empty, error) + ReportOutcomes(grpc.ClientStreamingServer[OutcomeBatch, ReportOutcomesResponse]) error + ReportRuntime(context.Context, *ReportRuntimeRequest) (*ReportRuntimeResponse, error) + mustEmbedUnimplementedWorkerControlPlaneServer() +} + +// UnimplementedWorkerControlPlaneServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedWorkerControlPlaneServer struct{} + +func (UnimplementedWorkerControlPlaneServer) RegisterWorker(context.Context, *RegisterWorkerRequest) (*RegisterWorkerResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RegisterWorker not implemented") +} +func (UnimplementedWorkerControlPlaneServer) WatchSnapshots(*WatchSnapshotsRequest, grpc.ServerStreamingServer[SnapshotEnvelope]) error { + return status.Error(codes.Unimplemented, "method WatchSnapshots not implemented") +} +func (UnimplementedWorkerControlPlaneServer) AcknowledgeSnapshot(context.Context, *AcknowledgeSnapshotRequest) (*emptypb.Empty, error) { + return nil, status.Error(codes.Unimplemented, "method AcknowledgeSnapshot not implemented") +} +func (UnimplementedWorkerControlPlaneServer) ReportOutcomes(grpc.ClientStreamingServer[OutcomeBatch, ReportOutcomesResponse]) error { + return status.Error(codes.Unimplemented, "method ReportOutcomes not implemented") +} +func (UnimplementedWorkerControlPlaneServer) ReportRuntime(context.Context, *ReportRuntimeRequest) (*ReportRuntimeResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ReportRuntime not implemented") +} +func (UnimplementedWorkerControlPlaneServer) mustEmbedUnimplementedWorkerControlPlaneServer() {} +func (UnimplementedWorkerControlPlaneServer) testEmbeddedByValue() {} + +// UnsafeWorkerControlPlaneServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WorkerControlPlaneServer will +// result in compilation errors. +type UnsafeWorkerControlPlaneServer interface { + mustEmbedUnimplementedWorkerControlPlaneServer() +} + +func RegisterWorkerControlPlaneServer(s grpc.ServiceRegistrar, srv WorkerControlPlaneServer) { + // If the following call panics, it indicates UnimplementedWorkerControlPlaneServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&WorkerControlPlane_ServiceDesc, srv) +} + +func _WorkerControlPlane_RegisterWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterWorkerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkerControlPlaneServer).RegisterWorker(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkerControlPlane_RegisterWorker_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkerControlPlaneServer).RegisterWorker(ctx, req.(*RegisterWorkerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkerControlPlane_WatchSnapshots_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(WatchSnapshotsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(WorkerControlPlaneServer).WatchSnapshots(m, &grpc.GenericServerStream[WatchSnapshotsRequest, SnapshotEnvelope]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type WorkerControlPlane_WatchSnapshotsServer = grpc.ServerStreamingServer[SnapshotEnvelope] + +func _WorkerControlPlane_AcknowledgeSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AcknowledgeSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkerControlPlaneServer).AcknowledgeSnapshot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkerControlPlane_AcknowledgeSnapshot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkerControlPlaneServer).AcknowledgeSnapshot(ctx, req.(*AcknowledgeSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkerControlPlane_ReportOutcomes_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(WorkerControlPlaneServer).ReportOutcomes(&grpc.GenericServerStream[OutcomeBatch, ReportOutcomesResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type WorkerControlPlane_ReportOutcomesServer = grpc.ClientStreamingServer[OutcomeBatch, ReportOutcomesResponse] + +func _WorkerControlPlane_ReportRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportRuntimeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkerControlPlaneServer).ReportRuntime(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkerControlPlane_ReportRuntime_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkerControlPlaneServer).ReportRuntime(ctx, req.(*ReportRuntimeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// WorkerControlPlane_ServiceDesc is the grpc.ServiceDesc for WorkerControlPlane service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var WorkerControlPlane_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proxy_pool.controlplane.v1.WorkerControlPlane", + HandlerType: (*WorkerControlPlaneServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RegisterWorker", + Handler: _WorkerControlPlane_RegisterWorker_Handler, + }, + { + MethodName: "AcknowledgeSnapshot", + Handler: _WorkerControlPlane_AcknowledgeSnapshot_Handler, + }, + { + MethodName: "ReportRuntime", + Handler: _WorkerControlPlane_ReportRuntime_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "WatchSnapshots", + Handler: _WorkerControlPlane_WatchSnapshots_Handler, + ServerStreams: true, + }, + { + StreamName: "ReportOutcomes", + Handler: _WorkerControlPlane_ReportOutcomes_Handler, + ClientStreams: true, + }, + }, + Metadata: "controlplane/v1/controlplane.proto", +} + +const ( + CheckerControlPlane_StreamCheckTasks_FullMethodName = "/proxy_pool.controlplane.v1.CheckerControlPlane/StreamCheckTasks" + CheckerControlPlane_ReportObservations_FullMethodName = "/proxy_pool.controlplane.v1.CheckerControlPlane/ReportObservations" +) + +// CheckerControlPlaneClient is the client API for CheckerControlPlane 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. +// +// CheckerControlPlane hands bounded check work to independently scalable +// checker processes. Observations are facts; only the Controller reducer may +// change authoritative proxy state. +type CheckerControlPlaneClient interface { + StreamCheckTasks(ctx context.Context, in *StreamCheckTasksRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CheckTask], error) + ReportObservations(ctx context.Context, in *ObservationBatch, opts ...grpc.CallOption) (*ReportObservationsResponse, error) +} + +type checkerControlPlaneClient struct { + cc grpc.ClientConnInterface +} + +func NewCheckerControlPlaneClient(cc grpc.ClientConnInterface) CheckerControlPlaneClient { + return &checkerControlPlaneClient{cc} +} + +func (c *checkerControlPlaneClient) StreamCheckTasks(ctx context.Context, in *StreamCheckTasksRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CheckTask], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &CheckerControlPlane_ServiceDesc.Streams[0], CheckerControlPlane_StreamCheckTasks_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[StreamCheckTasksRequest, CheckTask]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type CheckerControlPlane_StreamCheckTasksClient = grpc.ServerStreamingClient[CheckTask] + +func (c *checkerControlPlaneClient) ReportObservations(ctx context.Context, in *ObservationBatch, opts ...grpc.CallOption) (*ReportObservationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ReportObservationsResponse) + err := c.cc.Invoke(ctx, CheckerControlPlane_ReportObservations_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CheckerControlPlaneServer is the server API for CheckerControlPlane service. +// All implementations must embed UnimplementedCheckerControlPlaneServer +// for forward compatibility. +// +// CheckerControlPlane hands bounded check work to independently scalable +// checker processes. Observations are facts; only the Controller reducer may +// change authoritative proxy state. +type CheckerControlPlaneServer interface { + StreamCheckTasks(*StreamCheckTasksRequest, grpc.ServerStreamingServer[CheckTask]) error + ReportObservations(context.Context, *ObservationBatch) (*ReportObservationsResponse, error) + mustEmbedUnimplementedCheckerControlPlaneServer() +} + +// UnimplementedCheckerControlPlaneServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedCheckerControlPlaneServer struct{} + +func (UnimplementedCheckerControlPlaneServer) StreamCheckTasks(*StreamCheckTasksRequest, grpc.ServerStreamingServer[CheckTask]) error { + return status.Error(codes.Unimplemented, "method StreamCheckTasks not implemented") +} +func (UnimplementedCheckerControlPlaneServer) ReportObservations(context.Context, *ObservationBatch) (*ReportObservationsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ReportObservations not implemented") +} +func (UnimplementedCheckerControlPlaneServer) mustEmbedUnimplementedCheckerControlPlaneServer() {} +func (UnimplementedCheckerControlPlaneServer) testEmbeddedByValue() {} + +// UnsafeCheckerControlPlaneServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CheckerControlPlaneServer will +// result in compilation errors. +type UnsafeCheckerControlPlaneServer interface { + mustEmbedUnimplementedCheckerControlPlaneServer() +} + +func RegisterCheckerControlPlaneServer(s grpc.ServiceRegistrar, srv CheckerControlPlaneServer) { + // If the following call panics, it indicates UnimplementedCheckerControlPlaneServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&CheckerControlPlane_ServiceDesc, srv) +} + +func _CheckerControlPlane_StreamCheckTasks_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamCheckTasksRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(CheckerControlPlaneServer).StreamCheckTasks(m, &grpc.GenericServerStream[StreamCheckTasksRequest, CheckTask]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type CheckerControlPlane_StreamCheckTasksServer = grpc.ServerStreamingServer[CheckTask] + +func _CheckerControlPlane_ReportObservations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ObservationBatch) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CheckerControlPlaneServer).ReportObservations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CheckerControlPlane_ReportObservations_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CheckerControlPlaneServer).ReportObservations(ctx, req.(*ObservationBatch)) + } + return interceptor(ctx, in, info, handler) +} + +// CheckerControlPlane_ServiceDesc is the grpc.ServiceDesc for CheckerControlPlane service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var CheckerControlPlane_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proxy_pool.controlplane.v1.CheckerControlPlane", + HandlerType: (*CheckerControlPlaneServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ReportObservations", + Handler: _CheckerControlPlane_ReportObservations_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamCheckTasks", + Handler: _CheckerControlPlane_StreamCheckTasks_Handler, + ServerStreams: true, + }, + }, + Metadata: "controlplane/v1/controlplane.proto", +} diff --git a/go.mod b/go.mod index 9cf3003..5cadf5d 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,8 @@ require ( github.com/prometheus/client_golang v1.24.1 github.com/redis/go-redis/v9 v9.19.0 go.yaml.in/yaml/v4 v4.0.0-rc.3 + google.golang.org/grpc v1.83.0 + google.golang.org/protobuf v1.36.11 ) require ( @@ -20,9 +22,16 @@ require ( github.com/prometheus/common v0.70.1 // indirect github.com/prometheus/procfs v0.21.1 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/crypto v0.17.0 // indirect + golang.org/x/crypto v0.54.0 // indirect + golang.org/x/net v0.57.0 // indirect golang.org/x/sync v0.22.0 // indirect golang.org/x/sys v0.47.0 // indirect golang.org/x/text v0.40.0 // indirect - google.golang.org/protobuf v1.36.11 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 // indirect +) + +tool ( + google.golang.org/grpc/cmd/protoc-gen-go-grpc + google.golang.org/protobuf/cmd/protoc-gen-go ) diff --git a/go.sum b/go.sum index 36873af..8f800db 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,16 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= @@ -46,6 +54,18 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs= github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= +go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= +go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -54,14 +74,24 @@ go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v4 v4.0.0-rc.3 h1:3h1fjsh1CTAPjW7q/EMe+C8shx5d8ctzZTrLcs/j8Go= go.yaml.in/yaml/v4 v4.0.0-rc.3/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= +golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.83.0 h1:JeNZEKJFbQxArAMl+hiytHauacDNqJUllNfmIMmpqnQ= +google.golang.org/grpc v1.83.0/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 h1:rgSNvqscFZ1JgV/4wH5GOsZFSFkR2Eua9As3KIr2LlM= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2/go.mod h1:iMEtFwDlAhjDU9L5mY6U1XLwlIId/G3h+QcBHDIvrJ8= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/scripts/generate-proto.ps1 b/scripts/generate-proto.ps1 new file mode 100644 index 0000000..e3da104 --- /dev/null +++ b/scripts/generate-proto.ps1 @@ -0,0 +1,62 @@ +param( + [string]$Protoc = "", + [string]$IncludePath = $env:PROTOC_INCLUDE, + [string]$OutputRoot = "" +) + +$ErrorActionPreference = "Stop" + +$repositoryRoot = Split-Path -Parent $PSScriptRoot +$protoRoot = Join-Path $repositoryRoot "api/proto" +$source = Join-Path $protoRoot "controlplane/v1/controlplane.proto" +$toolRoot = Join-Path $repositoryRoot ".tmp-proto/tools" +New-Item -ItemType Directory -Force -Path $toolRoot | Out-Null + +if ([string]::IsNullOrWhiteSpace($Protoc)) { + $Protoc = & (Join-Path $PSScriptRoot "install-protoc.ps1") +} + +$runningWindows = [System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform( + [System.Runtime.InteropServices.OSPlatform]::Windows +) +$suffix = if ($runningWindows) { ".exe" } else { "" } +$protocGenGo = Join-Path $toolRoot ("protoc-gen-go" + $suffix) +$protocGenGoGRPC = Join-Path $toolRoot ("protoc-gen-go-grpc" + $suffix) + +go build -o $protocGenGo google.golang.org/protobuf/cmd/protoc-gen-go +if ($LASTEXITCODE -ne 0) { throw "build protoc-gen-go failed" } +go build -o $protocGenGoGRPC google.golang.org/grpc/cmd/protoc-gen-go-grpc +if ($LASTEXITCODE -ne 0) { throw "build protoc-gen-go-grpc failed" } + +$protocCommand = Get-Command $Protoc -ErrorAction Stop +$protocVersion = (& $protocCommand.Source --version).Trim() +if ($protocVersion -ne "libprotoc 35.0") { throw "protoc 35.0 is required" } + +if ([string]::IsNullOrWhiteSpace($IncludePath)) { + $installationRoot = Split-Path (Split-Path $protocCommand.Source -Parent) -Parent + $IncludePath = @( + (Join-Path $installationRoot "include"), + "/usr/include", + "/usr/local/include" + ) | + Where-Object { Test-Path (Join-Path $_ "google/protobuf/timestamp.proto") } | + Select-Object -First 1 +} +if ([string]::IsNullOrWhiteSpace($OutputRoot)) { $OutputRoot = $repositoryRoot } +if ([string]::IsNullOrWhiteSpace($IncludePath) -or + -not (Test-Path (Join-Path $IncludePath "google/protobuf/timestamp.proto"))) { + throw "protoc well-known type include directory was not found" +} +New-Item -ItemType Directory -Force -Path $OutputRoot | Out-Null + +& $protocCommand.Source ` + "--proto_path=$protoRoot" ` + "--proto_path=$IncludePath" ` + "--plugin=protoc-gen-go=$protocGenGo" ` + "--plugin=protoc-gen-go-grpc=$protocGenGoGRPC" ` + "--go_out=$OutputRoot" ` + "--go_opt=module=proxy-pool" ` + "--go-grpc_out=$OutputRoot" ` + "--go-grpc_opt=module=proxy-pool" ` + $source +if ($LASTEXITCODE -ne 0) { throw "protobuf Go generation failed" } diff --git a/scripts/install-protoc.ps1 b/scripts/install-protoc.ps1 new file mode 100644 index 0000000..060ce23 --- /dev/null +++ b/scripts/install-protoc.ps1 @@ -0,0 +1,61 @@ +param() + +$ErrorActionPreference = "Stop" + +$repositoryRoot = Split-Path -Parent $PSScriptRoot +$runtime = [System.Runtime.InteropServices.RuntimeInformation] +$runningWindows = $runtime::IsOSPlatform([System.Runtime.InteropServices.OSPlatform]::Windows) +$runningLinux = $runtime::IsOSPlatform([System.Runtime.InteropServices.OSPlatform]::Linux) + +if ($runtime::OSArchitecture -ne [System.Runtime.InteropServices.Architecture]::X64) { + throw "protoc bootstrap supports x64 only" +} + +if ($runningWindows) { + $asset = "protoc-35.0-win64.zip" + $expectedHash = "d1cede9e308cc3eb072392af1c02ccae4bdd3d2f374ec2970dbd8cdfdaa91363" + $executableName = "protoc.exe" +} +elseif ($runningLinux) { + $asset = "protoc-35.0-linux-x86_64.zip" + $expectedHash = "a45cda0989c17dd950db55f6fbe1e5814c50fda08e87aa422980ac1f89dddbbc" + $executableName = "protoc" +} +else { + throw "protoc bootstrap supports Windows x64 and Linux x64 only" +} + +$cacheDirectory = Join-Path $repositoryRoot ".tmp-proto/downloads" +$installationDirectory = Join-Path $repositoryRoot ".tmp-proto/protoc-35.0" +$archivePath = Join-Path $cacheDirectory $asset +$downloadURL = "https://github.com/protocolbuffers/protobuf/releases/download/v35.0/$asset" +New-Item -ItemType Directory -Force -Path $cacheDirectory | Out-Null + +$needsDownload = -not (Test-Path -LiteralPath $archivePath) +if (-not $needsDownload) { + $actualHash = (Get-FileHash -LiteralPath $archivePath -Algorithm SHA256).Hash.ToLowerInvariant() + $needsDownload = $actualHash -ne $expectedHash +} +if ($needsDownload) { + Invoke-WebRequest -Uri $downloadURL -OutFile $archivePath +} + +$actualHash = (Get-FileHash -LiteralPath $archivePath -Algorithm SHA256).Hash.ToLowerInvariant() +if ($actualHash -ne $expectedHash) { + throw "protoc archive SHA-256 mismatch" +} + +New-Item -ItemType Directory -Force -Path $installationDirectory | Out-Null +Expand-Archive -LiteralPath $archivePath -DestinationPath $installationDirectory -Force + +$protocPath = Join-Path $installationDirectory "bin/$executableName" +if (-not (Test-Path -LiteralPath $protocPath)) { + throw "protoc executable was not extracted" +} + +$version = (& $protocPath --version).Trim() +if ($version -ne "libprotoc 35.0") { + throw "protoc version mismatch: $version" +} + +(Resolve-Path -LiteralPath $protocPath).Path diff --git a/scripts/verify-proto.ps1 b/scripts/verify-proto.ps1 index 50b8cfd..13e18cc 100644 --- a/scripts/verify-proto.ps1 +++ b/scripts/verify-proto.ps1 @@ -1,5 +1,5 @@ param( - [string]$Protoc = "protoc", + [string]$Protoc = "", [string]$IncludePath = $env:PROTOC_INCLUDE, [string]$OutputPath = "" ) @@ -10,7 +10,14 @@ $repositoryRoot = Split-Path -Parent $PSScriptRoot $protoRoot = Join-Path $repositoryRoot "api/proto" $source = Join-Path $protoRoot "controlplane/v1/controlplane.proto" +if ([string]::IsNullOrWhiteSpace($Protoc)) { + $Protoc = & (Join-Path $PSScriptRoot "install-protoc.ps1") +} $protocCommand = Get-Command $Protoc -ErrorAction Stop +$protocVersion = (& $protocCommand.Source --version).Trim() +if ($protocVersion -ne "libprotoc 35.0") { + throw "protoc 35.0 is required" +} if ([string]::IsNullOrWhiteSpace($IncludePath)) { $installationRoot = Split-Path (Split-Path $protocCommand.Source -Parent) -Parent $candidates = @( @@ -49,3 +56,25 @@ if ($descriptor.Length -le 0) { throw "protoc produced an empty descriptor set" } Write-Host "descriptor: $($descriptor.FullName) ($($descriptor.Length) bytes)" + +$outputRoot = Join-Path $repositoryRoot ".tmp-proto/generated" +& (Join-Path $PSScriptRoot "generate-proto.ps1") ` + -Protoc $protocCommand.Source ` + -IncludePath $IncludePath ` + -OutputRoot $outputRoot + +$generated = @( + "gen/controlplane/v1/controlplane.pb.go", + "gen/controlplane/v1/controlplane_grpc.pb.go" +) +foreach ($relative in $generated) { + $committed = Join-Path $repositoryRoot $relative + $candidate = Join-Path $outputRoot $relative + if (-not (Test-Path -LiteralPath $committed) -or + -not (Test-Path -LiteralPath $candidate) -or + -not [System.Linq.Enumerable]::SequenceEqual( + [System.IO.File]::ReadAllBytes($committed), + [System.IO.File]::ReadAllBytes($candidate))) { + throw "generated protobuf drift: $relative" + } +} diff --git a/scripts/verify.ps1 b/scripts/verify.ps1 index 3a1a782..9fb97d2 100644 --- a/scripts/verify.ps1 +++ b/scripts/verify.ps1 @@ -22,12 +22,7 @@ if ($unformatted) { Invoke-Step "go vet" { go vet ./... } Invoke-Step "unit tests" { go test -timeout 60s ./... } -if (Get-Command protoc -ErrorAction SilentlyContinue) { - Invoke-Step "protobuf descriptor" { & (Join-Path $PSScriptRoot "verify-proto.ps1") } -} -else { - Write-Host "==> protobuf descriptor skipped: protoc is not installed" -} +Invoke-Step "protobuf contracts" { & (Join-Path $PSScriptRoot "verify-proto.ps1") } if ((go env CGO_ENABLED) -eq "1") { Invoke-Step "race tests" { go test -race -timeout 60s ./internal/... }