Documentation
¶
Overview ¶
Package conformance is the shared behavioural suite every lookup backend must pass. It only uses the store interfaces, so the same cases run against the direct backend on every dialect and against the procedure backend on Postgres. Error messages are not asserted (backends word them differently), only whether an operation succeeds or fails and the values it returns.
The suite names everything it creates with Env.Prefix and never assumes empty tables, so it can run against a shared database. Env.Cleanup, when set, removes the prefixed rows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Provider *lookup.Provider
// DB and Dialect are used only to seed policy rules, which have no store method.
DB *sql.DB
Dialect dialect.Dialect
// Prefix makes every created name unique to this run.
Prefix string
// Cleanup removes rows whose names start with Prefix. Optional.
Cleanup func(t *testing.T)
}
Env is one backend under test.
Click to show internal directories.
Click to hide internal directories.