Developer API · default branch
Typed Go contracts and explicit runtime integration
The default branch exposes ten public packages: six core contracts plus four concrete client integrations. Published-version links remain pinned to v1.0.1, which may predate the newest default-branch packages.
Install
Pin the CLI and library to one immutable version
go install github.com/Voskan/BatchWeaver/cmd/batchweaver@v1.0.1
go get github.com/Voskan/BatchWeaver@v1.0.1
Package map
Ten documented public packages
github.com/Voskan/BatchWeaverGeneric batch requests, outcomes, scalar/batch functions, and typed declarations.
/operationOperation identity, semantics, contracts, policies, symbols, and catalogs.
/runtimeInstance-scoped engine, scopes, bindings, queues, cancellation, and coalescing.
/bridgeTyped reflection-free ABI between generated code and the runtime.
/configStrict YAML/JSON loading, includes, validation, normalization, and semantic digest.
/diagnosticsStable diagnostic values, source ranges, fixes, collections, and renderers.
/adapters/pgxv5Caller-owned pgx v5 array-query provider with ordinal result mapping.
/adapters/redisv9Cluster-slot-safe MGET, per-hash HMGET, and explicit pipeline providers.
/adapters/gqlgenPublic gqlgen operation-scope and normalized field-partition extension.
/adapters/grpcgoTyped explicit unary batch RPC provider and metadata partitioning.
Typed declaration
Connect scalar and batch implementations
This complete pattern is statically discoverable and performs no implicit registration or I/O.
package users
import (
"context"
batchweaver "github.com/Voskan/BatchWeaver"
"github.com/Voskan/BatchWeaver/operation"
)
type User struct { ID int; Name string }
func loadUser(ctx context.Context, id int) (User, error) {
return User{ID: id}, nil
}
func loadUsers(
ctx context.Context,
req batchweaver.BatchRequest[int],
) (batchweaver.BatchResponse[User], error) {
values := make([]User, req.Len())
for i, item := range req.Items() {
values[i] = User{ID: item.Key}
}
return batchweaver.OrderedOutcomes(req, values)
}
var GetUser = batchweaver.MustDeclareFunction(
operation.MustNewSpec(
operation.MustParseID("users.get"),
operation.ReadOnly(),
operation.WithOrderedResults(),
operation.WithRequestScope(),
),
loadUser,
loadUsers,
)
Runtime
Coalesce only inside an explicit scope
Bind an operation to an engine, enter a scope, and call the typed bound operation. Partition identity and queue limits remain explicit in the binding.
1. EngineOwn lifecycle, defaults, hooks, and operation coordinators.
2. BindingConnect a declaration, key strategy, provider, partition, and limits.
3. ScopeDefine the request boundary carried through context.
4. DoSubmit a typed key and receive one independently cancellable outcome.
Command line
Compiler, runtime, adapters, operations, and release assurance
Analyze and prove
scanoperationcandidateproveproofassumptionstrategybarrier
Transform and execute
transformbuildruntestruntimetool-exec
Adapters
adapterhttpopenapigraphqlgrpc
Adaptive operations
profiletunefairnessoverloadwaverecursive
Editor and daemon
lspeditordaemon
Assurance
doctorsecuritycompatibilityverifyreleaseversion
batchweaver help
batchweaver help <command>
Compatibility contract
What the default branch does and does not promise
Implemented surface
- Go 1.26.x (minimum 1.26.0; current 1.26.5)
- Public packages listed above
- database/sql, net/http, pgx v5, go-redis v9, gqlgen, and grpc-go providers
- Verified release archives and VSIX for published versions
- Documented schema and ABI rejection behavior
Not part of the supported stable surface
- Arbitrary SQL or network request fusion
- Implicit source mutation
- Stable v1 compatibility promise
- Hosted attestation or cryptographic signatures
- Client/platform combinations absent from the compatibility matrix
Read the full implementation and development report →