Documentation
¶
Overview ¶
Package labelsyncmapping is a generated GoMock package.
Package labelsyncmapping is a generated GoMock package.
Index ¶
- Constants
- Variables
- func CreateLabelSyncMappingFromInitialManifest(ctx context.Context, svc Service, orgID uuid.UUID, ...) (*domain.LabelSyncMapping, domain.Status)
- func CreateLabelSyncMappingFromUntrusted(ctx context.Context, svc Service, orgID uuid.UUID, ...) (*domain.LabelSyncMapping, domain.Status)
- func ReadInitialLabelSyncMappingEntries(filePath string) ([]json.RawMessage, error)
- func ReplaceLabelSyncMappingFromUntrusted(ctx context.Context, svc Service, orgID uuid.UUID, name string, ...) (*domain.LabelSyncMapping, domain.Status)
- func SanitizeLabelSyncMapping(mapping *domain.LabelSyncMapping)
- type Activation
- type Evaluator
- type InitialLabelSyncMappingProvisioner
- func (p *InitialLabelSyncMappingProvisioner) Provision(ctx context.Context, orgID uuid.UUID)
- func (p *InitialLabelSyncMappingProvisioner) ProvisionEntriesForOrganizations(ctx context.Context, orgIDs []uuid.UUID, entries []json.RawMessage)
- func (p *InitialLabelSyncMappingProvisioner) ProvisionForOrganizations(ctx context.Context, orgIDs []uuid.UUID)
- type MapResult
- type MappingOutcome
- type MappingScanToken
- type MockReconciliationDeviceStore
- func (m *MockReconciliationDeviceStore) ApplyLabels(arg0 context.Context, arg1 uuid.UUID, arg2 string, ...) (domain.DeviceLabelApplyResult, error)
- func (m *MockReconciliationDeviceStore) EXPECT() *MockReconciliationDeviceStoreMockRecorder
- func (m *MockReconciliationDeviceStore) GetLabelSnapshot(arg0 context.Context, arg1 uuid.UUID, arg2 string) (domain.DeviceLabelSnapshot, error)
- func (m *MockReconciliationDeviceStore) GetLabelSyncMappingIDsByKeys(arg0 context.Context, arg1 uuid.UUID, arg2 []string) (map[string][]uuid.UUID, error)
- type MockReconciliationDeviceStoreMockRecorder
- func (mr *MockReconciliationDeviceStoreMockRecorder) ApplyLabels(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call
- func (mr *MockReconciliationDeviceStoreMockRecorder) GetLabelSnapshot(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockReconciliationDeviceStoreMockRecorder) GetLabelSyncMappingIDsByKeys(arg0, arg1, arg2 any) *gomock.Call
- type MockService
- func (m *MockService) CompleteMappingScan(arg0 context.Context, arg1 uuid.UUID, arg2 []MappingScanToken) (map[uuid.UUID]bool, error)
- func (m *MockService) CreateLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
- func (m *MockService) DeleteLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 string) domain.Status
- func (m *MockService) EXPECT() *MockServiceMockRecorder
- func (m *MockService) GetDeviceLabelSyncProvenance(arg0 context.Context, arg1 uuid.UUID, arg2 string) (*domain.LabelSyncProvenanceList, domain.Status)
- func (m *MockService) GetLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 string) (*domain.LabelSyncMapping, domain.Status)
- func (m *MockService) GetLabelSyncProvenance(arg0 context.Context, arg1 uuid.UUID, arg2 []string) (*domain.LabelSyncProvenanceList, domain.Status)
- func (m *MockService) ListLabelSyncMappings(arg0 context.Context, arg1 uuid.UUID, arg2 domain.ListLabelSyncMappingsParams) (*domain.LabelSyncMappingList, domain.Status)
- func (m *MockService) ListMappingScanTargets(arg0 context.Context, arg1 uuid.UUID) ([]MappingScanToken, error)
- func (m *MockService) PatchLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 string, arg3 domain.PatchRequest) (*domain.LabelSyncMapping, domain.Status)
- func (m *MockService) ReconcileDeviceLabels(arg0 context.Context, arg1 uuid.UUID, arg2 string) (ReconciliationResult, error)
- func (m *MockService) RecordMappingScanFailure(arg0 context.Context, arg1 uuid.UUID, arg2 MappingScanToken, arg3 string) (MappingScanToken, bool, error)
- func (m *MockService) ReplaceLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 string, ...) (*domain.LabelSyncMapping, domain.Status)
- type MockServiceMockRecorder
- func (mr *MockServiceMockRecorder) CompleteMappingScan(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServiceMockRecorder) CreateLabelSyncMapping(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServiceMockRecorder) DeleteLabelSyncMapping(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetDeviceLabelSyncProvenance(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetLabelSyncMapping(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServiceMockRecorder) GetLabelSyncProvenance(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServiceMockRecorder) ListLabelSyncMappings(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServiceMockRecorder) ListMappingScanTargets(arg0, arg1 any) *gomock.Call
- func (mr *MockServiceMockRecorder) PatchLabelSyncMapping(arg0, arg1, arg2, arg3 any) *gomock.Call
- func (mr *MockServiceMockRecorder) ReconcileDeviceLabels(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServiceMockRecorder) RecordMappingScanFailure(arg0, arg1, arg2, arg3 any) *gomock.Call
- func (mr *MockServiceMockRecorder) ReplaceLabelSyncMapping(arg0, arg1, arg2, arg3 any) *gomock.Call
- type NoResult
- type ReconciliationDeviceStore
- type ReconciliationResult
- type Result
- type ResultKind
- type ScalarResult
- type Service
- type ServiceHandler
- func (h *ServiceHandler) CompleteMappingScan(ctx context.Context, orgID uuid.UUID, tokens []MappingScanToken) (map[uuid.UUID]bool, error)
- func (h *ServiceHandler) CreateLabelSyncMapping(ctx context.Context, orgID uuid.UUID, mapping domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
- func (h *ServiceHandler) DeleteLabelSyncMapping(ctx context.Context, orgID uuid.UUID, name string) domain.Status
- func (h *ServiceHandler) GetDeviceLabelSyncProvenance(ctx context.Context, orgID uuid.UUID, deviceName string) (*domain.LabelSyncProvenanceList, domain.Status)
- func (h *ServiceHandler) GetLabelSyncMapping(ctx context.Context, orgID uuid.UUID, name string) (*domain.LabelSyncMapping, domain.Status)
- func (h *ServiceHandler) GetLabelSyncProvenance(ctx context.Context, orgID uuid.UUID, labelKeys []string) (*domain.LabelSyncProvenanceList, domain.Status)
- func (h *ServiceHandler) ListLabelSyncMappings(ctx context.Context, orgID uuid.UUID, ...) (*domain.LabelSyncMappingList, domain.Status)
- func (h *ServiceHandler) ListMappingScanTargets(ctx context.Context, orgID uuid.UUID) ([]MappingScanToken, error)
- func (h *ServiceHandler) PatchLabelSyncMapping(ctx context.Context, orgID uuid.UUID, name string, patch domain.PatchRequest) (*domain.LabelSyncMapping, domain.Status)
- func (h *ServiceHandler) ReconcileDeviceLabels(ctx context.Context, orgID uuid.UUID, deviceName string) (ReconciliationResult, error)
- func (h *ServiceHandler) RecordMappingScanFailure(ctx context.Context, orgID uuid.UUID, token MappingScanToken, message string) (MappingScanToken, bool, error)
- func (h *ServiceHandler) ReplaceLabelSyncMapping(ctx context.Context, orgID uuid.UUID, name string, ...) (*domain.LabelSyncMapping, domain.Status)
- type TracedService
- func (_d *TracedService) CompleteMappingScan(ctx context.Context, u1 uuid.UUID, ma1 []MappingScanToken) (m1 map[uuid.UUID]bool, err error)
- func (_d *TracedService) CreateLabelSyncMapping(ctx context.Context, u1 uuid.UUID, l1 domain.LabelSyncMapping) (lp1 *domain.LabelSyncMapping, s1 domain.Status)
- func (_d *TracedService) DeleteLabelSyncMapping(ctx context.Context, u1 uuid.UUID, s1 string) (s2 domain.Status)
- func (_d *TracedService) GetDeviceLabelSyncProvenance(ctx context.Context, u1 uuid.UUID, s1 string) (lp1 *domain.LabelSyncProvenanceList, s2 domain.Status)
- func (_d *TracedService) GetLabelSyncMapping(ctx context.Context, u1 uuid.UUID, s1 string) (lp1 *domain.LabelSyncMapping, s2 domain.Status)
- func (_d *TracedService) GetLabelSyncProvenance(ctx context.Context, u1 uuid.UUID, sa1 []string) (lp1 *domain.LabelSyncProvenanceList, s1 domain.Status)
- func (_d *TracedService) ListLabelSyncMappings(ctx context.Context, u1 uuid.UUID, l1 domain.ListLabelSyncMappingsParams) (lp1 *domain.LabelSyncMappingList, s1 domain.Status)
- func (_d *TracedService) ListMappingScanTargets(ctx context.Context, u1 uuid.UUID) (ma1 []MappingScanToken, err error)
- func (_d *TracedService) PatchLabelSyncMapping(ctx context.Context, u1 uuid.UUID, s1 string, p1 domain.PatchRequest) (lp1 *domain.LabelSyncMapping, s2 domain.Status)
- func (_d *TracedService) ReconcileDeviceLabels(ctx context.Context, u1 uuid.UUID, s1 string) (r1 ReconciliationResult, err error)
- func (_d *TracedService) RecordMappingScanFailure(ctx context.Context, u1 uuid.UUID, m1 MappingScanToken, s1 string) (m2 MappingScanToken, b1 bool, err error)
- func (_d *TracedService) ReplaceLabelSyncMapping(ctx context.Context, u1 uuid.UUID, s1 string, l1 domain.LabelSyncMapping) (lp1 *domain.LabelSyncMapping, s2 domain.Status)
Constants ¶
const MaxProvenanceLabelKeys = 50
MaxProvenanceLabelKeys is the maximum number of exact label keys accepted by one organization query.
Variables ¶
var ErrConditionPersistence = errors.New("label reconciliation condition was not persisted")
ErrConditionPersistence distinguishes an unrecorded result from a device failure. A scan must retain its page when the result cannot be persisted.
Functions ¶
func CreateLabelSyncMappingFromInitialManifest ¶
func CreateLabelSyncMappingFromInitialManifest(ctx context.Context, svc Service, orgID uuid.UUID, mapping domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
CreateLabelSyncMappingFromInitialManifest strips server-managed fields while retaining operator-provided annotations from the trusted deployment configuration.
func CreateLabelSyncMappingFromUntrusted ¶
func CreateLabelSyncMappingFromUntrusted(ctx context.Context, svc Service, orgID uuid.UUID, mapping domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
CreateLabelSyncMappingFromUntrusted sanitizes an untrusted document before creation.
func ReadInitialLabelSyncMappingEntries ¶
func ReadInitialLabelSyncMappingEntries(filePath string) ([]json.RawMessage, error)
ReadInitialLabelSyncMappingEntries reads and validates the manifest's top-level YAML sequence. Individual entries are decoded during provisioning so a malformed entry does not block later ones.
func ReplaceLabelSyncMappingFromUntrusted ¶
func ReplaceLabelSyncMappingFromUntrusted(ctx context.Context, svc Service, orgID uuid.UUID, name string, mapping domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
ReplaceLabelSyncMappingFromUntrusted sanitizes an untrusted document before replacement.
func SanitizeLabelSyncMapping ¶
func SanitizeLabelSyncMapping(mapping *domain.LabelSyncMapping)
SanitizeLabelSyncMapping clears status and managed metadata from an untrusted document.
Types ¶
type Activation ¶
type Activation interface{}
Activation is a value passed to CEL when evaluating an expression.
func ActivateDevice ¶
func ActivateDevice(device domain.Device) (Activation, error)
ActivateDevice builds a CEL activation from the supported device roots.
type Evaluator ¶
type Evaluator interface {
ValidateExpressionIs(expression string, expectedKind ResultKind) error
// Evaluate evaluates an expression using a prebuilt activation.
Evaluate(expression string, activation Activation) (Result, error)
}
func NewEvaluator ¶
type InitialLabelSyncMappingProvisioner ¶
type InitialLabelSyncMappingProvisioner struct {
// contains filtered or unexported fields
}
InitialLabelSyncMappingProvisioner applies a deployment-provided mapping sequence.
func NewInitialLabelSyncMappingProvisioner ¶
func NewInitialLabelSyncMappingProvisioner(filePath string, service Service, log logrus.FieldLogger) (*InitialLabelSyncMappingProvisioner, error)
NewInitialLabelSyncMappingProvisioner creates a best-effort seeder for deployment-provided mappings.
func (*InitialLabelSyncMappingProvisioner) Provision ¶
func (p *InitialLabelSyncMappingProvisioner) Provision(ctx context.Context, orgID uuid.UUID)
Provision applies the configured mappings to one organization.
func (*InitialLabelSyncMappingProvisioner) ProvisionEntriesForOrganizations ¶
func (p *InitialLabelSyncMappingProvisioner) ProvisionEntriesForOrganizations(ctx context.Context, orgIDs []uuid.UUID, entries []json.RawMessage)
ProvisionEntriesForOrganizations attempts each decoded manifest entry for each organization.
func (*InitialLabelSyncMappingProvisioner) ProvisionForOrganizations ¶
func (p *InitialLabelSyncMappingProvisioner) ProvisionForOrganizations(ctx context.Context, orgIDs []uuid.UUID)
ProvisionForOrganizations reads the source once and attempts every mapping for each organization.
type MappingOutcome ¶
type MappingScanToken ¶
type MockReconciliationDeviceStore ¶
type MockReconciliationDeviceStore struct {
// contains filtered or unexported fields
}
MockReconciliationDeviceStore is a mock of ReconciliationDeviceStore interface.
func NewMockReconciliationDeviceStore ¶
func NewMockReconciliationDeviceStore(ctrl *gomock.Controller) *MockReconciliationDeviceStore
NewMockReconciliationDeviceStore creates a new mock instance.
func (*MockReconciliationDeviceStore) ApplyLabels ¶
func (m *MockReconciliationDeviceStore) ApplyLabels(arg0 context.Context, arg1 uuid.UUID, arg2 string, arg3 domain.DeviceLabelSnapshot, arg4 map[string]domain.DesiredDeviceLabel, arg5 *domain.Condition) (domain.DeviceLabelApplyResult, error)
ApplyLabels mocks base method.
func (*MockReconciliationDeviceStore) EXPECT ¶
func (m *MockReconciliationDeviceStore) EXPECT() *MockReconciliationDeviceStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockReconciliationDeviceStore) GetLabelSnapshot ¶
func (m *MockReconciliationDeviceStore) GetLabelSnapshot(arg0 context.Context, arg1 uuid.UUID, arg2 string) (domain.DeviceLabelSnapshot, error)
GetLabelSnapshot mocks base method.
type MockReconciliationDeviceStoreMockRecorder ¶
type MockReconciliationDeviceStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockReconciliationDeviceStoreMockRecorder is the mock recorder for MockReconciliationDeviceStore.
func (*MockReconciliationDeviceStoreMockRecorder) ApplyLabels ¶
func (mr *MockReconciliationDeviceStoreMockRecorder) ApplyLabels(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call
ApplyLabels indicates an expected call of ApplyLabels.
func (*MockReconciliationDeviceStoreMockRecorder) GetLabelSnapshot ¶
func (mr *MockReconciliationDeviceStoreMockRecorder) GetLabelSnapshot(arg0, arg1, arg2 any) *gomock.Call
GetLabelSnapshot indicates an expected call of GetLabelSnapshot.
func (*MockReconciliationDeviceStoreMockRecorder) GetLabelSyncMappingIDsByKeys ¶
func (mr *MockReconciliationDeviceStoreMockRecorder) GetLabelSyncMappingIDsByKeys(arg0, arg1, arg2 any) *gomock.Call
GetLabelSyncMappingIDsByKeys indicates an expected call of GetLabelSyncMappingIDsByKeys.
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService is a mock of Service interface.
func NewMockService ¶
func NewMockService(ctrl *gomock.Controller) *MockService
NewMockService creates a new mock instance.
func (*MockService) CompleteMappingScan ¶
func (m *MockService) CompleteMappingScan(arg0 context.Context, arg1 uuid.UUID, arg2 []MappingScanToken) (map[uuid.UUID]bool, error)
CompleteMappingScan mocks base method.
func (*MockService) CreateLabelSyncMapping ¶
func (m *MockService) CreateLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
CreateLabelSyncMapping mocks base method.
func (*MockService) DeleteLabelSyncMapping ¶
func (m *MockService) DeleteLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 string) domain.Status
DeleteLabelSyncMapping mocks base method.
func (*MockService) EXPECT ¶
func (m *MockService) EXPECT() *MockServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockService) GetDeviceLabelSyncProvenance ¶
func (m *MockService) GetDeviceLabelSyncProvenance(arg0 context.Context, arg1 uuid.UUID, arg2 string) (*domain.LabelSyncProvenanceList, domain.Status)
GetDeviceLabelSyncProvenance mocks base method.
func (*MockService) GetLabelSyncMapping ¶
func (m *MockService) GetLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 string) (*domain.LabelSyncMapping, domain.Status)
GetLabelSyncMapping mocks base method.
func (*MockService) GetLabelSyncProvenance ¶
func (m *MockService) GetLabelSyncProvenance(arg0 context.Context, arg1 uuid.UUID, arg2 []string) (*domain.LabelSyncProvenanceList, domain.Status)
GetLabelSyncProvenance mocks base method.
func (*MockService) ListLabelSyncMappings ¶
func (m *MockService) ListLabelSyncMappings(arg0 context.Context, arg1 uuid.UUID, arg2 domain.ListLabelSyncMappingsParams) (*domain.LabelSyncMappingList, domain.Status)
ListLabelSyncMappings mocks base method.
func (*MockService) ListMappingScanTargets ¶
func (m *MockService) ListMappingScanTargets(arg0 context.Context, arg1 uuid.UUID) ([]MappingScanToken, error)
ListMappingScanTargets mocks base method.
func (*MockService) PatchLabelSyncMapping ¶
func (m *MockService) PatchLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 string, arg3 domain.PatchRequest) (*domain.LabelSyncMapping, domain.Status)
PatchLabelSyncMapping mocks base method.
func (*MockService) ReconcileDeviceLabels ¶
func (m *MockService) ReconcileDeviceLabels(arg0 context.Context, arg1 uuid.UUID, arg2 string) (ReconciliationResult, error)
ReconcileDeviceLabels mocks base method.
func (*MockService) RecordMappingScanFailure ¶
func (m *MockService) RecordMappingScanFailure(arg0 context.Context, arg1 uuid.UUID, arg2 MappingScanToken, arg3 string) (MappingScanToken, bool, error)
RecordMappingScanFailure mocks base method.
func (*MockService) ReplaceLabelSyncMapping ¶
func (m *MockService) ReplaceLabelSyncMapping(arg0 context.Context, arg1 uuid.UUID, arg2 string, arg3 domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
ReplaceLabelSyncMapping mocks base method.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) CompleteMappingScan ¶
func (mr *MockServiceMockRecorder) CompleteMappingScan(arg0, arg1, arg2 any) *gomock.Call
CompleteMappingScan indicates an expected call of CompleteMappingScan.
func (*MockServiceMockRecorder) CreateLabelSyncMapping ¶
func (mr *MockServiceMockRecorder) CreateLabelSyncMapping(arg0, arg1, arg2 any) *gomock.Call
CreateLabelSyncMapping indicates an expected call of CreateLabelSyncMapping.
func (*MockServiceMockRecorder) DeleteLabelSyncMapping ¶
func (mr *MockServiceMockRecorder) DeleteLabelSyncMapping(arg0, arg1, arg2 any) *gomock.Call
DeleteLabelSyncMapping indicates an expected call of DeleteLabelSyncMapping.
func (*MockServiceMockRecorder) GetDeviceLabelSyncProvenance ¶
func (mr *MockServiceMockRecorder) GetDeviceLabelSyncProvenance(arg0, arg1, arg2 any) *gomock.Call
GetDeviceLabelSyncProvenance indicates an expected call of GetDeviceLabelSyncProvenance.
func (*MockServiceMockRecorder) GetLabelSyncMapping ¶
func (mr *MockServiceMockRecorder) GetLabelSyncMapping(arg0, arg1, arg2 any) *gomock.Call
GetLabelSyncMapping indicates an expected call of GetLabelSyncMapping.
func (*MockServiceMockRecorder) GetLabelSyncProvenance ¶
func (mr *MockServiceMockRecorder) GetLabelSyncProvenance(arg0, arg1, arg2 any) *gomock.Call
GetLabelSyncProvenance indicates an expected call of GetLabelSyncProvenance.
func (*MockServiceMockRecorder) ListLabelSyncMappings ¶
func (mr *MockServiceMockRecorder) ListLabelSyncMappings(arg0, arg1, arg2 any) *gomock.Call
ListLabelSyncMappings indicates an expected call of ListLabelSyncMappings.
func (*MockServiceMockRecorder) ListMappingScanTargets ¶
func (mr *MockServiceMockRecorder) ListMappingScanTargets(arg0, arg1 any) *gomock.Call
ListMappingScanTargets indicates an expected call of ListMappingScanTargets.
func (*MockServiceMockRecorder) PatchLabelSyncMapping ¶
func (mr *MockServiceMockRecorder) PatchLabelSyncMapping(arg0, arg1, arg2, arg3 any) *gomock.Call
PatchLabelSyncMapping indicates an expected call of PatchLabelSyncMapping.
func (*MockServiceMockRecorder) ReconcileDeviceLabels ¶
func (mr *MockServiceMockRecorder) ReconcileDeviceLabels(arg0, arg1, arg2 any) *gomock.Call
ReconcileDeviceLabels indicates an expected call of ReconcileDeviceLabels.
func (*MockServiceMockRecorder) RecordMappingScanFailure ¶
func (mr *MockServiceMockRecorder) RecordMappingScanFailure(arg0, arg1, arg2, arg3 any) *gomock.Call
RecordMappingScanFailure indicates an expected call of RecordMappingScanFailure.
func (*MockServiceMockRecorder) ReplaceLabelSyncMapping ¶
func (mr *MockServiceMockRecorder) ReplaceLabelSyncMapping(arg0, arg1, arg2, arg3 any) *gomock.Call
ReplaceLabelSyncMapping indicates an expected call of ReplaceLabelSyncMapping.
type NoResult ¶
type NoResult struct{}
NoResult represents a successful expression with no value to map.
type ReconciliationDeviceStore ¶
type ReconciliationDeviceStore interface {
GetLabelSnapshot(context.Context, uuid.UUID, string) (domain.DeviceLabelSnapshot, error)
GetLabelSyncMappingIDsByKeys(context.Context, uuid.UUID, []string) (map[string][]uuid.UUID, error)
ApplyLabels(context.Context, uuid.UUID, string, domain.DeviceLabelSnapshot, map[string]domain.DesiredDeviceLabel, *domain.Condition) (domain.DeviceLabelApplyResult, error)
}
ReconciliationDeviceStore exposes the device-label operations used by the reconciliation and provenance flows.
type ReconciliationResult ¶
type Result ¶
type Result interface {
// contains filtered or unexported methods
}
Result is a scalar value, map, or successful evaluation with no value.
type ResultKind ¶
type ResultKind string
ResultKind identifies the expected shape of a mapping expression result.
const ( // ResultKindScalar expects a scalar expression result. ResultKindScalar ResultKind = "scalar" // ResultKindMap expects a map expression result. ResultKindMap ResultKind = "map" )
type ScalarResult ¶
type ScalarResult string
ScalarResult is a sanitized scalar value produced by an expression.
type Service ¶
type Service interface {
CreateLabelSyncMapping(context.Context, uuid.UUID, domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
ListLabelSyncMappings(context.Context, uuid.UUID, domain.ListLabelSyncMappingsParams) (*domain.LabelSyncMappingList, domain.Status)
GetLabelSyncMapping(context.Context, uuid.UUID, string) (*domain.LabelSyncMapping, domain.Status)
ReplaceLabelSyncMapping(context.Context, uuid.UUID, string, domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
PatchLabelSyncMapping(context.Context, uuid.UUID, string, domain.PatchRequest) (*domain.LabelSyncMapping, domain.Status)
DeleteLabelSyncMapping(context.Context, uuid.UUID, string) domain.Status
GetDeviceLabelSyncProvenance(context.Context, uuid.UUID, string) (*domain.LabelSyncProvenanceList, domain.Status)
GetLabelSyncProvenance(context.Context, uuid.UUID, []string) (*domain.LabelSyncProvenanceList, domain.Status)
ReconcileDeviceLabels(context.Context, uuid.UUID, string) (ReconciliationResult, error)
ListMappingScanTargets(context.Context, uuid.UUID) ([]MappingScanToken, error)
RecordMappingScanFailure(context.Context, uuid.UUID, MappingScanToken, string) (MappingScanToken, bool, error)
CompleteMappingScan(context.Context, uuid.UUID, []MappingScanToken) (map[uuid.UUID]bool, error)
}
func NewService ¶
func NewService(store labelsyncmappingstore.Store, deviceStore ReconciliationDeviceStore, events eventservice.Service, log logrus.FieldLogger) (Service, error)
NewService builds the label-sync mapping service with CEL evaluation and tracing. deviceStore and events must either both be provided or both be nil. When nil, device-label reconciliation is unavailable on the returned service.
func WrapWithTracing ¶
WrapWithTracing returns a Service that wraps inner with tracing spans, or nil if inner is nil.
type ServiceHandler ¶
type ServiceHandler struct {
// contains filtered or unexported fields
}
func NewServiceHandler ¶
func NewServiceHandler(store labelsyncmappingstore.Store, deviceStore ReconciliationDeviceStore, evaluator Evaluator, events eventservice.Service, log logrus.FieldLogger) (*ServiceHandler, error)
NewServiceHandler constructs the label-sync mapping service, including CEL validation for CRUD operations and device-label reconciliation. It returns an error if any required dependency is nil.
func (*ServiceHandler) CompleteMappingScan ¶
func (h *ServiceHandler) CompleteMappingScan(ctx context.Context, orgID uuid.UUID, tokens []MappingScanToken) (map[uuid.UUID]bool, error)
func (*ServiceHandler) CreateLabelSyncMapping ¶
func (h *ServiceHandler) CreateLabelSyncMapping(ctx context.Context, orgID uuid.UUID, mapping domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
func (*ServiceHandler) DeleteLabelSyncMapping ¶
func (*ServiceHandler) GetDeviceLabelSyncProvenance ¶
func (h *ServiceHandler) GetDeviceLabelSyncProvenance(ctx context.Context, orgID uuid.UUID, deviceName string) (*domain.LabelSyncProvenanceList, domain.Status)
func (*ServiceHandler) GetLabelSyncMapping ¶
func (h *ServiceHandler) GetLabelSyncMapping(ctx context.Context, orgID uuid.UUID, name string) (*domain.LabelSyncMapping, domain.Status)
func (*ServiceHandler) GetLabelSyncProvenance ¶
func (h *ServiceHandler) GetLabelSyncProvenance(ctx context.Context, orgID uuid.UUID, labelKeys []string) (*domain.LabelSyncProvenanceList, domain.Status)
func (*ServiceHandler) ListLabelSyncMappings ¶
func (h *ServiceHandler) ListLabelSyncMappings(ctx context.Context, orgID uuid.UUID, params domain.ListLabelSyncMappingsParams) (*domain.LabelSyncMappingList, domain.Status)
func (*ServiceHandler) ListMappingScanTargets ¶
func (h *ServiceHandler) ListMappingScanTargets(ctx context.Context, orgID uuid.UUID) ([]MappingScanToken, error)
func (*ServiceHandler) PatchLabelSyncMapping ¶
func (h *ServiceHandler) PatchLabelSyncMapping(ctx context.Context, orgID uuid.UUID, name string, patch domain.PatchRequest) (*domain.LabelSyncMapping, domain.Status)
func (*ServiceHandler) ReconcileDeviceLabels ¶
func (h *ServiceHandler) ReconcileDeviceLabels(ctx context.Context, orgID uuid.UUID, deviceName string) (ReconciliationResult, error)
func (*ServiceHandler) RecordMappingScanFailure ¶
func (h *ServiceHandler) RecordMappingScanFailure(ctx context.Context, orgID uuid.UUID, token MappingScanToken, message string) (MappingScanToken, bool, error)
func (*ServiceHandler) ReplaceLabelSyncMapping ¶
func (h *ServiceHandler) ReplaceLabelSyncMapping(ctx context.Context, orgID uuid.UUID, name string, mapping domain.LabelSyncMapping) (*domain.LabelSyncMapping, domain.Status)
type TracedService ¶
type TracedService struct {
// contains filtered or unexported fields
}
TracedService wraps a Service implementation with OpenTelemetry tracing.
func (*TracedService) CompleteMappingScan ¶
func (_d *TracedService) CompleteMappingScan(ctx context.Context, u1 uuid.UUID, ma1 []MappingScanToken) (m1 map[uuid.UUID]bool, err error)
func (*TracedService) CreateLabelSyncMapping ¶
func (_d *TracedService) CreateLabelSyncMapping(ctx context.Context, u1 uuid.UUID, l1 domain.LabelSyncMapping) (lp1 *domain.LabelSyncMapping, s1 domain.Status)
func (*TracedService) DeleteLabelSyncMapping ¶
func (*TracedService) GetDeviceLabelSyncProvenance ¶
func (_d *TracedService) GetDeviceLabelSyncProvenance(ctx context.Context, u1 uuid.UUID, s1 string) (lp1 *domain.LabelSyncProvenanceList, s2 domain.Status)
func (*TracedService) GetLabelSyncMapping ¶
func (_d *TracedService) GetLabelSyncMapping(ctx context.Context, u1 uuid.UUID, s1 string) (lp1 *domain.LabelSyncMapping, s2 domain.Status)
func (*TracedService) GetLabelSyncProvenance ¶
func (_d *TracedService) GetLabelSyncProvenance(ctx context.Context, u1 uuid.UUID, sa1 []string) (lp1 *domain.LabelSyncProvenanceList, s1 domain.Status)
func (*TracedService) ListLabelSyncMappings ¶
func (_d *TracedService) ListLabelSyncMappings(ctx context.Context, u1 uuid.UUID, l1 domain.ListLabelSyncMappingsParams) (lp1 *domain.LabelSyncMappingList, s1 domain.Status)
func (*TracedService) ListMappingScanTargets ¶
func (_d *TracedService) ListMappingScanTargets(ctx context.Context, u1 uuid.UUID) (ma1 []MappingScanToken, err error)
func (*TracedService) PatchLabelSyncMapping ¶
func (_d *TracedService) PatchLabelSyncMapping(ctx context.Context, u1 uuid.UUID, s1 string, p1 domain.PatchRequest) (lp1 *domain.LabelSyncMapping, s2 domain.Status)
func (*TracedService) ReconcileDeviceLabels ¶
func (_d *TracedService) ReconcileDeviceLabels(ctx context.Context, u1 uuid.UUID, s1 string) (r1 ReconciliationResult, err error)
func (*TracedService) RecordMappingScanFailure ¶
func (_d *TracedService) RecordMappingScanFailure(ctx context.Context, u1 uuid.UUID, m1 MappingScanToken, s1 string) (m2 MappingScanToken, b1 bool, err error)
func (*TracedService) ReplaceLabelSyncMapping ¶
func (_d *TracedService) ReplaceLabelSyncMapping(ctx context.Context, u1 uuid.UUID, s1 string, l1 domain.LabelSyncMapping) (lp1 *domain.LabelSyncMapping, s2 domain.Status)