Documentation ¶
Overview ¶
Package storage contains types and functions for managing data storage in identity-api.
Index ¶
- Variables
- func Diff[T any, V comparable](current, incoming []T, val func(T) V) (add, rm []T)
- func InMemoryCRDB() (testserver.TestServer, error)
- func RunMigrations(config crdbx.Config) error
- func SeedDatabase(config crdbx.Config, path string) error
- type Engine
- type EngineOption
- type SeedData
- type SeedIssuer
- type TransactionManager
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorMissingContextTx represents an error where no context transaction was provided. ErrorMissingContextTx = fmt.Errorf("no transaction provided in context") // ErrorInvalidContextTx represents an error where the given context transaction is of the wrong type. ErrorInvalidContextTx = fmt.Errorf("invalid type for transaction context") )
Functions ¶
func Diff ¶ added in v0.1.21
func Diff[T any, V comparable](current, incoming []T, val func(T) V) (add, rm []T)
Diff compares the current and incoming values and returns the difference.
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.
Types ¶
type Engine ¶
type Engine interface { types.IssuerService types.UserInfoService types.OAuthClientManager types.GroupService 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.
type SeedData ¶
type SeedData struct {
Issuers []SeedIssuer
}
SeedData represents the seed data for an identity-api instance on startup.
type SeedIssuer ¶
type SeedIssuer struct { OwnerID gidx.PrefixedID `yaml:"ownerID"` 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.
Click to show internal directories.
Click to hide internal directories.