storage

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package storage contains types and functions for managing data storage in identity-api.

Index

Constants

This section is empty.

Variables

View Source
var ErrorInvalidContextTx = fmt.Errorf("invalid type for transaction context")

ErrorInvalidContextTx represents an error where the given context transaction is of the wrong type.

View Source
var ErrorMissingContextTx = fmt.Errorf("no transaction provided in context")

ErrorMissingContextTx represents an error where no context transaction was provided.

View Source
var ErrorMissingEngineType = fmt.Errorf("missing engine type")

ErrorMissingEngineType represents an error where no engine type was provided.

Functions

func WithHTTPClient

func WithHTTPClient(client *http.Client) func(svc *memoryUserInfoService)

WithHTTPClient allows configuring the HTTP client used by memoryUserInfoService to call out to userinfo endpoints.

Types

type Config

type Config struct {
	Type     EngineType
	SeedData SeedData
	// contains filtered or unexported fields
}

Config represents the storage configuration for identity-api.

type Engine

type Engine interface {
	types.IssuerService
	types.UserInfoService
	TransactionManager
	Shutdown()
}

Engine represents a storage engine.

func NewEngine

func NewEngine(config Config) (Engine, error)

NewEngine creates a new storage engine based on the given config.

type EngineType

type EngineType string

EngineType represents the type of identity-api storage engine.

const (
	// EngineTypeMemory represents an in-memory storage engine.
	EngineTypeMemory EngineType = "memory"
)

type ErrorUnknownEngineType

type ErrorUnknownEngineType struct {
	// contains filtered or unexported fields
}

ErrorUnknownEngineType represents an error where an invalid engine type was provided.

func (*ErrorUnknownEngineType) Error

func (e *ErrorUnknownEngineType) Error() string

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      string
	ID            string
	Name          string
	URI           string
	JWKSURI       string
	ClaimMappings map[string]string
}

SeedIssuer represents the seed data for a single issuer.

type TransactionManager

type TransactionManager interface {
	BeginContext(context.Context) (context.Context, error)
	CommitContext(context.Context) error
	RollbackContext(context.Context) error
}

TransactionManager manages the state of sql transactions within a context

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL