database

package
v0.0.0-...-602ca48 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresRepository

type PostgresRepository struct {
	// contains filtered or unexported fields
}

func NewPostgresRepository

func NewPostgresRepository(url string) (*PostgresRepository, error)

func (*PostgresRepository) Close

func (repo *PostgresRepository) Close() error

func (*PostgresRepository) DeletePost

func (repo *PostgresRepository) DeletePost(ctx context.Context, id, UserId string) error

func (*PostgresRepository) GetPostById

func (repo *PostgresRepository) GetPostById(ctx context.Context, id string) (*models.Post, error)

func (*PostgresRepository) GetUserByEmail

func (repo *PostgresRepository) GetUserByEmail(ctx context.Context, email string) (*models.User, error)

func (*PostgresRepository) GetUserById

func (repo *PostgresRepository) GetUserById(ctx context.Context, id string) (*models.User, error)

func (*PostgresRepository) InsertPost

func (repo *PostgresRepository) InsertPost(ctx context.Context, post *models.Post) error

func (*PostgresRepository) InsertUser

func (repo *PostgresRepository) InsertUser(ctx context.Context, user *models.User) error

func (*PostgresRepository) ListPost

func (repo *PostgresRepository) ListPost(ctx context.Context, page uint64) ([]*models.Post, error)

func (*PostgresRepository) UpdatePost

func (repo *PostgresRepository) UpdatePost(ctx context.Context, post *models.Post) error

Jump to

Keyboard shortcuts

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