diff --git a/pkg/icingadb/delta.go b/pkg/icingadb/delta.go index 89e1af5e..59c9eaab 100644 --- a/pkg/icingadb/delta.go +++ b/pkg/icingadb/delta.go @@ -12,6 +12,7 @@ import ( "time" ) +// Delta calculates the delta of actual and desired entities, and stores which entities need to be created, updated, and deleted. type Delta struct { Create EntitiesById Update EntitiesById @@ -21,6 +22,7 @@ type Delta struct { logger *zap.SugaredLogger } +// NewDelta creates a new Delta and starts calculating it. func NewDelta(ctx context.Context, actual, desired <-chan contracts.Entity, subject *common.SyncSubject, logger *zap.SugaredLogger) *Delta { delta := &Delta{ Subject: subject, @@ -33,6 +35,7 @@ func NewDelta(ctx context.Context, actual, desired <-chan contracts.Entity, subj return delta } +// Wait waits for the delta calculation to complete and returns an error, if any. func (delta *Delta) Wait() error { return <-delta.done }