Documentation
¶
Overview ¶
package: tests/backends / integration type: tool job: obtain an Azure Blob store for the matrix — one named by RANKE_AZURE_ENDPOINT (services/azurite.sh, a CI service container), else an ephemeral Azurite podman pod limits: needs RANKE_AZURE_ENDPOINT or podman, else ErrUnavailable; tears down only the blob container it created (-> minio_pod for the S3 half)
package: tests/backends / integration type: tool job: the shared backend matrix — one named opener per storage configuration, each spinning up a FRESH, EMPTY local instance (podman pods for s3/azure/redis/neo4j, or host-native services) limits: wiring only — no test logic and no assertions; the rows are consumed by the conformance matrix (-> tests/matrix) and the timing harness (-> tests/performance)
package: tests/backends / integration type: tool job: obtain an S3 object store for the matrix — a running store via RANKE_S3_ENDPOINT (services/s3.sh, a CI service container), else an ephemeral MinIO podman pod — with a fresh, empty bucket of its own limits: requires RANKE_S3_ENDPOINT or podman; returns ErrUnavailable otherwise. Never tears down a store it did not start, only the bucket it created.
package: tests/backends / integration type: tool job: spawn a real Neo4j instance in a podman pod for the neo4j matrix row, tear it down after limits: requires podman on PATH and network to pull the image; returns ErrUnavailable when podman is absent. Neo4j boots slowly, so the timeouts are generous (and cover a first-run image pull).
package: tests/backends / integration type: tool job: shared podman lifecycle for the ephemeral service pods — remove a container together with the anonymous volumes its image declared limits: containers the suite started; a host-native service is never torn down (-> redis_pod, minio_pod, neo4j_pod)
package: tests/backends / integration type: tool job: obtain a Redis for the matrix — a host/local instance via RANKE_REDIS_ADDR (services/redis.sh), else an ephemeral podman pod — with the adapter's connection details limits: requires RANKE_REDIS_ADDR or podman; returns ErrUnavailable otherwise. Never tears down an instance it did not start.
Index ¶
Constants ¶
const RowsEnv = "RANKE_ROWS"
RowsEnv names the row set a run asks for: comma-separated row names, in any order. It is how the Make layer reaches a Go-level knob — the fast gate asks for the rows needing no service, the full run asks for all of them.
Variables ¶
ErrUnavailable reports that a backend cannot run in this environment (e.g. s3 with no podman); a caller reports the row as skipped.
Functions ¶
func Stacked ¶
func Stacked(openers ...func() (ranke.Universe, func(), error)) func() (ranke.Universe, func(), error)
Stacked composes openers top→bottom; each adapter reports its own write tier, so the stack routes itself. One unavailable component makes the whole stack so.
func UseNativeServices ¶
func UseNativeServices(on bool)
UseNativeServices routes neo4j, redis, s3 and azure to host-native instances on localhost rather than podman pods — the harness's --native mode. Call before opening a backend.
Types ¶
type Backend ¶
type Backend struct {
Name string
Open func() (ranke.Universe, func(), error)
// Exclusive names a live service only ONE universe may hold at a time, so a
// caller keeping instances alive knows which rows it may not overlap. Both neo4j
// rows sit on the one database and flush it at open, and openNeo4j holds a
// cross-process lock meanwhile: a second live universe over it would block, then
// wipe the first's graph. Empty where a row can hold instances side by side.
Exclusive string
}
Backend is one matrix row: a named factory yielding a FRESH, EMPTY local instance plus a cleanup func. Open returns ErrUnavailable when the backend can't run here.
func All ¶
func All() []Backend
All is the matrix, each row starting empty. Durable byte-stores run standalone; neo4j holds no CBOR and caps content, so it appears only stacked over one.
func Reference ¶
func Reference() Backend
Reference is the row every other backend is compared against: the in-memory store, answering reads through ranke.DefaultQuery. Always available, so a matrix has a baseline.
type Neo4jConn ¶
type Neo4jConn struct {
BoltURI string // bolt://127.0.0.1:PORT — the adapter connects here
HTTPURI string // http://127.0.0.1:PORT — used only for readiness probing
User string
Password string
}
Neo4jConn is what a Neo4j-backed Universe needs to connect. The exact shape the adapter's constructor wants may differ slightly; adjust when it lands.