Documentation ¶
Index ¶
- func CheckServerVersion(ctx context.Context, method string, req, reply interface{}, ...) error
- func ConcurrentBatch(ctx context.Context, n int, batchSize int, maxWorkers int, each EachFunc) error
- func LogDispatchTrailers(ctx context.Context, method string, req, reply interface{}, ...) error
- type EachFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckServerVersion ¶ added in v0.4.3
func CheckServerVersion( ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, callOpts ...grpc.CallOption, ) error
CheckServerVersion implements a gRPC unary interceptor that requests the server version from SpiceDB and, if found, compares it to the current released version.
func ConcurrentBatch ¶ added in v0.4.4
func ConcurrentBatch(ctx context.Context, n int, batchSize int, maxWorkers int, each EachFunc) error
ConcurrentBatch will calculate the minimum number of batches to required to batch n items with batchSize batches. For each batch, it will execute the each function. These functions will be processed in parallel using maxWorkers number of goroutines. If maxWorkers is 1, then batching will happen sychronously. If maxWorkers is 0, then GOMAXPROCS number of workers will be used.
If an error occurs during a batch, all the worker's contexts are cancelled and the original error is returned.
func LogDispatchTrailers ¶
func LogDispatchTrailers( ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, callOpts ...grpc.CallOption, ) error
LogDispatchTrailers implements a gRPC unary interceptor that logs the dispatch metadata that is present in response trailers from SpiceDB.