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 764cf9c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/services/v1/services.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package v1

Check failure on line 1 in pkg/services/v1/services.go

View workflow job for this annotation

GitHub Actions / Lint Go

Please run go run mage.go lint:go. diff --git a/pkg/services/v1/services.go b/pkg/services/v1/services.go index 8eeb631..5d123a4 100644 --- a/pkg/services/v1/services.go +++ b/pkg/services/v1/services.go @@ -4,6 +4,7 @@ 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" )

Check failure on line 1 in pkg/services/v1/services.go

View workflow job for this annotation

GitHub Actions / Lint Go

Please run go run mage.go lint:go. diff --git a/pkg/services/v1/services.go b/pkg/services/v1/services.go index 8eeb631..5d123a4 100644 --- a/pkg/services/v1/services.go +++ b/pkg/services/v1/services.go @@ -4,6 +4,7 @@ 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" )

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 764cf9c

Please sign in to comment.