repository

package
v0.0.0-...-84f6849 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookRepository

type BookRepository interface {
	GetBook(isbn string) (Book, error)
	Save(book Book) error
}

type LinkRepository

type LinkRepository interface {
	//Returns specific Link between two users
	Get(senderId uint, receiverId uint) (Link, error)

	//Returns all links concerned with the user
	GetById(userId string) ([]Link, error)

	//Returns all links concerned with the user that are accepted
	GetAcceptedById(userId uint) ([]Link, error)

	//Persists link.
	Save(link *Link) error
}

type PostgresBookRepository

type PostgresBookRepository struct {
	Database *gorm.DB
}

func (*PostgresBookRepository) GetBook

func (r *PostgresBookRepository) GetBook(isbn string) (Book, error)

func (*PostgresBookRepository) Save

func (r *PostgresBookRepository) Save(book Book) error

type PostgresLinkRepository

type PostgresLinkRepository struct {
	Database *gorm.DB
}

func (*PostgresLinkRepository) Get

func (r *PostgresLinkRepository) Get(senderId uint, receiverId uint) (Link, error)

func (*PostgresLinkRepository) GetAcceptedById

func (r *PostgresLinkRepository) GetAcceptedById(userId uint) ([]Link, error)

func (*PostgresLinkRepository) GetById

func (r *PostgresLinkRepository) GetById(userId string) ([]Link, error)

func (*PostgresLinkRepository) Save

func (r *PostgresLinkRepository) Save(link *Link) error

type PostgresUserRepository

type PostgresUserRepository struct {
	Database *gorm.DB
}

func (*PostgresUserRepository) Get

func (r *PostgresUserRepository) Get(id uint) (User, error)

func (*PostgresUserRepository) GetByEmail

func (r *PostgresUserRepository) GetByEmail(email string) (User, error)

func (*PostgresUserRepository) Save

func (r *PostgresUserRepository) Save(user *User) error

func (*PostgresUserRepository) SearchBook

func (r *PostgresUserRepository) SearchBook(isbn string) ([]User, error)

type UserRepository

type UserRepository interface {
	Get(id uint) (User, error)
	GetByEmail(email string) (User, error)
	Save(user *User) error
	SearchBook(isbn string) ([]User, error)
}

Jump to

Keyboard shortcuts

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