persistence

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLogPersister

type AuditLogPersister interface {
	Create(auditLog models.AuditLog) error
	Get(id uuid.UUID) (*models.AuditLog, error)
	List(page int, perPage int, startTime *time.Time, endTime *time.Time, types []string, userId string, email string, ip string, searchString string) ([]models.AuditLog, error)
	Delete(auditLog models.AuditLog) error
	Count(startTime *time.Time, endTime *time.Time, types []string, userId string, email string, ip string, searchString string) (int, error)
}

func NewAuditLogPersister

func NewAuditLogPersister(db *pop.Connection) AuditLogPersister

type EmailPersister

type EmailPersister interface {
	Get(emailId uuid.UUID) (*models.Email, error)
	CountByUserId(uuid.UUID) (int, error)
	FindByUserId(uuid.UUID) (models.Emails, error)
	FindByAddress(string) (*models.Email, error)
	Create(models.Email) error
	Update(models.Email) error
	Delete(models.Email) error
}

func NewEmailPersister

func NewEmailPersister(db *pop.Connection) EmailPersister

type JwkPersister

type JwkPersister interface {
	Get(int) (*models.Jwk, error)
	GetAll() ([]models.Jwk, error)
	GetLast() (*models.Jwk, error)
	Create(models.Jwk) error
}

func NewJwkPersister

func NewJwkPersister(db *pop.Connection) JwkPersister

type Migrator

type Migrator interface {
	MigrateUp() error
	MigrateDown(int) error
}

type PasscodePersister

type PasscodePersister interface {
	Get(uuid.UUID) (*models.Passcode, error)
	Create(models.Passcode) error
	Update(models.Passcode) error
	Delete(models.Passcode) error
}

func NewPasscodePersister

func NewPasscodePersister(db *pop.Connection) PasscodePersister

type PasswordCredentialPersister

type PasswordCredentialPersister interface {
	Create(password models.PasswordCredential) error
	GetByUserID(userId uuid.UUID) (*models.PasswordCredential, error)
	Update(password models.PasswordCredential) error
}

func NewPasswordCredentialPersister

func NewPasswordCredentialPersister(db *pop.Connection) PasswordCredentialPersister

type Persister

type Persister interface {
	GetConnection() *pop.Connection
	Transaction(func(tx *pop.Connection) error) error
	GetUserPersister() UserPersister
	GetUserPersisterWithConnection(tx *pop.Connection) UserPersister
	GetPasscodePersister() PasscodePersister
	GetPasscodePersisterWithConnection(tx *pop.Connection) PasscodePersister
	GetPasswordCredentialPersister() PasswordCredentialPersister
	GetPasswordCredentialPersisterWithConnection(tx *pop.Connection) PasswordCredentialPersister
	GetWebauthnCredentialPersister() WebauthnCredentialPersister
	GetWebauthnCredentialPersisterWithConnection(tx *pop.Connection) WebauthnCredentialPersister
	GetWebauthnSessionDataPersister() WebauthnSessionDataPersister
	GetWebauthnSessionDataPersisterWithConnection(tx *pop.Connection) WebauthnSessionDataPersister
	GetJwkPersister() JwkPersister
	GetJwkPersisterWithConnection(tx *pop.Connection) JwkPersister
	GetAuditLogPersister() AuditLogPersister
	GetAuditLogPersisterWithConnection(tx *pop.Connection) AuditLogPersister
	GetEmailPersister() EmailPersister
	GetEmailPersisterWithConnection(tx *pop.Connection) EmailPersister
	GetPrimaryEmailPersister() PrimaryEmailPersister
	GetPrimaryEmailPersisterWithConnection(tx *pop.Connection) PrimaryEmailPersister
}

type PrimaryEmailPersister

type PrimaryEmailPersister interface {
	Create(models.PrimaryEmail) error
	Update(models.PrimaryEmail) error
}

func NewPrimaryEmailPersister

func NewPrimaryEmailPersister(db *pop.Connection) PrimaryEmailPersister

type Storage

type Storage interface {
	Migrator
	Persister
}

func New

func New(config config.Database) (Storage, error)

New return a new Persister Object with given configuration

type UserPersister

type UserPersister interface {
	Get(uuid.UUID) (*models.User, error)
	Create(models.User) error
	Update(models.User) error
	Delete(models.User) error
	List(page int, perPage int, userId uuid.UUID, email string, sortDirection string) ([]models.User, error)
	Count(userId uuid.UUID, email string) (int, error)
}

func NewUserPersister

func NewUserPersister(db *pop.Connection) UserPersister

type WebauthnCredentialPersister

type WebauthnCredentialPersister interface {
	Get(string) (*models.WebauthnCredential, error)
	Create(models.WebauthnCredential) error
	Update(models.WebauthnCredential) error
	Delete(models.WebauthnCredential) error
	GetFromUser(uuid.UUID) ([]models.WebauthnCredential, error)
}

func NewWebauthnCredentialPersister

func NewWebauthnCredentialPersister(db *pop.Connection) WebauthnCredentialPersister

type WebauthnSessionDataPersister

type WebauthnSessionDataPersister interface {
	Get(id uuid.UUID) (*models.WebauthnSessionData, error)
	GetByChallenge(challenge string) (*models.WebauthnSessionData, error)
	Create(sessionData models.WebauthnSessionData) error
	Update(sessionData models.WebauthnSessionData) error
	Delete(sessionData models.WebauthnSessionData) error
}

func NewWebauthnSessionDataPersister

func NewWebauthnSessionDataPersister(db *pop.Connection) WebauthnSessionDataPersister

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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