fake

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCategory

func LoadCategory(categoryCode string, testDataFiles map[string]string, logger flamingo.Logger) domain.Category

LoadCategory returns category data from file

func LoadCategoryTree

func LoadCategoryTree(testDataFiles map[string]string, logger flamingo.Logger) []*domain.TreeData

LoadCategoryTree returns tree data from file

func RegisterTestData

func RegisterTestData(folder string, logger flamingo.Logger) map[string]string

RegisterTestData returns files of given folder

Types

type CategoryService

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

CategoryService returns category test data

func (CategoryService) Get

func (f CategoryService) Get(_ context.Context, categoryCode string) (domain.Category, error)

Get the category of the given category code

func (*CategoryService) Inject

func (f *CategoryService) Inject(logger flamingo.Logger, config *struct {
	TestDataFolder string `inject:"config:commerce.category.fakeService.testDataFolder,optional"`
})

Inject dependencies

func (CategoryService) Tree

func (f CategoryService) Tree(_ context.Context, activeCategoryCode string) (domain.Tree, error)

Tree returns the tree the given category belongs to

Jump to

Keyboard shortcuts

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