postgres

package
v0.0.0-...-8c4a1d0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection() (*gorm.DB, error)

func NewGormProductRepository

func NewGormProductRepository(db *gorm.DB) repositories.ProductRepository

func NewGormSellerRepository

func NewGormSellerRepository(db *gorm.DB) repositories.SellerRepository

Types

type GormProductRepository

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

func (*GormProductRepository) Create

func (*GormProductRepository) Delete

func (repo *GormProductRepository) Delete(id uuid.UUID) error

func (*GormProductRepository) FindAll

func (repo *GormProductRepository) FindAll() ([]*entities.Product, error)

func (*GormProductRepository) FindById

func (repo *GormProductRepository) FindById(id uuid.UUID) (*entities.Product, error)

func (*GormProductRepository) Update

type GormSellerRepository

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

func (*GormSellerRepository) Create

func (*GormSellerRepository) Delete

func (repo *GormSellerRepository) Delete(id uuid.UUID) error

func (*GormSellerRepository) FindAll

func (repo *GormSellerRepository) FindAll() ([]*entities.Seller, error)

func (*GormSellerRepository) FindById

func (repo *GormSellerRepository) FindById(id uuid.UUID) (*entities.Seller, error)

func (*GormSellerRepository) Update

type Product

type Product struct {
	Id        uuid.UUID `gorm:"primaryKey"`
	Name      string
	Price     float64
	SellerId  uuid.UUID `gorm:"index"`
	Seller    Seller    `gorm:"foreignKey:SellerId"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Seller

type Seller struct {
	Id        uuid.UUID `gorm:"primaryKey"`
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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