db

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package db provides SQL implementations of dex's storage interfaces.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorCannotDecryptKeys = errors.New("Cannot Decrypt Keys")
)

Functions

func DropMigrationsTable

func DropMigrationsTable(dbMap *gorp.DbMap) error

func GetPlannedMigrations

func GetPlannedMigrations(dbMap *gorp.DbMap) ([]*migrate.PlannedMigration, error)

func MigrateMaxMigrations

func MigrateMaxMigrations(dbMap *gorp.DbMap, max int) (int, error)

func MigrateToLatest

func MigrateToLatest(dbMap *gorp.DbMap) (int, error)

func NewClientRepo added in v0.4.0

func NewClientRepo(dbm *gorp.DbMap) client.ClientRepo

func NewClientRepoFromClients added in v0.4.0

func NewClientRepoFromClients(dbm *gorp.DbMap, cs []client.LoadableClient) (client.ClientRepo, error)

func NewConnection

func NewConnection(cfg Config) (*gorp.DbMap, error)

func NewHealthChecker

func NewHealthChecker(dbm *gorp.DbMap) *healthChecker

func NewMemDB added in v0.3.0

func NewMemDB() *gorp.DbMap

NewMemDB creates a new in memory sqlite3 database.

func NewPasswordInfoRepo

func NewPasswordInfoRepo(dbm *gorp.DbMap) user.PasswordInfoRepo

func NewPasswordInfoRepoFromPasswordInfos added in v0.3.0

func NewPasswordInfoRepoFromPasswordInfos(dbm *gorp.DbMap, infos []user.PasswordInfo) (user.PasswordInfoRepo, error)

func NewRefreshTokenRepo

func NewRefreshTokenRepo(dbm *gorp.DbMap) refresh.RefreshTokenRepo

func NewRefreshTokenRepoWithGenerator added in v0.3.0

func NewRefreshTokenRepoWithGenerator(dbm *gorp.DbMap, gen refresh.RefreshTokenGenerator) refresh.RefreshTokenRepo

func NewUserRepo

func NewUserRepo(dbm *gorp.DbMap) user.UserRepo

func NewUserRepoFromUsers

func NewUserRepoFromUsers(dbm *gorp.DbMap, us []user.UserWithRemoteIdentities) (user.UserRepo, error)

func TransactionFactory

func TransactionFactory(conn *gorp.DbMap) repo.TransactionFactory

Types

type Config

type Config struct {
	// Connection string in the format: <driver>://<username>:<password>@<host>:<port>/<database>
	DSN string
	// The maximum number of open connections to the database. The default is 0 (unlimited).
	// For more details see: http://golang.org/pkg/database/sql/#DB.SetMaxOpenConns
	MaxOpenConnections int
	// The maximum number of connections in the idle connection pool. The default is 0 (unlimited).
	// For more details see: http://golang.org/pkg/database/sql/#DB.SetMaxIdleConns
	MaxIdleConnections int
}

type ConnectorConfigRepo

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

func NewConnectorConfigRepo

func NewConnectorConfigRepo(dbm *gorp.DbMap) *ConnectorConfigRepo

func (*ConnectorConfigRepo) All

func (*ConnectorConfigRepo) GetConnectorByID added in v0.2.0

func (r *ConnectorConfigRepo) GetConnectorByID(tx repo.Transaction, id string) (connector.ConnectorConfig, error)

func (*ConnectorConfigRepo) Set

type GarbageCollector

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

func NewGarbageCollector

func NewGarbageCollector(dbm *gorp.DbMap, ival time.Duration) *GarbageCollector

func (*GarbageCollector) Run

func (gc *GarbageCollector) Run() chan struct{}

type PrivateKeySetRepo

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

func NewPrivateKeySetRepo

func NewPrivateKeySetRepo(dbm *gorp.DbMap, useOldFormat bool, secrets ...[]byte) (*PrivateKeySetRepo, error)

func (*PrivateKeySetRepo) Get

func (r *PrivateKeySetRepo) Get() (key.KeySet, error)

func (*PrivateKeySetRepo) Set

func (r *PrivateKeySetRepo) Set(ks key.KeySet) error

type SessionKeyRepo

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

func NewSessionKeyRepo

func NewSessionKeyRepo(dbm *gorp.DbMap) *SessionKeyRepo

func NewSessionKeyRepoWithClock

func NewSessionKeyRepoWithClock(dbm *gorp.DbMap, clock clockwork.Clock) *SessionKeyRepo

func (*SessionKeyRepo) Pop

func (r *SessionKeyRepo) Pop(key string) (string, error)

func (*SessionKeyRepo) Push

type SessionRepo

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

func NewSessionRepo

func NewSessionRepo(dbm *gorp.DbMap) *SessionRepo

func NewSessionRepoWithClock

func NewSessionRepoWithClock(dbm *gorp.DbMap, clock clockwork.Clock) *SessionRepo

func (*SessionRepo) Create

func (r *SessionRepo) Create(s session.Session) error

func (*SessionRepo) Get

func (r *SessionRepo) Get(sessionID string) (*session.Session, error)

func (*SessionRepo) Update

func (r *SessionRepo) Update(s session.Session) error

Directories

Path Synopsis
Package translate implements translation of driver specific SQL queries.
Package translate implements translation of driver specific SQL queries.

Jump to

Keyboard shortcuts

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