storage

package
v0.0.0-...-f767cfc Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package storage provides storage implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepositoryProvider

type RepositoryProvider struct {
	PostgresUserRepository      *storagepostgres.UserRepository
	RedisRefreshTokenRepository *storageredis.RefreshTokenRepository
}

RepositoryProvider is a provider for the PostgresUserRepository and RedisRefreshTokenRepository.

func NewRepositoryProvider

func NewRepositoryProvider(options ...RepositoryProviderOption) *RepositoryProvider

NewRepositoryProvider creates a new instance of the RepositoryProvider. It takes one or more options that can be used to configure the provider.

type RepositoryProviderOption

type RepositoryProviderOption func(rp *RepositoryProvider)

RepositoryProviderOption is a functional option for the RepositoryProvider.

func WithPostgreSQLUserRepository

func WithPostgreSQLUserRepository(db *sqlx.DB) RepositoryProviderOption

WithPostgreSQLUserRepository is a functional option that sets the PostgresUserRepository of the RepositoryProvider to a new instance of `postgres.UserRepository`.

func WithRedisRefreshTokenRepository

func WithRedisRefreshTokenRepository(db *redis.Client) RepositoryProviderOption

WithRedisRefreshTokenRepository is a functional option that sets the RedisRefreshTokenRepository of the RepositoryProvider to a new instance of `redis.RefreshTokenRepository`.

Directories

Path Synopsis
Package postgres provides a PostgreSQL repository implementation for storing and managing users.
Package postgres provides a PostgreSQL repository implementation for storing and managing users.
Package redis provides a Redis repository implementation for storing and managing refresh tokens.
Package redis provides a Redis repository implementation for storing and managing refresh tokens.

Jump to

Keyboard shortcuts

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