services

package
v0.0.0-...-bd79654 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

cart.

payment verification and transaction management.

product listing.

user login and resgistration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartService

type CartService interface {
	GetCartByUserID(userID string) (*models.Cart, error)
	ClearCart(userID string) error
}

func NewCartService

func NewCartService(repo repositories.CartRepository) CartService

type CheckoutService

type CheckoutService interface {
	ProcessCheckout(checkout models.Checkout) error
	CreateCheckout(checkout models.Checkout) error
}

type DefaultCartService

type DefaultCartService struct {
	Repo repositories.CartRepository
}

func (*DefaultCartService) ClearCart

func (s *DefaultCartService) ClearCart(userID string) error

func (*DefaultCartService) GetCartByUserID

func (s *DefaultCartService) GetCartByUserID(userID string) (*models.Cart, error)

type DefaultCheckoutService

type DefaultCheckoutService struct {
	Repo repositories.CheckoutRepository
}

func (*DefaultCheckoutService) CreateCheckout

func (s *DefaultCheckoutService) CreateCheckout(checkout models.Checkout) error

func (*DefaultCheckoutService) ProcessCheckout

func (s *DefaultCheckoutService) ProcessCheckout(checkout models.Checkout) error

type DefaultLogService

type DefaultLogService struct {
	Repo repositories.LogRepository
}

func (*DefaultLogService) LogAttack

func (s *DefaultLogService) LogAttack(attackType, details, ip string) error

type DefaultProductService

type DefaultProductService struct {
	Repo repositories.ProductRepository
}

func (*DefaultProductService) AddProduct

func (s *DefaultProductService) AddProduct(product models.Product) error

func (*DefaultProductService) FetchAllProducts

func (s *DefaultProductService) FetchAllProducts() ([]models.Product, error)

func (*DefaultProductService) GetProductByID

func (s *DefaultProductService) GetProductByID(productID string) (*models.Product, error)

func (*DefaultProductService) SearchProducts

func (s *DefaultProductService) SearchProducts(keyword string) ([]models.Product, error)

type DefaultUserService

type DefaultUserService struct {
	Repo repositories.UserRepository
}

func (*DefaultUserService) Login

func (s *DefaultUserService) Login(username, password, ip string) (models.User, error)

func (*DefaultUserService) Register

func (s *DefaultUserService) Register(username, password, email string) (models.User, error)

type LogService

type LogService interface {
	LogAttack(attackType, details, ip string) error
}

type ProductService

type ProductService interface {
	FetchAllProducts() ([]models.Product, error)
	SearchProducts(keyword string) ([]models.Product, error)
	AddProduct(product models.Product) error
	GetProductByID(productID string) (*models.Product, error)
}

type UserService

type UserService interface {
	Login(username, password, ip string) (models.User, error)
	Register(username, password, email string) (models.User, error)
}

Jump to

Keyboard shortcuts

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