adapter

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProductDeleteRepository added in v0.0.2

func CreateProductDeleteRepository(dependencies map[string]interface{}) (interface{}, error)

func CreateProductFindAllRepository added in v0.0.2

func CreateProductFindAllRepository(dependencies map[string]interface{}) (interface{}, error)

func CreateProductFindRepository added in v0.0.2

func CreateProductFindRepository(dependencies map[string]interface{}) (interface{}, error)

func CreateProductSaveRepository added in v0.0.2

func CreateProductSaveRepository(dependencies map[string]interface{}) (interface{}, error)

func NewGormProductDeleteRepository added in v0.0.2

func NewGormProductDeleteRepository(db *gorm.DB) domain.ProductDeleteRepository

func NewGormProductFindAllRepository added in v0.0.2

func NewGormProductFindAllRepository(db *gorm.DB) domain.ProductFindAllRepository

func NewGormProductFindRepository added in v0.0.2

func NewGormProductFindRepository(db *gorm.DB) domain.ProductFindRepository

func NewGormProductSaveRepository added in v0.0.2

func NewGormProductSaveRepository(db *gorm.DB) domain.ProductSaveRepository

Types

type GormProductEntity

type GormProductEntity struct {
	ID          string    `gorm:"primaryKey;type:text;default:(lower(hex(randomblob(16))))" json:"id"`
	Name        string    `gorm:"type:varchar(100);not null" json:"name"`
	Description string    `gorm:"type:text;not null" json:"description"`
	Price       float64   `gorm:"not null" json:"price"`
	CreatedAt   time.Time `gorm:"type:timestamp;not null" json:"created_at"`
	UpdatedAt   time.Time `gorm:"type:timestamp;not null" json:"updated_at"`
}

func NewProductEntityFromDomain

func NewProductEntityFromDomain(product *domain.Product) (*GormProductEntity, error)

func (*GormProductEntity) ToDomain

func (pe *GormProductEntity) ToDomain() (*domain.Product, error)

Jump to

Keyboard shortcuts

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