repository

package
v0.0.0-...-9fa777b Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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