github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/pkg/statushooks/snapshot_progress.go (about)

     1  package statushooks
     2  
     3  import "context"
     4  
     5  type SnapshotProgress interface {
     6  	UpdateRowCount(context.Context, int)
     7  	UpdateErrorCount(context.Context, int)
     8  }
     9  
    10  func SnapshotError(ctx context.Context) {
    11  	SnapshotProgressFromContext(ctx).UpdateErrorCount(ctx, 1)
    12  }
    13  
    14  func UpdateSnapshotProgress(ctx context.Context, completedRows int) {
    15  	SnapshotProgressFromContext(ctx).UpdateRowCount(ctx, completedRows)
    16  }