service

package
v0.0.0-...-9eb387d Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FrontEndURLVerify = "https://ceritanya-front-end.com/verify/"
)

Variables

View Source
var JWTKey = []byte("my_secret_key")

Functions

func Register

func Register(container *dig.Container) error

Types

type Auth

type Auth interface {
	SignIn(ctx context.Context, req *dto.SignInRequest) (*dto.SignInResponse, error)
	SignUp(ctx context.Context, req *dto.SignUpRequest) (*dto.SignUpResponse, error)
	VerifyEmail(ctx context.Context, code string) (*dto.SignInResponse, error)
}

func NewAuth

func NewAuth(deps shared.Deps, repo repository.Auth) (Auth, error)

type Claims

type Claims struct {
	ID uint
	jwt.StandardClaims
}

type Holder

type Holder struct {
	dig.In
	Auth    Auth
	Product Product
}

type Product

type Product interface {
	CreateProduct(ctx context.Context, req *dto.CreateProductRequest) (*dto.CreateProductResponse, error)
	UploadProductPhoto(ctx context.Context, fileHeader *multipart.FileHeader, id uint) error
	GetProductCatalog(ctx context.Context, userID uint, limit int, offset int) (*dto.ProductsResponse, error)
	FindProducts(ctx context.Context, search string, limit int, offset int) ([]*dto.ProductOverviewResponse, error)
	FindProductByID(ctx context.Context, id uint) (*dto.ProductDetailResponse, error)
}

func NewProduct

func NewProduct(deps shared.Deps, repo repository.Product) (Product, error)

Jump to

Keyboard shortcuts

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