internal

package
v0.0.0-...-ddc95ab Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("entity not found")
)

Functions

func ListenGRPC

func ListenGRPC(s Service, port int) error

Types

type Repository

type Repository interface {
	Close()
	PutProduct(ctx context.Context, p *models.Product) error
	GetProductById(ctx context.Context, id string) (*models.Product, error)
	ListProducts(ctx context.Context, skip, take uint64) ([]*models.Product, error)
	ListProductsWithIDs(ctx context.Context, ids []string) ([]*models.Product, error)
	SearchProducts(ctx context.Context, query string, skip, take uint64) ([]*models.Product, error)
	UpdateProduct(ctx context.Context, updatedProduct *models.Product) error
	DeleteProduct(ctx context.Context, productId string) error
}

func NewElasticRepository

func NewElasticRepository(url string) (Repository, error)

type Service

type Service interface {
	PostProduct(ctx context.Context, name, description string, price float64, accountId int) (*models.Product, error)
	GetProduct(ctx context.Context, id string) (*models.Product, error)
	GetProducts(ctx context.Context, skip, take uint64) ([]*models.Product, error)
	GetProductsWithIDs(ctx context.Context, ids []string) ([]*models.Product, error)
	SearchProducts(ctx context.Context, query string, skip, take uint64) ([]*models.Product, error)
	UpdateProduct(ctx context.Context, id, name, description string, price float64, accountId int) (*models.Product, error)
	DeleteProduct(ctx context.Context, productId string, accountId int) error
	GetProducer() sarama.AsyncProducer
}

func NewProductService

func NewProductService(repository Repository, producer sarama.AsyncProducer) Service

Jump to

Keyboard shortcuts

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