Documentation ¶
Overview ¶
Package storage contains types and functions for managing data storage in identity-api.
Index ¶
- Variables
- func InMemoryCRDB() (testserver.TestServer, error)
- func RunMigrations(config crdbx.Config) error
- func SeedDatabase(config crdbx.Config, path string) error
- func WithHTTPClient(client *http.Client) func(svc *userInfoService)
- type Engine
- type EngineOption
- type SeedData
- type SeedIssuer
- type TransactionManager
Constants ¶
This section is empty.
Variables ¶
var ErrorInvalidContextTx = fmt.Errorf("invalid type for transaction context")
ErrorInvalidContextTx represents an error where the given context transaction is of the wrong type.
var ErrorMissingContextTx = fmt.Errorf("no transaction provided in context")
ErrorMissingContextTx represents an error where no context transaction was provided.
Functions ¶
func InMemoryCRDB ¶ added in v0.0.8
func InMemoryCRDB() (testserver.TestServer, error)
InMemoryCRDB creates an in-memory CRDB test server.
func RunMigrations ¶ added in v0.0.6
RunMigrations runs all migrations using the given storage config.
func SeedDatabase ¶ added in v0.0.6
SeedDatabase seeds the database using the data at the given path
func WithHTTPClient ¶
WithHTTPClient allows configuring the HTTP client used by userInfoService to call out to userinfo endpoints.
Types ¶
type Engine ¶
type Engine interface { types.IssuerService types.UserInfoService types.OAuthClientManager TransactionManager }
Engine represents a storage engine.
type EngineOption ¶ added in v0.0.8
type EngineOption func(*engine) error
EngineOption defines an initialization option for a storage engine.
func WithMigrations ¶ added in v0.0.8
func WithMigrations() EngineOption
WithMigrations runs migrations on the storage engine.
func WithSeedData ¶ added in v0.0.8
func WithSeedData(data SeedData) EngineOption
WithSeedData adds seed data to the storage engine.
func WithTracing ¶ added in v0.0.8
func WithTracing(config crdbx.Config) EngineOption
WithTracing enables tracing for the storage engine.
type SeedData ¶
type SeedData struct {
Issuers []SeedIssuer
}
SeedData represents the seed data for an identity-api instance on startup.
type SeedIssuer ¶
type SeedIssuer struct { TenantID gidx.PrefixedID `yaml:"tenantID"` ID gidx.PrefixedID `yaml:"id"` Name string `yaml:"name"` URI string `yaml:"uri"` JWKSURI string `yaml:"jwksURI"` ClaimMappings map[string]string `yaml:"claimMappings"` }
SeedIssuer represents the seed data for a single issuer.