Documentation ¶
Overview ¶
Package repository contains repository for api
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomerRepository ¶
type CustomerRepository interface { FindByID(context.Context, string) (*model.Customer, error) FindAll(context.Context) ([]*model.Customer, error) Create(context.Context, *model.Customer) error Update(context.Context, *model.Customer) error DeleteByID(context.Context, string) error }
CustomerRepository represents behavior for customer repository
func NewMongoCustomerRepository ¶
func NewMongoCustomerRepository(client *mongo.Client) CustomerRepository
NewMongoCustomerRepository builds new mongoCustomerRepository
func NewPostgresCustomerRepository ¶
func NewPostgresCustomerRepository(p *pgxpool.Pool) CustomerRepository
NewPostgresCustomerRepository builds postgresCustomerRepository
type RefreshTokenRepository ¶
type RefreshTokenRepository interface { Create(context.Context, *model.RefreshToken) error FindTokensByUserID(context.Context, string) ([]*model.RefreshToken, error) DeleteByUserID(context.Context, string) error DeleteByID(context.Context, string) error FindByID(context.Context, string) (*model.RefreshToken, error) }
RefreshTokenRepository represents behavior of refresh token repository
func NewPostgresRefreshTokenRepository ¶
func NewPostgresRefreshTokenRepository(e transactor.PgxWithinTransactionExecutor) RefreshTokenRepository
NewPostgresRefreshTokenRepository builds postgresRefreshTokenRepository
type UserRepository ¶
type UserRepository interface { Create(context.Context, *model.User) error FindByEmail(context.Context, string) (*model.User, error) FindByID(context.Context, string) (*model.User, error) }
UserRepository represents user repository behavior
func NewPostgresUserRepository ¶
func NewPostgresUserRepository(e transactor.PgxWithinTransactionExecutor) UserRepository
NewPostgresUserRepository builds new postgresUserRepository
Click to show internal directories.
Click to hide internal directories.