Compatibility-sensitive Go interfaces for multi-runtime application capabilities. This module defines API contracts only; applications must supply a concrete runtime implementation.
Capa Cloud · Documentation · Issues
- Go 1.17 or later
- Go modules enabled
The source repository moved to the capa-cloud organization, but the published module path remains github.com/reactivegroup/cloud-runtimes-golang for compatibility:
go get github.com/reactivegroup/cloud-runtimes-golang/apiImport the canonical module path declared by go.mod, not the GitHub repository URL:
import "github.com/reactivegroup/cloud-runtimes-golang/api"The module currently defines interfaces for:
| Domain | Main interface |
|---|---|
| Service invocation | InvocationRuntimes |
| Bindings | BindingRuntimes |
| Pub/Sub | PubSubRuntimes |
| State | StateRuntimes |
| Secrets | SecretsRuntimes |
| Trace context | TraceRuntimes |
| Authentication context | AuthRuntimes |
“Defined” means the interface and related types exist in this module. It does not mean a Capa, Dapr, Layotto, or provider adapter is bundled or production-ready.
Depend on the narrowest interface needed by application code and inject an implementation:
package service
import (
"context"
"github.com/reactivegroup/cloud-runtimes-golang/api"
)
func Invoke(ctx context.Context, runtime api.InvocationRuntimes) error {
_, err := runtime.InvokeMethod(ctx, "service-name", "method", "POST")
return err
}The composite core interface is:
type CoreCloudRuntimes interface {
InvocationRuntimes
BindingRuntimes
PubSubRuntimes
SecretsRuntimes
StateRuntimes
}Adapters should document which interfaces they implement and return explicit errors for unsupported operations.
.
├── api/
│ ├── core.go # Core runtime interfaces and domain types
│ ├── enhance.go # Trace and authentication context interfaces
│ └── client.go # Composite client interface
├── docs/
└── go.mod
git clone https://github.com/capa-cloud/cloud-runtimes-golang.git
cd cloud-runtimes-golang
go mod download
go test ./...
go vet ./...CI runs the tests on Go 1.17.x and the current stable Go release.
When changing an interface:
- Preserve the module path and existing exported names unless a breaking change is intentional.
- Update domain types and tests with the interface change.
- Document the adapter compatibility impact.
- Run
gofmton changed Go files and the commands above.
Apache License 2.0. See LICENSE.
