Skip to content

Commit

Permalink
expose BulkExportRelationships service controller logic
Browse files Browse the repository at this point in the history
so that it can be used without the grpc server
  • Loading branch information
vroldanbet committed May 3, 2024
1 parent f391921 commit 260cbde
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/services/v1/services.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package v1

import (
"context"

v1 "github.com/authzed/authzed-go/proto/authzed/api/v1"

servicesv1 "github.com/authzed/spicedb/internal/services/v1"
"github.com/authzed/spicedb/pkg/datastore"
)

// BulkExport implements the BulkExportRelationships API functionality. Given a datastore.Datastore, it will
// export stream via the sender all relationships matched by the incoming request.
// If no cursor is provided, it will fallback to the provided revision.
func BulkExport(ctx context.Context, ds datastore.Datastore, batchSize uint64, req *v1.BulkExportRelationshipsRequest, fallbackRevision datastore.Revision, sender func(response *v1.BulkExportRelationshipsResponse) error) error {
return servicesv1.BulkExport(ctx, ds, batchSize, req, fallbackRevision, sender)
}

0 comments on commit 260cbde

Please sign in to comment.