Documentation ¶
Overview ¶
Code generated by carrier, DO NOT EDIT.
Code generated by carrier, DO NOT EDIT.
Code generated by carrier, DO NOT EDIT.
Code generated by carrier, DO NOT EDIT.
Code generated by carrier, DO NOT EDIT.
Code generated by carrier, DO NOT EDIT.
Code generated by carrier, DO NOT EDIT.
Index ¶
- Constants
- func CategoryTrait() *categoryTrait
- func IngredientTrait() *ingredientTrait
- func RecipeIngredientTrait() *recipeIngredientTrait
- func RecipeStepTrait() *recipeStepTrait
- func RecipeTrait() *recipeTrait
- func UserTrait() *userTrait
- type CategoryBuilder
- func (b *CategoryBuilder) Create(ctx context.Context) (*model.Category, error)
- func (b *CategoryBuilder) CreateBatch(ctx context.Context, n int) ([]*model.Category, error)
- func (b *CategoryBuilder) CreateBatchV(ctx context.Context, n int) ([]model.Category, error)
- func (b *CategoryBuilder) CreateV(ctx context.Context) (model.Category, error)
- func (b *CategoryBuilder) SetName(i string) *CategoryBuilder
- type CategoryFactory
- func (f *CategoryFactory) Create(ctx context.Context) (*model.Category, error)
- func (f *CategoryFactory) CreateBatch(ctx context.Context, n int) ([]*model.Category, error)
- func (f *CategoryFactory) CreateBatchV(ctx context.Context, n int) ([]model.Category, error)
- func (f *CategoryFactory) CreateV(ctx context.Context) (model.Category, error)
- func (f *CategoryFactory) SetName(i string) *CategoryBuilder
- type CategoryMetaFactory
- func (f *CategoryMetaFactory) Build() *CategoryFactory
- func (f *CategoryMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Category) error) *CategoryMetaFactory
- func (f *CategoryMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Category) error) *CategoryMetaFactory
- func (f *CategoryMetaFactory) SetNameDefault(v string) *CategoryMetaFactory
- func (f *CategoryMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *CategoryMetaFactory
- func (f *CategoryMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.Category) (string, error)) *CategoryMetaFactory
- func (f *CategoryMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *CategoryMetaFactory
- type Counter
- type IngredientBuilder
- func (b *IngredientBuilder) Create(ctx context.Context) (*model.Ingredient, error)
- func (b *IngredientBuilder) CreateBatch(ctx context.Context, n int) ([]*model.Ingredient, error)
- func (b *IngredientBuilder) CreateBatchV(ctx context.Context, n int) ([]model.Ingredient, error)
- func (b *IngredientBuilder) CreateV(ctx context.Context) (model.Ingredient, error)
- func (b *IngredientBuilder) SetName(i string) *IngredientBuilder
- func (b *IngredientBuilder) SetTags(i []*model.Category) *IngredientBuilder
- type IngredientFactory
- func (f *IngredientFactory) Create(ctx context.Context) (*model.Ingredient, error)
- func (f *IngredientFactory) CreateBatch(ctx context.Context, n int) ([]*model.Ingredient, error)
- func (f *IngredientFactory) CreateBatchV(ctx context.Context, n int) ([]model.Ingredient, error)
- func (f *IngredientFactory) CreateV(ctx context.Context) (model.Ingredient, error)
- func (f *IngredientFactory) SetName(i string) *IngredientBuilder
- func (f *IngredientFactory) SetTags(i []*model.Category) *IngredientBuilder
- type IngredientMetaFactory
- func (f *IngredientMetaFactory) Build() *IngredientFactory
- func (f *IngredientMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Ingredient) error) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Ingredient) error) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetNameDefault(v string) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.Ingredient) (string, error)) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetTagsDefault(v []*model.Category) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetTagsFactory(fn func(ctx context.Context) ([]*model.Category, error)) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetTagsLazy(fn func(ctx context.Context, i *model.Ingredient) ([]*model.Category, error)) *IngredientMetaFactory
- func (f *IngredientMetaFactory) SetTagsSequence(fn func(ctx context.Context, i int) ([]*model.Category, error)) *IngredientMetaFactory
- type RecipeBuilder
- func (b *RecipeBuilder) Create(ctx context.Context) (*model.Recipe, error)
- func (b *RecipeBuilder) CreateBatch(ctx context.Context, n int) ([]*model.Recipe, error)
- func (b *RecipeBuilder) CreateBatchV(ctx context.Context, n int) ([]model.Recipe, error)
- func (b *RecipeBuilder) CreateV(ctx context.Context) (model.Recipe, error)
- func (b *RecipeBuilder) SetAuthorName(i string) *RecipeBuilder
- func (b *RecipeBuilder) SetIngredients(i []*model.RecipeIngredient) *RecipeBuilder
- func (b *RecipeBuilder) SetIngredientsCountPost(i int) *RecipeBuilder
- func (b *RecipeBuilder) SetName(i string) *RecipeBuilder
- func (b *RecipeBuilder) SetRelated(i []*model.Recipe) *RecipeBuilder
- func (b *RecipeBuilder) SetServings(i int) *RecipeBuilder
- func (b *RecipeBuilder) SetSteps(i []*model.RecipeStep) *RecipeBuilder
- func (b *RecipeBuilder) SetStepsCountPost(i int) *RecipeBuilder
- func (b *RecipeBuilder) SetTags(i []*model.Category) *RecipeBuilder
- func (b *RecipeBuilder) WithKetoTrait() *RecipeBuilder
- func (b *RecipeBuilder) WithVeganTrait() *RecipeBuilder
- type RecipeFactory
- func (f *RecipeFactory) Create(ctx context.Context) (*model.Recipe, error)
- func (f *RecipeFactory) CreateBatch(ctx context.Context, n int) ([]*model.Recipe, error)
- func (f *RecipeFactory) CreateBatchV(ctx context.Context, n int) ([]model.Recipe, error)
- func (f *RecipeFactory) CreateV(ctx context.Context) (model.Recipe, error)
- func (f *RecipeFactory) SetAuthorName(i string) *RecipeBuilder
- func (f *RecipeFactory) SetIngredients(i []*model.RecipeIngredient) *RecipeBuilder
- func (f *RecipeFactory) SetIngredientsCountPost(i int) *RecipeBuilder
- func (f *RecipeFactory) SetName(i string) *RecipeBuilder
- func (f *RecipeFactory) SetRelated(i []*model.Recipe) *RecipeBuilder
- func (f *RecipeFactory) SetServings(i int) *RecipeBuilder
- func (f *RecipeFactory) SetSteps(i []*model.RecipeStep) *RecipeBuilder
- func (f *RecipeFactory) SetStepsCountPost(i int) *RecipeBuilder
- func (f *RecipeFactory) SetTags(i []*model.Category) *RecipeBuilder
- func (f *RecipeFactory) WithKetoTrait() *RecipeBuilder
- func (f *RecipeFactory) WithVeganTrait() *RecipeBuilder
- type RecipeIngredientBuilder
- func (b *RecipeIngredientBuilder) Create(ctx context.Context) (*model.RecipeIngredient, error)
- func (b *RecipeIngredientBuilder) CreateBatch(ctx context.Context, n int) ([]*model.RecipeIngredient, error)
- func (b *RecipeIngredientBuilder) CreateBatchV(ctx context.Context, n int) ([]model.RecipeIngredient, error)
- func (b *RecipeIngredientBuilder) CreateV(ctx context.Context) (model.RecipeIngredient, error)
- func (b *RecipeIngredientBuilder) SetIngredient(i *model.Ingredient) *RecipeIngredientBuilder
- func (b *RecipeIngredientBuilder) SetQuantity(i float32) *RecipeIngredientBuilder
- func (b *RecipeIngredientBuilder) SetUnit(i string) *RecipeIngredientBuilder
- type RecipeIngredientFactory
- func (f *RecipeIngredientFactory) Create(ctx context.Context) (*model.RecipeIngredient, error)
- func (f *RecipeIngredientFactory) CreateBatch(ctx context.Context, n int) ([]*model.RecipeIngredient, error)
- func (f *RecipeIngredientFactory) CreateBatchV(ctx context.Context, n int) ([]model.RecipeIngredient, error)
- func (f *RecipeIngredientFactory) CreateV(ctx context.Context) (model.RecipeIngredient, error)
- func (f *RecipeIngredientFactory) SetIngredient(i *model.Ingredient) *RecipeIngredientBuilder
- func (f *RecipeIngredientFactory) SetQuantity(i float32) *RecipeIngredientBuilder
- func (f *RecipeIngredientFactory) SetUnit(i string) *RecipeIngredientBuilder
- type RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) Build() *RecipeIngredientFactory
- func (f *RecipeIngredientMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.RecipeIngredient) error) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.RecipeIngredient) error) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetIngredientDefault(v *model.Ingredient) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetIngredientFactory(fn func(ctx context.Context) (*model.Ingredient, error)) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetIngredientLazy(...) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetIngredientSequence(fn func(ctx context.Context, i int) (*model.Ingredient, error)) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetQuantityDefault(v float32) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetQuantityFactory(fn func(ctx context.Context) (float32, error)) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetQuantityLazy(fn func(ctx context.Context, i *model.RecipeIngredient) (float32, error)) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetQuantitySequence(fn func(ctx context.Context, i int) (float32, error)) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetUnitDefault(v string) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetUnitFactory(fn func(ctx context.Context) (string, error)) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetUnitLazy(fn func(ctx context.Context, i *model.RecipeIngredient) (string, error)) *RecipeIngredientMetaFactory
- func (f *RecipeIngredientMetaFactory) SetUnitSequence(fn func(ctx context.Context, i int) (string, error)) *RecipeIngredientMetaFactory
- type RecipeMetaFactory
- func (f *RecipeMetaFactory) Build() *RecipeFactory
- func (f *RecipeMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Recipe) error) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetAuthorNameDefault(v string) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetAuthorNameFactory(fn func(ctx context.Context) (string, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetAuthorNameLazy(fn func(ctx context.Context, i *model.Recipe) (string, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetAuthorNameSequence(fn func(ctx context.Context, i int) (string, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Recipe) error) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetIngredientsCountPostFunc(fn func(ctx context.Context, set bool, obj *model.Recipe, i int) error) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetIngredientsDefault(v []*model.RecipeIngredient) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetIngredientsFactory(fn func(ctx context.Context) ([]*model.RecipeIngredient, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetIngredientsLazy(...) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetIngredientsSequence(fn func(ctx context.Context, i int) ([]*model.RecipeIngredient, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetKetoTrait(t *recipeTrait) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetNameDefault(v string) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.Recipe) (string, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetRelatedDefault(v []*model.Recipe) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetRelatedFactory(fn func(ctx context.Context) ([]*model.Recipe, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetRelatedLazy(fn func(ctx context.Context, i *model.Recipe) ([]*model.Recipe, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetRelatedSequence(fn func(ctx context.Context, i int) ([]*model.Recipe, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetServingsDefault(v int) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetServingsFactory(fn func(ctx context.Context) (int, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetServingsLazy(fn func(ctx context.Context, i *model.Recipe) (int, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetServingsSequence(fn func(ctx context.Context, i int) (int, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetStepsCountPostFunc(fn func(ctx context.Context, set bool, obj *model.Recipe, i int) error) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetStepsDefault(v []*model.RecipeStep) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetStepsFactory(fn func(ctx context.Context) ([]*model.RecipeStep, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetStepsLazy(fn func(ctx context.Context, i *model.Recipe) ([]*model.RecipeStep, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetStepsSequence(fn func(ctx context.Context, i int) ([]*model.RecipeStep, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetTagsDefault(v []*model.Category) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetTagsFactory(fn func(ctx context.Context) ([]*model.Category, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetTagsLazy(fn func(ctx context.Context, i *model.Recipe) ([]*model.Category, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetTagsSequence(fn func(ctx context.Context, i int) ([]*model.Category, error)) *RecipeMetaFactory
- func (f *RecipeMetaFactory) SetVeganTrait(t *recipeTrait) *RecipeMetaFactory
- type RecipeStepBuilder
- func (b *RecipeStepBuilder) Create(ctx context.Context) (*model.RecipeStep, error)
- func (b *RecipeStepBuilder) CreateBatch(ctx context.Context, n int) ([]*model.RecipeStep, error)
- func (b *RecipeStepBuilder) CreateBatchV(ctx context.Context, n int) ([]model.RecipeStep, error)
- func (b *RecipeStepBuilder) CreateV(ctx context.Context) (model.RecipeStep, error)
- func (b *RecipeStepBuilder) SetText(i string) *RecipeStepBuilder
- type RecipeStepFactory
- func (f *RecipeStepFactory) Create(ctx context.Context) (*model.RecipeStep, error)
- func (f *RecipeStepFactory) CreateBatch(ctx context.Context, n int) ([]*model.RecipeStep, error)
- func (f *RecipeStepFactory) CreateBatchV(ctx context.Context, n int) ([]model.RecipeStep, error)
- func (f *RecipeStepFactory) CreateV(ctx context.Context) (model.RecipeStep, error)
- func (f *RecipeStepFactory) SetText(i string) *RecipeStepBuilder
- type RecipeStepMetaFactory
- func (f *RecipeStepMetaFactory) Build() *RecipeStepFactory
- func (f *RecipeStepMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.RecipeStep) error) *RecipeStepMetaFactory
- func (f *RecipeStepMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.RecipeStep) error) *RecipeStepMetaFactory
- func (f *RecipeStepMetaFactory) SetTextDefault(v string) *RecipeStepMetaFactory
- func (f *RecipeStepMetaFactory) SetTextFactory(fn func(ctx context.Context) (string, error)) *RecipeStepMetaFactory
- func (f *RecipeStepMetaFactory) SetTextLazy(fn func(ctx context.Context, i *model.RecipeStep) (string, error)) *RecipeStepMetaFactory
- func (f *RecipeStepMetaFactory) SetTextSequence(fn func(ctx context.Context, i int) (string, error)) *RecipeStepMetaFactory
- type UserBuilder
- func (b *UserBuilder) Create(ctx context.Context) (*model.User, error)
- func (b *UserBuilder) CreateBatch(ctx context.Context, n int) ([]*model.User, error)
- func (b *UserBuilder) CreateBatchV(ctx context.Context, n int) ([]model.User, error)
- func (b *UserBuilder) CreateV(ctx context.Context) (model.User, error)
- func (b *UserBuilder) SetName(i string) *UserBuilder
- func (b *UserBuilder) SetRecipes(i []*model.Recipe) *UserBuilder
- func (b *UserBuilder) SetRecipesPost(i int) *UserBuilder
- func (b *UserBuilder) SetTags(i []*model.Category) *UserBuilder
- type UserFactory
- func (f *UserFactory) Create(ctx context.Context) (*model.User, error)
- func (f *UserFactory) CreateBatch(ctx context.Context, n int) ([]*model.User, error)
- func (f *UserFactory) CreateBatchV(ctx context.Context, n int) ([]model.User, error)
- func (f *UserFactory) CreateV(ctx context.Context) (model.User, error)
- func (f *UserFactory) SetName(i string) *UserBuilder
- func (f *UserFactory) SetRecipes(i []*model.Recipe) *UserBuilder
- func (f *UserFactory) SetRecipesPost(i int) *UserBuilder
- func (f *UserFactory) SetTags(i []*model.Category) *UserBuilder
- type UserMetaFactory
- func (f *UserMetaFactory) Build() *UserFactory
- func (f *UserMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.User) error) *UserMetaFactory
- func (f *UserMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.User) error) *UserMetaFactory
- func (f *UserMetaFactory) SetNameDefault(v string) *UserMetaFactory
- func (f *UserMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *UserMetaFactory
- func (f *UserMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.User) (string, error)) *UserMetaFactory
- func (f *UserMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *UserMetaFactory
- func (f *UserMetaFactory) SetRecipesDefault(v []*model.Recipe) *UserMetaFactory
- func (f *UserMetaFactory) SetRecipesFactory(fn func(ctx context.Context) ([]*model.Recipe, error)) *UserMetaFactory
- func (f *UserMetaFactory) SetRecipesLazy(fn func(ctx context.Context, i *model.User) ([]*model.Recipe, error)) *UserMetaFactory
- func (f *UserMetaFactory) SetRecipesPostFunc(fn func(ctx context.Context, set bool, obj *model.User, i int) error) *UserMetaFactory
- func (f *UserMetaFactory) SetRecipesSequence(fn func(ctx context.Context, i int) ([]*model.Recipe, error)) *UserMetaFactory
- func (f *UserMetaFactory) SetTagsDefault(v []*model.Category) *UserMetaFactory
- func (f *UserMetaFactory) SetTagsFactory(fn func(ctx context.Context) ([]*model.Category, error)) *UserMetaFactory
- func (f *UserMetaFactory) SetTagsLazy(fn func(ctx context.Context, i *model.User) ([]*model.Category, error)) *UserMetaFactory
- func (f *UserMetaFactory) SetTagsSequence(fn func(ctx context.Context, i int) ([]*model.Category, error)) *UserMetaFactory
Constants ¶
const ( TypeDefault = iota + 1 // default value TypeFactory // subfactory TypeSequence // sequence TypeLazy // lazy function TypePost // post generation )
Variables ¶
This section is empty.
Functions ¶
func CategoryTrait ¶
func CategoryTrait() *categoryTrait
func IngredientTrait ¶
func IngredientTrait() *ingredientTrait
func RecipeIngredientTrait ¶
func RecipeIngredientTrait() *recipeIngredientTrait
func RecipeStepTrait ¶
func RecipeStepTrait() *recipeStepTrait
func RecipeTrait ¶
func RecipeTrait() *recipeTrait
Types ¶
type CategoryBuilder ¶
type CategoryBuilder struct {
// contains filtered or unexported fields
}
func (*CategoryBuilder) CreateBatch ¶
func (*CategoryBuilder) CreateBatchV ¶
func (*CategoryBuilder) SetName ¶
func (b *CategoryBuilder) SetName(i string) *CategoryBuilder
SetName set the Name field
type CategoryFactory ¶
type CategoryFactory struct {
// contains filtered or unexported fields
}
func (*CategoryFactory) CreateBatch ¶
CreateBatch return a []*model.Category slice
func (*CategoryFactory) CreateBatchV ¶
CreateBatchV return a []model.Category slice
func (*CategoryFactory) SetName ¶
func (f *CategoryFactory) SetName(i string) *CategoryBuilder
SetName set the Name field
type CategoryMetaFactory ¶
type CategoryMetaFactory struct {
// contains filtered or unexported fields
}
func (*CategoryMetaFactory) Build ¶
func (f *CategoryMetaFactory) Build() *CategoryFactory
Build create a CategoryFactory from CategoryMetaFactory
func (*CategoryMetaFactory) SetAfterCreateFunc ¶
func (f *CategoryMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Category) error) *CategoryMetaFactory
SetAfterCreateFunc register a function to be called after struct create
func (*CategoryMetaFactory) SetBeforeCreateFunc ¶ added in v0.1.1
func (f *CategoryMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Category) error) *CategoryMetaFactory
SetBeforeCreateFunc register a function to be called before struct create
func (*CategoryMetaFactory) SetNameDefault ¶
func (f *CategoryMetaFactory) SetNameDefault(v string) *CategoryMetaFactory
SetNameDefault assign a default value to Name field
func (*CategoryMetaFactory) SetNameFactory ¶
func (f *CategoryMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *CategoryMetaFactory
SetNameFactory register a factory function and assign return value to Name, you can also use related factory's Create/CreateV as input function here
func (*CategoryMetaFactory) SetNameLazy ¶
func (f *CategoryMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.Category) (string, error)) *CategoryMetaFactory
SetNameLazy register a function which accept the build struct and set return value to Name field
func (*CategoryMetaFactory) SetNameSequence ¶
func (f *CategoryMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *CategoryMetaFactory
SetNameSequence register a function which accept a sequence counter and set return value to Name field
type IngredientBuilder ¶
type IngredientBuilder struct {
// contains filtered or unexported fields
}
func (*IngredientBuilder) Create ¶
func (b *IngredientBuilder) Create(ctx context.Context) (*model.Ingredient, error)
Create return a new *model.Ingredient
func (*IngredientBuilder) CreateBatch ¶
func (b *IngredientBuilder) CreateBatch(ctx context.Context, n int) ([]*model.Ingredient, error)
func (*IngredientBuilder) CreateBatchV ¶
func (b *IngredientBuilder) CreateBatchV(ctx context.Context, n int) ([]model.Ingredient, error)
func (*IngredientBuilder) CreateV ¶
func (b *IngredientBuilder) CreateV(ctx context.Context) (model.Ingredient, error)
CreateV return a new model.Ingredient
func (*IngredientBuilder) SetName ¶
func (b *IngredientBuilder) SetName(i string) *IngredientBuilder
SetName set the Name field
func (*IngredientBuilder) SetTags ¶
func (b *IngredientBuilder) SetTags(i []*model.Category) *IngredientBuilder
SetTags set the Tags field
type IngredientFactory ¶
type IngredientFactory struct {
// contains filtered or unexported fields
}
func (*IngredientFactory) Create ¶
func (f *IngredientFactory) Create(ctx context.Context) (*model.Ingredient, error)
Create return a new *model.Ingredient
func (*IngredientFactory) CreateBatch ¶
func (f *IngredientFactory) CreateBatch(ctx context.Context, n int) ([]*model.Ingredient, error)
CreateBatch return a []*model.Ingredient slice
func (*IngredientFactory) CreateBatchV ¶
func (f *IngredientFactory) CreateBatchV(ctx context.Context, n int) ([]model.Ingredient, error)
CreateBatchV return a []model.Ingredient slice
func (*IngredientFactory) CreateV ¶
func (f *IngredientFactory) CreateV(ctx context.Context) (model.Ingredient, error)
CreateV return a new model.Ingredient
func (*IngredientFactory) SetName ¶
func (f *IngredientFactory) SetName(i string) *IngredientBuilder
SetName set the Name field
func (*IngredientFactory) SetTags ¶
func (f *IngredientFactory) SetTags(i []*model.Category) *IngredientBuilder
SetTags set the Tags field
type IngredientMetaFactory ¶
type IngredientMetaFactory struct {
// contains filtered or unexported fields
}
func (*IngredientMetaFactory) Build ¶
func (f *IngredientMetaFactory) Build() *IngredientFactory
Build create a IngredientFactory from IngredientMetaFactory
func (*IngredientMetaFactory) SetAfterCreateFunc ¶
func (f *IngredientMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Ingredient) error) *IngredientMetaFactory
SetAfterCreateFunc register a function to be called after struct create
func (*IngredientMetaFactory) SetBeforeCreateFunc ¶ added in v0.1.1
func (f *IngredientMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Ingredient) error) *IngredientMetaFactory
SetBeforeCreateFunc register a function to be called before struct create
func (*IngredientMetaFactory) SetNameDefault ¶
func (f *IngredientMetaFactory) SetNameDefault(v string) *IngredientMetaFactory
SetNameDefault assign a default value to Name field
func (*IngredientMetaFactory) SetNameFactory ¶
func (f *IngredientMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *IngredientMetaFactory
SetNameFactory register a factory function and assign return value to Name, you can also use related factory's Create/CreateV as input function here
func (*IngredientMetaFactory) SetNameLazy ¶
func (f *IngredientMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.Ingredient) (string, error)) *IngredientMetaFactory
SetNameLazy register a function which accept the build struct and set return value to Name field
func (*IngredientMetaFactory) SetNameSequence ¶
func (f *IngredientMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *IngredientMetaFactory
SetNameSequence register a function which accept a sequence counter and set return value to Name field
func (*IngredientMetaFactory) SetTagsDefault ¶
func (f *IngredientMetaFactory) SetTagsDefault(v []*model.Category) *IngredientMetaFactory
SetTagsDefault assign a default value to Tags field
func (*IngredientMetaFactory) SetTagsFactory ¶
func (f *IngredientMetaFactory) SetTagsFactory(fn func(ctx context.Context) ([]*model.Category, error)) *IngredientMetaFactory
SetTagsFactory register a factory function and assign return value to Tags, you can also use related factory's Create/CreateV as input function here
func (*IngredientMetaFactory) SetTagsLazy ¶
func (f *IngredientMetaFactory) SetTagsLazy(fn func(ctx context.Context, i *model.Ingredient) ([]*model.Category, error)) *IngredientMetaFactory
SetTagsLazy register a function which accept the build struct and set return value to Tags field
func (*IngredientMetaFactory) SetTagsSequence ¶
func (f *IngredientMetaFactory) SetTagsSequence(fn func(ctx context.Context, i int) ([]*model.Category, error)) *IngredientMetaFactory
SetTagsSequence register a function which accept a sequence counter and set return value to Tags field
type RecipeBuilder ¶
type RecipeBuilder struct {
// contains filtered or unexported fields
}
func (*RecipeBuilder) CreateBatch ¶
func (*RecipeBuilder) CreateBatchV ¶
func (*RecipeBuilder) SetAuthorName ¶
func (b *RecipeBuilder) SetAuthorName(i string) *RecipeBuilder
SetAuthorName set the AuthorName field
func (*RecipeBuilder) SetIngredients ¶
func (b *RecipeBuilder) SetIngredients(i []*model.RecipeIngredient) *RecipeBuilder
SetIngredients set the Ingredients field
func (*RecipeBuilder) SetIngredientsCountPost ¶
func (b *RecipeBuilder) SetIngredientsCountPost(i int) *RecipeBuilder
SetIngredientsCountPost call the post function with int input
func (*RecipeBuilder) SetName ¶
func (b *RecipeBuilder) SetName(i string) *RecipeBuilder
SetName set the Name field
func (*RecipeBuilder) SetRelated ¶
func (b *RecipeBuilder) SetRelated(i []*model.Recipe) *RecipeBuilder
SetRelated set the Related field
func (*RecipeBuilder) SetServings ¶
func (b *RecipeBuilder) SetServings(i int) *RecipeBuilder
SetServings set the Servings field
func (*RecipeBuilder) SetSteps ¶
func (b *RecipeBuilder) SetSteps(i []*model.RecipeStep) *RecipeBuilder
SetSteps set the Steps field
func (*RecipeBuilder) SetStepsCountPost ¶
func (b *RecipeBuilder) SetStepsCountPost(i int) *RecipeBuilder
SetStepsCountPost call the post function with int input
func (*RecipeBuilder) SetTags ¶
func (b *RecipeBuilder) SetTags(i []*model.Category) *RecipeBuilder
SetTags set the Tags field
func (*RecipeBuilder) WithKetoTrait ¶
func (b *RecipeBuilder) WithKetoTrait() *RecipeBuilder
WithKetoTrait() enable the Keto trait
func (*RecipeBuilder) WithVeganTrait ¶
func (b *RecipeBuilder) WithVeganTrait() *RecipeBuilder
WithVeganTrait() enable the Vegan trait
type RecipeFactory ¶
type RecipeFactory struct {
// contains filtered or unexported fields
}
func (*RecipeFactory) CreateBatch ¶
CreateBatch return a []*model.Recipe slice
func (*RecipeFactory) CreateBatchV ¶
CreateBatchV return a []model.Recipe slice
func (*RecipeFactory) SetAuthorName ¶
func (f *RecipeFactory) SetAuthorName(i string) *RecipeBuilder
SetAuthorName set the AuthorName field
func (*RecipeFactory) SetIngredients ¶
func (f *RecipeFactory) SetIngredients(i []*model.RecipeIngredient) *RecipeBuilder
SetIngredients set the Ingredients field
func (*RecipeFactory) SetIngredientsCountPost ¶
func (f *RecipeFactory) SetIngredientsCountPost(i int) *RecipeBuilder
SetIngredientsCountPost call the post function with int input
func (*RecipeFactory) SetName ¶
func (f *RecipeFactory) SetName(i string) *RecipeBuilder
SetName set the Name field
func (*RecipeFactory) SetRelated ¶
func (f *RecipeFactory) SetRelated(i []*model.Recipe) *RecipeBuilder
SetRelated set the Related field
func (*RecipeFactory) SetServings ¶
func (f *RecipeFactory) SetServings(i int) *RecipeBuilder
SetServings set the Servings field
func (*RecipeFactory) SetSteps ¶
func (f *RecipeFactory) SetSteps(i []*model.RecipeStep) *RecipeBuilder
SetSteps set the Steps field
func (*RecipeFactory) SetStepsCountPost ¶
func (f *RecipeFactory) SetStepsCountPost(i int) *RecipeBuilder
SetStepsCountPost call the post function with int input
func (*RecipeFactory) SetTags ¶
func (f *RecipeFactory) SetTags(i []*model.Category) *RecipeBuilder
SetTags set the Tags field
func (*RecipeFactory) WithKetoTrait ¶
func (f *RecipeFactory) WithKetoTrait() *RecipeBuilder
WithKetoTrait() enable the Keto trait
func (*RecipeFactory) WithVeganTrait ¶
func (f *RecipeFactory) WithVeganTrait() *RecipeBuilder
WithVeganTrait() enable the Vegan trait
type RecipeIngredientBuilder ¶
type RecipeIngredientBuilder struct {
// contains filtered or unexported fields
}
func (*RecipeIngredientBuilder) Create ¶
func (b *RecipeIngredientBuilder) Create(ctx context.Context) (*model.RecipeIngredient, error)
Create return a new *model.RecipeIngredient
func (*RecipeIngredientBuilder) CreateBatch ¶
func (b *RecipeIngredientBuilder) CreateBatch(ctx context.Context, n int) ([]*model.RecipeIngredient, error)
func (*RecipeIngredientBuilder) CreateBatchV ¶
func (b *RecipeIngredientBuilder) CreateBatchV(ctx context.Context, n int) ([]model.RecipeIngredient, error)
func (*RecipeIngredientBuilder) CreateV ¶
func (b *RecipeIngredientBuilder) CreateV(ctx context.Context) (model.RecipeIngredient, error)
CreateV return a new model.RecipeIngredient
func (*RecipeIngredientBuilder) SetIngredient ¶
func (b *RecipeIngredientBuilder) SetIngredient(i *model.Ingredient) *RecipeIngredientBuilder
SetIngredient set the Ingredient field
func (*RecipeIngredientBuilder) SetQuantity ¶
func (b *RecipeIngredientBuilder) SetQuantity(i float32) *RecipeIngredientBuilder
SetQuantity set the Quantity field
func (*RecipeIngredientBuilder) SetUnit ¶
func (b *RecipeIngredientBuilder) SetUnit(i string) *RecipeIngredientBuilder
SetUnit set the Unit field
type RecipeIngredientFactory ¶
type RecipeIngredientFactory struct {
// contains filtered or unexported fields
}
func (*RecipeIngredientFactory) Create ¶
func (f *RecipeIngredientFactory) Create(ctx context.Context) (*model.RecipeIngredient, error)
Create return a new *model.RecipeIngredient
func (*RecipeIngredientFactory) CreateBatch ¶
func (f *RecipeIngredientFactory) CreateBatch(ctx context.Context, n int) ([]*model.RecipeIngredient, error)
CreateBatch return a []*model.RecipeIngredient slice
func (*RecipeIngredientFactory) CreateBatchV ¶
func (f *RecipeIngredientFactory) CreateBatchV(ctx context.Context, n int) ([]model.RecipeIngredient, error)
CreateBatchV return a []model.RecipeIngredient slice
func (*RecipeIngredientFactory) CreateV ¶
func (f *RecipeIngredientFactory) CreateV(ctx context.Context) (model.RecipeIngredient, error)
CreateV return a new model.RecipeIngredient
func (*RecipeIngredientFactory) SetIngredient ¶
func (f *RecipeIngredientFactory) SetIngredient(i *model.Ingredient) *RecipeIngredientBuilder
SetIngredient set the Ingredient field
func (*RecipeIngredientFactory) SetQuantity ¶
func (f *RecipeIngredientFactory) SetQuantity(i float32) *RecipeIngredientBuilder
SetQuantity set the Quantity field
func (*RecipeIngredientFactory) SetUnit ¶
func (f *RecipeIngredientFactory) SetUnit(i string) *RecipeIngredientBuilder
SetUnit set the Unit field
type RecipeIngredientMetaFactory ¶
type RecipeIngredientMetaFactory struct {
// contains filtered or unexported fields
}
func (*RecipeIngredientMetaFactory) Build ¶
func (f *RecipeIngredientMetaFactory) Build() *RecipeIngredientFactory
Build create a RecipeIngredientFactory from RecipeIngredientMetaFactory
func (*RecipeIngredientMetaFactory) SetAfterCreateFunc ¶
func (f *RecipeIngredientMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.RecipeIngredient) error) *RecipeIngredientMetaFactory
SetAfterCreateFunc register a function to be called after struct create
func (*RecipeIngredientMetaFactory) SetBeforeCreateFunc ¶ added in v0.1.1
func (f *RecipeIngredientMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.RecipeIngredient) error) *RecipeIngredientMetaFactory
SetBeforeCreateFunc register a function to be called before struct create
func (*RecipeIngredientMetaFactory) SetIngredientDefault ¶
func (f *RecipeIngredientMetaFactory) SetIngredientDefault(v *model.Ingredient) *RecipeIngredientMetaFactory
SetIngredientDefault assign a default value to Ingredient field
func (*RecipeIngredientMetaFactory) SetIngredientFactory ¶
func (f *RecipeIngredientMetaFactory) SetIngredientFactory(fn func(ctx context.Context) (*model.Ingredient, error)) *RecipeIngredientMetaFactory
SetIngredientFactory register a factory function and assign return value to Ingredient, you can also use related factory's Create/CreateV as input function here
func (*RecipeIngredientMetaFactory) SetIngredientLazy ¶
func (f *RecipeIngredientMetaFactory) SetIngredientLazy(fn func(ctx context.Context, i *model.RecipeIngredient) (*model.Ingredient, error)) *RecipeIngredientMetaFactory
SetIngredientLazy register a function which accept the build struct and set return value to Ingredient field
func (*RecipeIngredientMetaFactory) SetIngredientSequence ¶
func (f *RecipeIngredientMetaFactory) SetIngredientSequence(fn func(ctx context.Context, i int) (*model.Ingredient, error)) *RecipeIngredientMetaFactory
SetIngredientSequence register a function which accept a sequence counter and set return value to Ingredient field
func (*RecipeIngredientMetaFactory) SetQuantityDefault ¶
func (f *RecipeIngredientMetaFactory) SetQuantityDefault(v float32) *RecipeIngredientMetaFactory
SetQuantityDefault assign a default value to Quantity field
func (*RecipeIngredientMetaFactory) SetQuantityFactory ¶
func (f *RecipeIngredientMetaFactory) SetQuantityFactory(fn func(ctx context.Context) (float32, error)) *RecipeIngredientMetaFactory
SetQuantityFactory register a factory function and assign return value to Quantity, you can also use related factory's Create/CreateV as input function here
func (*RecipeIngredientMetaFactory) SetQuantityLazy ¶
func (f *RecipeIngredientMetaFactory) SetQuantityLazy(fn func(ctx context.Context, i *model.RecipeIngredient) (float32, error)) *RecipeIngredientMetaFactory
SetQuantityLazy register a function which accept the build struct and set return value to Quantity field
func (*RecipeIngredientMetaFactory) SetQuantitySequence ¶
func (f *RecipeIngredientMetaFactory) SetQuantitySequence(fn func(ctx context.Context, i int) (float32, error)) *RecipeIngredientMetaFactory
SetQuantitySequence register a function which accept a sequence counter and set return value to Quantity field
func (*RecipeIngredientMetaFactory) SetUnitDefault ¶
func (f *RecipeIngredientMetaFactory) SetUnitDefault(v string) *RecipeIngredientMetaFactory
SetUnitDefault assign a default value to Unit field
func (*RecipeIngredientMetaFactory) SetUnitFactory ¶
func (f *RecipeIngredientMetaFactory) SetUnitFactory(fn func(ctx context.Context) (string, error)) *RecipeIngredientMetaFactory
SetUnitFactory register a factory function and assign return value to Unit, you can also use related factory's Create/CreateV as input function here
func (*RecipeIngredientMetaFactory) SetUnitLazy ¶
func (f *RecipeIngredientMetaFactory) SetUnitLazy(fn func(ctx context.Context, i *model.RecipeIngredient) (string, error)) *RecipeIngredientMetaFactory
SetUnitLazy register a function which accept the build struct and set return value to Unit field
func (*RecipeIngredientMetaFactory) SetUnitSequence ¶
func (f *RecipeIngredientMetaFactory) SetUnitSequence(fn func(ctx context.Context, i int) (string, error)) *RecipeIngredientMetaFactory
SetUnitSequence register a function which accept a sequence counter and set return value to Unit field
type RecipeMetaFactory ¶
type RecipeMetaFactory struct {
// contains filtered or unexported fields
}
func (*RecipeMetaFactory) Build ¶
func (f *RecipeMetaFactory) Build() *RecipeFactory
Build create a RecipeFactory from RecipeMetaFactory
func (*RecipeMetaFactory) SetAfterCreateFunc ¶
func (f *RecipeMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Recipe) error) *RecipeMetaFactory
SetAfterCreateFunc register a function to be called after struct create
func (*RecipeMetaFactory) SetAuthorNameDefault ¶
func (f *RecipeMetaFactory) SetAuthorNameDefault(v string) *RecipeMetaFactory
SetAuthorNameDefault assign a default value to AuthorName field
func (*RecipeMetaFactory) SetAuthorNameFactory ¶
func (f *RecipeMetaFactory) SetAuthorNameFactory(fn func(ctx context.Context) (string, error)) *RecipeMetaFactory
SetAuthorNameFactory register a factory function and assign return value to AuthorName, you can also use related factory's Create/CreateV as input function here
func (*RecipeMetaFactory) SetAuthorNameLazy ¶
func (f *RecipeMetaFactory) SetAuthorNameLazy(fn func(ctx context.Context, i *model.Recipe) (string, error)) *RecipeMetaFactory
SetAuthorNameLazy register a function which accept the build struct and set return value to AuthorName field
func (*RecipeMetaFactory) SetAuthorNameSequence ¶
func (f *RecipeMetaFactory) SetAuthorNameSequence(fn func(ctx context.Context, i int) (string, error)) *RecipeMetaFactory
SetAuthorNameSequence register a function which accept a sequence counter and set return value to AuthorName field
func (*RecipeMetaFactory) SetBeforeCreateFunc ¶ added in v0.1.1
func (f *RecipeMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Recipe) error) *RecipeMetaFactory
SetBeforeCreateFunc register a function to be called before struct create
func (*RecipeMetaFactory) SetIngredientsCountPostFunc ¶
func (f *RecipeMetaFactory) SetIngredientsCountPostFunc(fn func(ctx context.Context, set bool, obj *model.Recipe, i int) error) *RecipeMetaFactory
SetIngredientsCountPostFunc register a post function which will be called in factory SetIngredientsCountPost method
func (*RecipeMetaFactory) SetIngredientsDefault ¶
func (f *RecipeMetaFactory) SetIngredientsDefault(v []*model.RecipeIngredient) *RecipeMetaFactory
SetIngredientsDefault assign a default value to Ingredients field
func (*RecipeMetaFactory) SetIngredientsFactory ¶
func (f *RecipeMetaFactory) SetIngredientsFactory(fn func(ctx context.Context) ([]*model.RecipeIngredient, error)) *RecipeMetaFactory
SetIngredientsFactory register a factory function and assign return value to Ingredients, you can also use related factory's Create/CreateV as input function here
func (*RecipeMetaFactory) SetIngredientsLazy ¶
func (f *RecipeMetaFactory) SetIngredientsLazy(fn func(ctx context.Context, i *model.Recipe) ([]*model.RecipeIngredient, error)) *RecipeMetaFactory
SetIngredientsLazy register a function which accept the build struct and set return value to Ingredients field
func (*RecipeMetaFactory) SetIngredientsSequence ¶
func (f *RecipeMetaFactory) SetIngredientsSequence(fn func(ctx context.Context, i int) ([]*model.RecipeIngredient, error)) *RecipeMetaFactory
SetIngredientsSequence register a function which accept a sequence counter and set return value to Ingredients field
func (*RecipeMetaFactory) SetKetoTrait ¶
func (f *RecipeMetaFactory) SetKetoTrait(t *recipeTrait) *RecipeMetaFactory
SetKetoTrait accept a recipeTrait, will override builder using Trait's methods if enable
func (*RecipeMetaFactory) SetNameDefault ¶
func (f *RecipeMetaFactory) SetNameDefault(v string) *RecipeMetaFactory
SetNameDefault assign a default value to Name field
func (*RecipeMetaFactory) SetNameFactory ¶
func (f *RecipeMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *RecipeMetaFactory
SetNameFactory register a factory function and assign return value to Name, you can also use related factory's Create/CreateV as input function here
func (*RecipeMetaFactory) SetNameLazy ¶
func (f *RecipeMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.Recipe) (string, error)) *RecipeMetaFactory
SetNameLazy register a function which accept the build struct and set return value to Name field
func (*RecipeMetaFactory) SetNameSequence ¶
func (f *RecipeMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *RecipeMetaFactory
SetNameSequence register a function which accept a sequence counter and set return value to Name field
func (*RecipeMetaFactory) SetRelatedDefault ¶
func (f *RecipeMetaFactory) SetRelatedDefault(v []*model.Recipe) *RecipeMetaFactory
SetRelatedDefault assign a default value to Related field
func (*RecipeMetaFactory) SetRelatedFactory ¶
func (f *RecipeMetaFactory) SetRelatedFactory(fn func(ctx context.Context) ([]*model.Recipe, error)) *RecipeMetaFactory
SetRelatedFactory register a factory function and assign return value to Related, you can also use related factory's Create/CreateV as input function here
func (*RecipeMetaFactory) SetRelatedLazy ¶
func (f *RecipeMetaFactory) SetRelatedLazy(fn func(ctx context.Context, i *model.Recipe) ([]*model.Recipe, error)) *RecipeMetaFactory
SetRelatedLazy register a function which accept the build struct and set return value to Related field
func (*RecipeMetaFactory) SetRelatedSequence ¶
func (f *RecipeMetaFactory) SetRelatedSequence(fn func(ctx context.Context, i int) ([]*model.Recipe, error)) *RecipeMetaFactory
SetRelatedSequence register a function which accept a sequence counter and set return value to Related field
func (*RecipeMetaFactory) SetServingsDefault ¶
func (f *RecipeMetaFactory) SetServingsDefault(v int) *RecipeMetaFactory
SetServingsDefault assign a default value to Servings field
func (*RecipeMetaFactory) SetServingsFactory ¶
func (f *RecipeMetaFactory) SetServingsFactory(fn func(ctx context.Context) (int, error)) *RecipeMetaFactory
SetServingsFactory register a factory function and assign return value to Servings, you can also use related factory's Create/CreateV as input function here
func (*RecipeMetaFactory) SetServingsLazy ¶
func (f *RecipeMetaFactory) SetServingsLazy(fn func(ctx context.Context, i *model.Recipe) (int, error)) *RecipeMetaFactory
SetServingsLazy register a function which accept the build struct and set return value to Servings field
func (*RecipeMetaFactory) SetServingsSequence ¶
func (f *RecipeMetaFactory) SetServingsSequence(fn func(ctx context.Context, i int) (int, error)) *RecipeMetaFactory
SetServingsSequence register a function which accept a sequence counter and set return value to Servings field
func (*RecipeMetaFactory) SetStepsCountPostFunc ¶
func (f *RecipeMetaFactory) SetStepsCountPostFunc(fn func(ctx context.Context, set bool, obj *model.Recipe, i int) error) *RecipeMetaFactory
SetStepsCountPostFunc register a post function which will be called in factory SetStepsCountPost method
func (*RecipeMetaFactory) SetStepsDefault ¶
func (f *RecipeMetaFactory) SetStepsDefault(v []*model.RecipeStep) *RecipeMetaFactory
SetStepsDefault assign a default value to Steps field
func (*RecipeMetaFactory) SetStepsFactory ¶
func (f *RecipeMetaFactory) SetStepsFactory(fn func(ctx context.Context) ([]*model.RecipeStep, error)) *RecipeMetaFactory
SetStepsFactory register a factory function and assign return value to Steps, you can also use related factory's Create/CreateV as input function here
func (*RecipeMetaFactory) SetStepsLazy ¶
func (f *RecipeMetaFactory) SetStepsLazy(fn func(ctx context.Context, i *model.Recipe) ([]*model.RecipeStep, error)) *RecipeMetaFactory
SetStepsLazy register a function which accept the build struct and set return value to Steps field
func (*RecipeMetaFactory) SetStepsSequence ¶
func (f *RecipeMetaFactory) SetStepsSequence(fn func(ctx context.Context, i int) ([]*model.RecipeStep, error)) *RecipeMetaFactory
SetStepsSequence register a function which accept a sequence counter and set return value to Steps field
func (*RecipeMetaFactory) SetTagsDefault ¶
func (f *RecipeMetaFactory) SetTagsDefault(v []*model.Category) *RecipeMetaFactory
SetTagsDefault assign a default value to Tags field
func (*RecipeMetaFactory) SetTagsFactory ¶
func (f *RecipeMetaFactory) SetTagsFactory(fn func(ctx context.Context) ([]*model.Category, error)) *RecipeMetaFactory
SetTagsFactory register a factory function and assign return value to Tags, you can also use related factory's Create/CreateV as input function here
func (*RecipeMetaFactory) SetTagsLazy ¶
func (f *RecipeMetaFactory) SetTagsLazy(fn func(ctx context.Context, i *model.Recipe) ([]*model.Category, error)) *RecipeMetaFactory
SetTagsLazy register a function which accept the build struct and set return value to Tags field
func (*RecipeMetaFactory) SetTagsSequence ¶
func (f *RecipeMetaFactory) SetTagsSequence(fn func(ctx context.Context, i int) ([]*model.Category, error)) *RecipeMetaFactory
SetTagsSequence register a function which accept a sequence counter and set return value to Tags field
func (*RecipeMetaFactory) SetVeganTrait ¶
func (f *RecipeMetaFactory) SetVeganTrait(t *recipeTrait) *RecipeMetaFactory
SetVeganTrait accept a recipeTrait, will override builder using Trait's methods if enable
type RecipeStepBuilder ¶
type RecipeStepBuilder struct {
// contains filtered or unexported fields
}
func (*RecipeStepBuilder) Create ¶
func (b *RecipeStepBuilder) Create(ctx context.Context) (*model.RecipeStep, error)
Create return a new *model.RecipeStep
func (*RecipeStepBuilder) CreateBatch ¶
func (b *RecipeStepBuilder) CreateBatch(ctx context.Context, n int) ([]*model.RecipeStep, error)
func (*RecipeStepBuilder) CreateBatchV ¶
func (b *RecipeStepBuilder) CreateBatchV(ctx context.Context, n int) ([]model.RecipeStep, error)
func (*RecipeStepBuilder) CreateV ¶
func (b *RecipeStepBuilder) CreateV(ctx context.Context) (model.RecipeStep, error)
CreateV return a new model.RecipeStep
func (*RecipeStepBuilder) SetText ¶
func (b *RecipeStepBuilder) SetText(i string) *RecipeStepBuilder
SetText set the Text field
type RecipeStepFactory ¶
type RecipeStepFactory struct {
// contains filtered or unexported fields
}
func (*RecipeStepFactory) Create ¶
func (f *RecipeStepFactory) Create(ctx context.Context) (*model.RecipeStep, error)
Create return a new *model.RecipeStep
func (*RecipeStepFactory) CreateBatch ¶
func (f *RecipeStepFactory) CreateBatch(ctx context.Context, n int) ([]*model.RecipeStep, error)
CreateBatch return a []*model.RecipeStep slice
func (*RecipeStepFactory) CreateBatchV ¶
func (f *RecipeStepFactory) CreateBatchV(ctx context.Context, n int) ([]model.RecipeStep, error)
CreateBatchV return a []model.RecipeStep slice
func (*RecipeStepFactory) CreateV ¶
func (f *RecipeStepFactory) CreateV(ctx context.Context) (model.RecipeStep, error)
CreateV return a new model.RecipeStep
func (*RecipeStepFactory) SetText ¶
func (f *RecipeStepFactory) SetText(i string) *RecipeStepBuilder
SetText set the Text field
type RecipeStepMetaFactory ¶
type RecipeStepMetaFactory struct {
// contains filtered or unexported fields
}
func (*RecipeStepMetaFactory) Build ¶
func (f *RecipeStepMetaFactory) Build() *RecipeStepFactory
Build create a RecipeStepFactory from RecipeStepMetaFactory
func (*RecipeStepMetaFactory) SetAfterCreateFunc ¶
func (f *RecipeStepMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.RecipeStep) error) *RecipeStepMetaFactory
SetAfterCreateFunc register a function to be called after struct create
func (*RecipeStepMetaFactory) SetBeforeCreateFunc ¶ added in v0.1.1
func (f *RecipeStepMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.RecipeStep) error) *RecipeStepMetaFactory
SetBeforeCreateFunc register a function to be called before struct create
func (*RecipeStepMetaFactory) SetTextDefault ¶
func (f *RecipeStepMetaFactory) SetTextDefault(v string) *RecipeStepMetaFactory
SetTextDefault assign a default value to Text field
func (*RecipeStepMetaFactory) SetTextFactory ¶
func (f *RecipeStepMetaFactory) SetTextFactory(fn func(ctx context.Context) (string, error)) *RecipeStepMetaFactory
SetTextFactory register a factory function and assign return value to Text, you can also use related factory's Create/CreateV as input function here
func (*RecipeStepMetaFactory) SetTextLazy ¶
func (f *RecipeStepMetaFactory) SetTextLazy(fn func(ctx context.Context, i *model.RecipeStep) (string, error)) *RecipeStepMetaFactory
SetTextLazy register a function which accept the build struct and set return value to Text field
func (*RecipeStepMetaFactory) SetTextSequence ¶
func (f *RecipeStepMetaFactory) SetTextSequence(fn func(ctx context.Context, i int) (string, error)) *RecipeStepMetaFactory
SetTextSequence register a function which accept a sequence counter and set return value to Text field
type UserBuilder ¶
type UserBuilder struct {
// contains filtered or unexported fields
}
func (*UserBuilder) CreateBatch ¶
func (*UserBuilder) CreateBatchV ¶
func (*UserBuilder) SetName ¶
func (b *UserBuilder) SetName(i string) *UserBuilder
SetName set the Name field
func (*UserBuilder) SetRecipes ¶
func (b *UserBuilder) SetRecipes(i []*model.Recipe) *UserBuilder
SetRecipes set the Recipes field
func (*UserBuilder) SetRecipesPost ¶
func (b *UserBuilder) SetRecipesPost(i int) *UserBuilder
SetRecipesPost call the post function with int input
func (*UserBuilder) SetTags ¶
func (b *UserBuilder) SetTags(i []*model.Category) *UserBuilder
SetTags set the Tags field
type UserFactory ¶
type UserFactory struct {
// contains filtered or unexported fields
}
func (*UserFactory) CreateBatch ¶
CreateBatch return a []*model.User slice
func (*UserFactory) CreateBatchV ¶
CreateBatchV return a []model.User slice
func (*UserFactory) SetName ¶
func (f *UserFactory) SetName(i string) *UserBuilder
SetName set the Name field
func (*UserFactory) SetRecipes ¶
func (f *UserFactory) SetRecipes(i []*model.Recipe) *UserBuilder
SetRecipes set the Recipes field
func (*UserFactory) SetRecipesPost ¶
func (f *UserFactory) SetRecipesPost(i int) *UserBuilder
SetRecipesPost call the post function with int input
func (*UserFactory) SetTags ¶
func (f *UserFactory) SetTags(i []*model.Category) *UserBuilder
SetTags set the Tags field
type UserMetaFactory ¶
type UserMetaFactory struct {
// contains filtered or unexported fields
}
func (*UserMetaFactory) Build ¶
func (f *UserMetaFactory) Build() *UserFactory
Build create a UserFactory from UserMetaFactory
func (*UserMetaFactory) SetAfterCreateFunc ¶
func (f *UserMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.User) error) *UserMetaFactory
SetAfterCreateFunc register a function to be called after struct create
func (*UserMetaFactory) SetBeforeCreateFunc ¶ added in v0.1.1
func (f *UserMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.User) error) *UserMetaFactory
SetBeforeCreateFunc register a function to be called before struct create
func (*UserMetaFactory) SetNameDefault ¶
func (f *UserMetaFactory) SetNameDefault(v string) *UserMetaFactory
SetNameDefault assign a default value to Name field
func (*UserMetaFactory) SetNameFactory ¶
func (f *UserMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *UserMetaFactory
SetNameFactory register a factory function and assign return value to Name, you can also use related factory's Create/CreateV as input function here
func (*UserMetaFactory) SetNameLazy ¶
func (f *UserMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.User) (string, error)) *UserMetaFactory
SetNameLazy register a function which accept the build struct and set return value to Name field
func (*UserMetaFactory) SetNameSequence ¶
func (f *UserMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *UserMetaFactory
SetNameSequence register a function which accept a sequence counter and set return value to Name field
func (*UserMetaFactory) SetRecipesDefault ¶
func (f *UserMetaFactory) SetRecipesDefault(v []*model.Recipe) *UserMetaFactory
SetRecipesDefault assign a default value to Recipes field
func (*UserMetaFactory) SetRecipesFactory ¶
func (f *UserMetaFactory) SetRecipesFactory(fn func(ctx context.Context) ([]*model.Recipe, error)) *UserMetaFactory
SetRecipesFactory register a factory function and assign return value to Recipes, you can also use related factory's Create/CreateV as input function here
func (*UserMetaFactory) SetRecipesLazy ¶
func (f *UserMetaFactory) SetRecipesLazy(fn func(ctx context.Context, i *model.User) ([]*model.Recipe, error)) *UserMetaFactory
SetRecipesLazy register a function which accept the build struct and set return value to Recipes field
func (*UserMetaFactory) SetRecipesPostFunc ¶
func (f *UserMetaFactory) SetRecipesPostFunc(fn func(ctx context.Context, set bool, obj *model.User, i int) error) *UserMetaFactory
SetRecipesPostFunc register a post function which will be called in factory SetRecipesPost method
func (*UserMetaFactory) SetRecipesSequence ¶
func (f *UserMetaFactory) SetRecipesSequence(fn func(ctx context.Context, i int) ([]*model.Recipe, error)) *UserMetaFactory
SetRecipesSequence register a function which accept a sequence counter and set return value to Recipes field
func (*UserMetaFactory) SetTagsDefault ¶
func (f *UserMetaFactory) SetTagsDefault(v []*model.Category) *UserMetaFactory
SetTagsDefault assign a default value to Tags field
func (*UserMetaFactory) SetTagsFactory ¶
func (f *UserMetaFactory) SetTagsFactory(fn func(ctx context.Context) ([]*model.Category, error)) *UserMetaFactory
SetTagsFactory register a factory function and assign return value to Tags, you can also use related factory's Create/CreateV as input function here
func (*UserMetaFactory) SetTagsLazy ¶
func (f *UserMetaFactory) SetTagsLazy(fn func(ctx context.Context, i *model.User) ([]*model.Category, error)) *UserMetaFactory
SetTagsLazy register a function which accept the build struct and set return value to Tags field
func (*UserMetaFactory) SetTagsSequence ¶
func (f *UserMetaFactory) SetTagsSequence(fn func(ctx context.Context, i int) ([]*model.Category, error)) *UserMetaFactory
SetTagsSequence register a function which accept a sequence counter and set return value to Tags field