factory

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

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.

Code generated by carrier, DO NOT EDIT.

Code generated by carrier, DO NOT EDIT.

Index

Constants

View Source
const (
	TypeDefault  = iota + 1 // default value
	TypeFactory             // subfactory
	TypeSequence            // sequence
	TypeLazy                // lazy function
	TypePost                // post generation
)

Variables

This section is empty.

Functions

func BarTrait

func BarTrait() *barTrait

func EntCarTrait

func EntCarTrait() *entCarTrait

func EntGroupTrait

func EntGroupTrait() *entGroupTrait

func EntUserTrait

func EntUserTrait() *entUserTrait

func FoodTrait

func FoodTrait() *foodTrait

func GroupCategoryTrait

func GroupCategoryTrait() *groupCategoryTrait

func GroupTrait

func GroupTrait() *groupTrait

func UserTrait

func UserTrait() *userTrait

Types

type BarBuilder

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

func (*BarBuilder) Create

func (b *BarBuilder) Create(ctx context.Context) (*model.Foo, error)

Create return a new *model.Foo

func (*BarBuilder) CreateBatch

func (b *BarBuilder) CreateBatch(ctx context.Context, n int) ([]*model.Foo, error)

func (*BarBuilder) CreateBatchV

func (b *BarBuilder) CreateBatchV(ctx context.Context, n int) ([]model.Foo, error)

func (*BarBuilder) CreateV

func (b *BarBuilder) CreateV(ctx context.Context) (model.Foo, error)

CreateV return a new model.Foo

func (*BarBuilder) SetName

func (b *BarBuilder) SetName(i string) *BarBuilder

SetName set the Name field

type BarFactory

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

func (*BarFactory) Create

func (f *BarFactory) Create(ctx context.Context) (*model.Foo, error)

Create return a new *model.Foo

func (*BarFactory) CreateBatch

func (f *BarFactory) CreateBatch(ctx context.Context, n int) ([]*model.Foo, error)

CreateBatch return a []*model.Foo slice

func (*BarFactory) CreateBatchV

func (f *BarFactory) CreateBatchV(ctx context.Context, n int) ([]model.Foo, error)

CreateBatchV return a []model.Foo slice

func (*BarFactory) CreateV

func (f *BarFactory) CreateV(ctx context.Context) (model.Foo, error)

CreateV return a new model.Foo

func (*BarFactory) SetName

func (f *BarFactory) SetName(i string) *BarBuilder

SetName set the Name field

type BarMetaFactory

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

func (*BarMetaFactory) Build

func (f *BarMetaFactory) Build() *BarFactory

Build create a BarFactory from BarMetaFactory

func (*BarMetaFactory) SetAfterCreateFunc

func (f *BarMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Foo) error) *BarMetaFactory

SetAfterCreateFunc register a function to be called after struct create

func (*BarMetaFactory) SetBeforeCreateFunc added in v0.1.1

func (f *BarMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Foo) error) *BarMetaFactory

SetBeforeCreateFunc register a function to be called before struct create

func (*BarMetaFactory) SetNameDefault

func (f *BarMetaFactory) SetNameDefault(v string) *BarMetaFactory

SetNameDefault assign a default value to Name field

func (*BarMetaFactory) SetNameFactory

func (f *BarMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *BarMetaFactory

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 (*BarMetaFactory) SetNameLazy

func (f *BarMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.Foo) (string, error)) *BarMetaFactory

SetNameLazy register a function which accept the build struct and set return value to Name field

func (*BarMetaFactory) SetNameSequence

func (f *BarMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *BarMetaFactory

SetNameSequence register a function which accept a sequence counter and set return value to Name field

type Counter

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

func (*Counter) Get

func (c *Counter) Get() int

type EntCarBuilder

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

func (*EntCarBuilder) Client

func (b *EntCarBuilder) Client(c *ent.Client) *EntCarBuilder

func (*EntCarBuilder) Create

func (b *EntCarBuilder) Create(ctx context.Context) (*ent.Car, error)

Create return a new *ent.Car

func (*EntCarBuilder) CreateBatch

func (b *EntCarBuilder) CreateBatch(ctx context.Context, n int) ([]*ent.Car, error)

func (*EntCarBuilder) CreateBatchV

func (b *EntCarBuilder) CreateBatchV(ctx context.Context, n int) ([]ent.Car, error)

func (*EntCarBuilder) CreateV

func (b *EntCarBuilder) CreateV(ctx context.Context) (ent.Car, error)

CreateV return a new ent.Car

func (*EntCarBuilder) SetModel

func (b *EntCarBuilder) SetModel(i string) *EntCarBuilder

SetModel set the Model field

func (*EntCarBuilder) SetOwner

func (b *EntCarBuilder) SetOwner(i *ent.User) *EntCarBuilder

SetOwner set the Owner field

func (*EntCarBuilder) SetOwnerID

func (b *EntCarBuilder) SetOwnerID(i int) *EntCarBuilder

SetOwnerID set the OwnerID field

func (*EntCarBuilder) SetRegisteredAt

func (b *EntCarBuilder) SetRegisteredAt(i time.Time) *EntCarBuilder

SetRegisteredAt set the RegisteredAt field

type EntCarFactory

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

func (*EntCarFactory) Client

func (f *EntCarFactory) Client(c *ent.Client) *EntCarFactory

Client set ent client to EntCarFactory

func (*EntCarFactory) Create

func (f *EntCarFactory) Create(ctx context.Context) (*ent.Car, error)

Create return a new *ent.Car

func (*EntCarFactory) CreateBatch

func (f *EntCarFactory) CreateBatch(ctx context.Context, n int) ([]*ent.Car, error)

CreateBatch return a []*ent.Car slice

func (*EntCarFactory) CreateBatchV

func (f *EntCarFactory) CreateBatchV(ctx context.Context, n int) ([]ent.Car, error)

CreateBatchV return a []ent.Car slice

func (*EntCarFactory) CreateV

func (f *EntCarFactory) CreateV(ctx context.Context) (ent.Car, error)

CreateV return a new ent.Car

func (*EntCarFactory) SetModel

func (f *EntCarFactory) SetModel(i string) *EntCarBuilder

SetModel set the Model field

func (*EntCarFactory) SetOwner

func (f *EntCarFactory) SetOwner(i *ent.User) *EntCarBuilder

SetOwner set the Owner field

func (*EntCarFactory) SetOwnerID

func (f *EntCarFactory) SetOwnerID(i int) *EntCarBuilder

SetOwnerID set the OwnerID field

func (*EntCarFactory) SetRegisteredAt

func (f *EntCarFactory) SetRegisteredAt(i time.Time) *EntCarBuilder

SetRegisteredAt set the RegisteredAt field

type EntCarMetaFactory

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

func (*EntCarMetaFactory) Build

func (f *EntCarMetaFactory) Build() *EntCarFactory

Build create a EntCarFactory from EntCarMetaFactory

func (*EntCarMetaFactory) SetAfterCreateFunc

func (f *EntCarMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *ent.Car) error) *EntCarMetaFactory

SetAfterCreateFunc register a function to be called after struct create

func (*EntCarMetaFactory) SetBeforeCreateFunc added in v0.1.1

func (f *EntCarMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *EntCarMutator) error) *EntCarMetaFactory

SetBeforeCreateFunc register a function to be called before struct create

func (*EntCarMetaFactory) SetModelDefault

func (f *EntCarMetaFactory) SetModelDefault(v string) *EntCarMetaFactory

SetModelDefault assign a default value to Model field

func (*EntCarMetaFactory) SetModelFactory

func (f *EntCarMetaFactory) SetModelFactory(fn func(ctx context.Context) (string, error)) *EntCarMetaFactory

SetModelFactory register a factory function and assign return value to Model, you can also use related factory's Create/CreateV as input function here

func (*EntCarMetaFactory) SetModelLazy

func (f *EntCarMetaFactory) SetModelLazy(fn func(ctx context.Context, i *EntCarMutator) (string, error)) *EntCarMetaFactory

SetModelLazy register a function which accept the build struct and set return value to Model field

func (*EntCarMetaFactory) SetModelSequence

func (f *EntCarMetaFactory) SetModelSequence(fn func(ctx context.Context, i int) (string, error)) *EntCarMetaFactory

SetModelSequence register a function which accept a sequence counter and set return value to Model field

func (*EntCarMetaFactory) SetOwnerDefault

func (f *EntCarMetaFactory) SetOwnerDefault(v *ent.User) *EntCarMetaFactory

SetOwnerDefault assign a default value to Owner field

func (*EntCarMetaFactory) SetOwnerFactory

func (f *EntCarMetaFactory) SetOwnerFactory(fn func(ctx context.Context) (*ent.User, error)) *EntCarMetaFactory

SetOwnerFactory register a factory function and assign return value to Owner, you can also use related factory's Create/CreateV as input function here

func (*EntCarMetaFactory) SetOwnerIDDefault

func (f *EntCarMetaFactory) SetOwnerIDDefault(v int) *EntCarMetaFactory

SetOwnerIDDefault assign a default value to OwnerID field

func (*EntCarMetaFactory) SetOwnerIDFactory

func (f *EntCarMetaFactory) SetOwnerIDFactory(fn func(ctx context.Context) (int, error)) *EntCarMetaFactory

SetOwnerIDFactory register a factory function and assign return value to OwnerID, you can also use related factory's Create/CreateV as input function here

func (*EntCarMetaFactory) SetOwnerIDLazy

func (f *EntCarMetaFactory) SetOwnerIDLazy(fn func(ctx context.Context, i *EntCarMutator) (int, error)) *EntCarMetaFactory

SetOwnerIDLazy register a function which accept the build struct and set return value to OwnerID field

func (*EntCarMetaFactory) SetOwnerIDSequence

func (f *EntCarMetaFactory) SetOwnerIDSequence(fn func(ctx context.Context, i int) (int, error)) *EntCarMetaFactory

SetOwnerIDSequence register a function which accept a sequence counter and set return value to OwnerID field

func (*EntCarMetaFactory) SetOwnerLazy

func (f *EntCarMetaFactory) SetOwnerLazy(fn func(ctx context.Context, i *EntCarMutator) (*ent.User, error)) *EntCarMetaFactory

SetOwnerLazy register a function which accept the build struct and set return value to Owner field

func (*EntCarMetaFactory) SetOwnerSequence

func (f *EntCarMetaFactory) SetOwnerSequence(fn func(ctx context.Context, i int) (*ent.User, error)) *EntCarMetaFactory

SetOwnerSequence register a function which accept a sequence counter and set return value to Owner field

func (*EntCarMetaFactory) SetRegisteredAtDefault

func (f *EntCarMetaFactory) SetRegisteredAtDefault(v time.Time) *EntCarMetaFactory

SetRegisteredAtDefault assign a default value to RegisteredAt field

func (*EntCarMetaFactory) SetRegisteredAtFactory

func (f *EntCarMetaFactory) SetRegisteredAtFactory(fn func(ctx context.Context) (time.Time, error)) *EntCarMetaFactory

SetRegisteredAtFactory register a factory function and assign return value to RegisteredAt, you can also use related factory's Create/CreateV as input function here

func (*EntCarMetaFactory) SetRegisteredAtLazy

func (f *EntCarMetaFactory) SetRegisteredAtLazy(fn func(ctx context.Context, i *EntCarMutator) (time.Time, error)) *EntCarMetaFactory

SetRegisteredAtLazy register a function which accept the build struct and set return value to RegisteredAt field

func (*EntCarMetaFactory) SetRegisteredAtSequence

func (f *EntCarMetaFactory) SetRegisteredAtSequence(fn func(ctx context.Context, i int) (time.Time, error)) *EntCarMetaFactory

SetRegisteredAtSequence register a function which accept a sequence counter and set return value to RegisteredAt field

type EntCarMutator

type EntCarMutator struct {
	Model string

	Owner *ent.User

	OwnerID int

	RegisteredAt time.Time
	// contains filtered or unexported fields
}

func (*EntCarMutator) EntCreator added in v0.1.1

func (m *EntCarMutator) EntCreator() *ent.CarCreate

type EntGroupBuilder

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

func (*EntGroupBuilder) Client

func (b *EntGroupBuilder) Client(c *ent.Client) *EntGroupBuilder

func (*EntGroupBuilder) Create

func (b *EntGroupBuilder) Create(ctx context.Context) (*ent.Group, error)

Create return a new *ent.Group

func (*EntGroupBuilder) CreateBatch

func (b *EntGroupBuilder) CreateBatch(ctx context.Context, n int) ([]*ent.Group, error)

func (*EntGroupBuilder) CreateBatchV

func (b *EntGroupBuilder) CreateBatchV(ctx context.Context, n int) ([]ent.Group, error)

func (*EntGroupBuilder) CreateV

func (b *EntGroupBuilder) CreateV(ctx context.Context) (ent.Group, error)

CreateV return a new ent.Group

func (*EntGroupBuilder) SetName

func (b *EntGroupBuilder) SetName(i string) *EntGroupBuilder

SetName set the Name field

func (*EntGroupBuilder) WithNouserTrait

func (b *EntGroupBuilder) WithNouserTrait() *EntGroupBuilder

WithNouserTrait() enable the Nouser trait

type EntGroupFactory

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

func (*EntGroupFactory) Client

func (f *EntGroupFactory) Client(c *ent.Client) *EntGroupFactory

Client set ent client to EntGroupFactory

func (*EntGroupFactory) Create

func (f *EntGroupFactory) Create(ctx context.Context) (*ent.Group, error)

Create return a new *ent.Group

func (*EntGroupFactory) CreateBatch

func (f *EntGroupFactory) CreateBatch(ctx context.Context, n int) ([]*ent.Group, error)

CreateBatch return a []*ent.Group slice

func (*EntGroupFactory) CreateBatchV

func (f *EntGroupFactory) CreateBatchV(ctx context.Context, n int) ([]ent.Group, error)

CreateBatchV return a []ent.Group slice

func (*EntGroupFactory) CreateV

func (f *EntGroupFactory) CreateV(ctx context.Context) (ent.Group, error)

CreateV return a new ent.Group

func (*EntGroupFactory) SetName

func (f *EntGroupFactory) SetName(i string) *EntGroupBuilder

SetName set the Name field

func (*EntGroupFactory) WithNouserTrait

func (f *EntGroupFactory) WithNouserTrait() *EntGroupBuilder

WithNouserTrait() enable the Nouser trait

type EntGroupMetaFactory

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

func (*EntGroupMetaFactory) Build

Build create a EntGroupFactory from EntGroupMetaFactory

func (*EntGroupMetaFactory) SetAfterCreateFunc

func (f *EntGroupMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *ent.Group) error) *EntGroupMetaFactory

SetAfterCreateFunc register a function to be called after struct create

func (*EntGroupMetaFactory) SetBeforeCreateFunc added in v0.1.1

func (f *EntGroupMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *EntGroupMutator) error) *EntGroupMetaFactory

SetBeforeCreateFunc register a function to be called before struct create

func (*EntGroupMetaFactory) SetNameDefault

func (f *EntGroupMetaFactory) SetNameDefault(v string) *EntGroupMetaFactory

SetNameDefault assign a default value to Name field

func (*EntGroupMetaFactory) SetNameFactory

func (f *EntGroupMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *EntGroupMetaFactory

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 (*EntGroupMetaFactory) SetNameLazy

func (f *EntGroupMetaFactory) SetNameLazy(fn func(ctx context.Context, i *EntGroupMutator) (string, error)) *EntGroupMetaFactory

SetNameLazy register a function which accept the build struct and set return value to Name field

func (*EntGroupMetaFactory) SetNameSequence

func (f *EntGroupMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *EntGroupMetaFactory

SetNameSequence register a function which accept a sequence counter and set return value to Name field

func (*EntGroupMetaFactory) SetNouserTrait

func (f *EntGroupMetaFactory) SetNouserTrait(t *entGroupTrait) *EntGroupMetaFactory

SetNouserTrait accept a entGroupTrait, will override builder using Trait's methods if enable

type EntGroupMutator

type EntGroupMutator struct {
	Name string
	// contains filtered or unexported fields
}

func (*EntGroupMutator) EntCreator added in v0.1.1

func (m *EntGroupMutator) EntCreator() *ent.GroupCreate

type EntUserBuilder

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

func (*EntUserBuilder) Client

func (b *EntUserBuilder) Client(c *ent.Client) *EntUserBuilder

func (*EntUserBuilder) Create

func (b *EntUserBuilder) Create(ctx context.Context) (*ent.User, error)

Create return a new *ent.User

func (*EntUserBuilder) CreateBatch

func (b *EntUserBuilder) CreateBatch(ctx context.Context, n int) ([]*ent.User, error)

func (*EntUserBuilder) CreateBatchV

func (b *EntUserBuilder) CreateBatchV(ctx context.Context, n int) ([]ent.User, error)

func (*EntUserBuilder) CreateV

func (b *EntUserBuilder) CreateV(ctx context.Context) (ent.User, error)

CreateV return a new ent.User

func (*EntUserBuilder) SetAge

func (b *EntUserBuilder) SetAge(i int) *EntUserBuilder

SetAge set the Age field

func (*EntUserBuilder) SetEmail

func (b *EntUserBuilder) SetEmail(i string) *EntUserBuilder

SetEmail set the Email field

func (*EntUserBuilder) SetGroupsPost

func (b *EntUserBuilder) SetGroupsPost(i int) *EntUserBuilder

SetGroupsPost call the post function with int input

func (*EntUserBuilder) SetName

func (b *EntUserBuilder) SetName(i string) *EntUserBuilder

SetName set the Name field

type EntUserFactory

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

func (*EntUserFactory) Client

func (f *EntUserFactory) Client(c *ent.Client) *EntUserFactory

Client set ent client to EntUserFactory

func (*EntUserFactory) Create

func (f *EntUserFactory) Create(ctx context.Context) (*ent.User, error)

Create return a new *ent.User

func (*EntUserFactory) CreateBatch

func (f *EntUserFactory) CreateBatch(ctx context.Context, n int) ([]*ent.User, error)

CreateBatch return a []*ent.User slice

func (*EntUserFactory) CreateBatchV

func (f *EntUserFactory) CreateBatchV(ctx context.Context, n int) ([]ent.User, error)

CreateBatchV return a []ent.User slice

func (*EntUserFactory) CreateV

func (f *EntUserFactory) CreateV(ctx context.Context) (ent.User, error)

CreateV return a new ent.User

func (*EntUserFactory) SetAge

func (f *EntUserFactory) SetAge(i int) *EntUserBuilder

SetAge set the Age field

func (*EntUserFactory) SetEmail

func (f *EntUserFactory) SetEmail(i string) *EntUserBuilder

SetEmail set the Email field

func (*EntUserFactory) SetGroupsPost

func (f *EntUserFactory) SetGroupsPost(i int) *EntUserBuilder

SetGroupsPost call the post function with int input

func (*EntUserFactory) SetName

func (f *EntUserFactory) SetName(i string) *EntUserBuilder

SetName set the Name field

type EntUserMetaFactory

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

func (*EntUserMetaFactory) Build

func (f *EntUserMetaFactory) Build() *EntUserFactory

Build create a EntUserFactory from EntUserMetaFactory

func (*EntUserMetaFactory) SetAfterCreateFunc

func (f *EntUserMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *ent.User) error) *EntUserMetaFactory

SetAfterCreateFunc register a function to be called after struct create

func (*EntUserMetaFactory) SetAgeDefault

func (f *EntUserMetaFactory) SetAgeDefault(v int) *EntUserMetaFactory

SetAgeDefault assign a default value to Age field

func (*EntUserMetaFactory) SetAgeFactory

func (f *EntUserMetaFactory) SetAgeFactory(fn func(ctx context.Context) (int, error)) *EntUserMetaFactory

SetAgeFactory register a factory function and assign return value to Age, you can also use related factory's Create/CreateV as input function here

func (*EntUserMetaFactory) SetAgeLazy

func (f *EntUserMetaFactory) SetAgeLazy(fn func(ctx context.Context, i *EntUserMutator) (int, error)) *EntUserMetaFactory

SetAgeLazy register a function which accept the build struct and set return value to Age field

func (*EntUserMetaFactory) SetAgeSequence

func (f *EntUserMetaFactory) SetAgeSequence(fn func(ctx context.Context, i int) (int, error)) *EntUserMetaFactory

SetAgeSequence register a function which accept a sequence counter and set return value to Age field

func (*EntUserMetaFactory) SetBeforeCreateFunc added in v0.1.1

func (f *EntUserMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *EntUserMutator) error) *EntUserMetaFactory

SetBeforeCreateFunc register a function to be called before struct create

func (*EntUserMetaFactory) SetEmailDefault

func (f *EntUserMetaFactory) SetEmailDefault(v string) *EntUserMetaFactory

SetEmailDefault assign a default value to Email field

func (*EntUserMetaFactory) SetEmailFactory

func (f *EntUserMetaFactory) SetEmailFactory(fn func(ctx context.Context) (string, error)) *EntUserMetaFactory

SetEmailFactory register a factory function and assign return value to Email, you can also use related factory's Create/CreateV as input function here

func (*EntUserMetaFactory) SetEmailLazy

func (f *EntUserMetaFactory) SetEmailLazy(fn func(ctx context.Context, i *EntUserMutator) (string, error)) *EntUserMetaFactory

SetEmailLazy register a function which accept the build struct and set return value to Email field

func (*EntUserMetaFactory) SetEmailSequence

func (f *EntUserMetaFactory) SetEmailSequence(fn func(ctx context.Context, i int) (string, error)) *EntUserMetaFactory

SetEmailSequence register a function which accept a sequence counter and set return value to Email field

func (*EntUserMetaFactory) SetGroupsPostFunc

func (f *EntUserMetaFactory) SetGroupsPostFunc(fn func(ctx context.Context, set bool, obj *ent.User, i int) error) *EntUserMetaFactory

SetGroupsPostFunc register a post function which will be called in factory SetGroupsPost method

func (*EntUserMetaFactory) SetNameDefault

func (f *EntUserMetaFactory) SetNameDefault(v string) *EntUserMetaFactory

SetNameDefault assign a default value to Name field

func (*EntUserMetaFactory) SetNameFactory

func (f *EntUserMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *EntUserMetaFactory

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 (*EntUserMetaFactory) SetNameLazy

func (f *EntUserMetaFactory) SetNameLazy(fn func(ctx context.Context, i *EntUserMutator) (string, error)) *EntUserMetaFactory

SetNameLazy register a function which accept the build struct and set return value to Name field

func (*EntUserMetaFactory) SetNameSequence

func (f *EntUserMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *EntUserMetaFactory

SetNameSequence register a function which accept a sequence counter and set return value to Name field

type EntUserMutator

type EntUserMutator struct {
	Age int

	Email string

	Name string
	// contains filtered or unexported fields
}

func (*EntUserMutator) EntCreator added in v0.1.1

func (m *EntUserMutator) EntCreator() *ent.UserCreate

type FoodBuilder

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

func (*FoodBuilder) Create

func (b *FoodBuilder) Create(ctx context.Context) (*model.Food, error)

Create return a new *model.Food

func (*FoodBuilder) CreateBatch

func (b *FoodBuilder) CreateBatch(ctx context.Context, n int) ([]*model.Food, error)

func (*FoodBuilder) CreateBatchV

func (b *FoodBuilder) CreateBatchV(ctx context.Context, n int) ([]model.Food, error)

func (*FoodBuilder) CreateV

func (b *FoodBuilder) CreateV(ctx context.Context) (model.Food, error)

CreateV return a new model.Food

func (*FoodBuilder) SetCategory

func (b *FoodBuilder) SetCategory(i string) *FoodBuilder

SetCategory set the Category field

func (*FoodBuilder) SetFoo

func (b *FoodBuilder) SetFoo(i model.Foo) *FoodBuilder

SetFoo set the Foo field

type FoodFactory

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

func (*FoodFactory) Create

func (f *FoodFactory) Create(ctx context.Context) (*model.Food, error)

Create return a new *model.Food

func (*FoodFactory) CreateBatch

func (f *FoodFactory) CreateBatch(ctx context.Context, n int) ([]*model.Food, error)

CreateBatch return a []*model.Food slice

func (*FoodFactory) CreateBatchV

func (f *FoodFactory) CreateBatchV(ctx context.Context, n int) ([]model.Food, error)

CreateBatchV return a []model.Food slice

func (*FoodFactory) CreateV

func (f *FoodFactory) CreateV(ctx context.Context) (model.Food, error)

CreateV return a new model.Food

func (*FoodFactory) SetCategory

func (f *FoodFactory) SetCategory(i string) *FoodBuilder

SetCategory set the Category field

func (*FoodFactory) SetFoo

func (f *FoodFactory) SetFoo(i model.Foo) *FoodBuilder

SetFoo set the Foo field

type FoodMetaFactory

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

func (*FoodMetaFactory) Build

func (f *FoodMetaFactory) Build() *FoodFactory

Build create a FoodFactory from FoodMetaFactory

func (*FoodMetaFactory) SetAfterCreateFunc

func (f *FoodMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Food) error) *FoodMetaFactory

SetAfterCreateFunc register a function to be called after struct create

func (*FoodMetaFactory) SetBeforeCreateFunc added in v0.1.1

func (f *FoodMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Food) error) *FoodMetaFactory

SetBeforeCreateFunc register a function to be called before struct create

func (*FoodMetaFactory) SetCategoryDefault

func (f *FoodMetaFactory) SetCategoryDefault(v string) *FoodMetaFactory

SetCategoryDefault assign a default value to Category field

func (*FoodMetaFactory) SetCategoryFactory

func (f *FoodMetaFactory) SetCategoryFactory(fn func(ctx context.Context) (string, error)) *FoodMetaFactory

SetCategoryFactory register a factory function and assign return value to Category, you can also use related factory's Create/CreateV as input function here

func (*FoodMetaFactory) SetCategoryLazy

func (f *FoodMetaFactory) SetCategoryLazy(fn func(ctx context.Context, i *model.Food) (string, error)) *FoodMetaFactory

SetCategoryLazy register a function which accept the build struct and set return value to Category field

func (*FoodMetaFactory) SetCategorySequence

func (f *FoodMetaFactory) SetCategorySequence(fn func(ctx context.Context, i int) (string, error)) *FoodMetaFactory

SetCategorySequence register a function which accept a sequence counter and set return value to Category field

func (*FoodMetaFactory) SetFooDefault

func (f *FoodMetaFactory) SetFooDefault(v model.Foo) *FoodMetaFactory

SetFooDefault assign a default value to Foo field

func (*FoodMetaFactory) SetFooFactory

func (f *FoodMetaFactory) SetFooFactory(fn func(ctx context.Context) (model.Foo, error)) *FoodMetaFactory

SetFooFactory register a factory function and assign return value to Foo, you can also use related factory's Create/CreateV as input function here

func (*FoodMetaFactory) SetFooLazy

func (f *FoodMetaFactory) SetFooLazy(fn func(ctx context.Context, i *model.Food) (model.Foo, error)) *FoodMetaFactory

SetFooLazy register a function which accept the build struct and set return value to Foo field

func (*FoodMetaFactory) SetFooSequence

func (f *FoodMetaFactory) SetFooSequence(fn func(ctx context.Context, i int) (model.Foo, error)) *FoodMetaFactory

SetFooSequence register a function which accept a sequence counter and set return value to Foo field

type GroupBuilder

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

func (*GroupBuilder) Create

func (b *GroupBuilder) Create(ctx context.Context) (*model.Group, error)

Create return a new *model.Group

func (*GroupBuilder) CreateBatch

func (b *GroupBuilder) CreateBatch(ctx context.Context, n int) ([]*model.Group, error)

func (*GroupBuilder) CreateBatchV

func (b *GroupBuilder) CreateBatchV(ctx context.Context, n int) ([]model.Group, error)

func (*GroupBuilder) CreateV

func (b *GroupBuilder) CreateV(ctx context.Context) (model.Group, error)

CreateV return a new model.Group

func (*GroupBuilder) SetCategory

func (b *GroupBuilder) SetCategory(i model.GroupCategory) *GroupBuilder

SetCategory set the Category field

func (*GroupBuilder) SetName

func (b *GroupBuilder) SetName(i string) *GroupBuilder

SetName set the Name field

type GroupCategoryBuilder

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

func (*GroupCategoryBuilder) Create

Create return a new *model.GroupCategory

func (*GroupCategoryBuilder) CreateBatch

func (b *GroupCategoryBuilder) CreateBatch(ctx context.Context, n int) ([]*model.GroupCategory, error)

func (*GroupCategoryBuilder) CreateBatchV

func (b *GroupCategoryBuilder) CreateBatchV(ctx context.Context, n int) ([]model.GroupCategory, error)

func (*GroupCategoryBuilder) CreateV

CreateV return a new model.GroupCategory

func (*GroupCategoryBuilder) SetName

SetName set the Name field

type GroupCategoryFactory

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

func (*GroupCategoryFactory) Create

Create return a new *model.GroupCategory

func (*GroupCategoryFactory) CreateBatch

func (f *GroupCategoryFactory) CreateBatch(ctx context.Context, n int) ([]*model.GroupCategory, error)

CreateBatch return a []*model.GroupCategory slice

func (*GroupCategoryFactory) CreateBatchV

func (f *GroupCategoryFactory) CreateBatchV(ctx context.Context, n int) ([]model.GroupCategory, error)

CreateBatchV return a []model.GroupCategory slice

func (*GroupCategoryFactory) CreateV

CreateV return a new model.GroupCategory

func (*GroupCategoryFactory) SetName

SetName set the Name field

type GroupCategoryMetaFactory

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

func (*GroupCategoryMetaFactory) Build

Build create a GroupCategoryFactory from GroupCategoryMetaFactory

func (*GroupCategoryMetaFactory) SetAfterCreateFunc

SetAfterCreateFunc register a function to be called after struct create

func (*GroupCategoryMetaFactory) SetBeforeCreateFunc added in v0.1.1

func (f *GroupCategoryMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.GroupCategory) error) *GroupCategoryMetaFactory

SetBeforeCreateFunc register a function to be called before struct create

func (*GroupCategoryMetaFactory) SetNameDefault

SetNameDefault assign a default value to Name field

func (*GroupCategoryMetaFactory) SetNameFactory

func (f *GroupCategoryMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *GroupCategoryMetaFactory

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 (*GroupCategoryMetaFactory) SetNameLazy

SetNameLazy register a function which accept the build struct and set return value to Name field

func (*GroupCategoryMetaFactory) SetNameSequence

func (f *GroupCategoryMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *GroupCategoryMetaFactory

SetNameSequence register a function which accept a sequence counter and set return value to Name field

type GroupFactory

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

func (*GroupFactory) Create

func (f *GroupFactory) Create(ctx context.Context) (*model.Group, error)

Create return a new *model.Group

func (*GroupFactory) CreateBatch

func (f *GroupFactory) CreateBatch(ctx context.Context, n int) ([]*model.Group, error)

CreateBatch return a []*model.Group slice

func (*GroupFactory) CreateBatchV

func (f *GroupFactory) CreateBatchV(ctx context.Context, n int) ([]model.Group, error)

CreateBatchV return a []model.Group slice

func (*GroupFactory) CreateV

func (f *GroupFactory) CreateV(ctx context.Context) (model.Group, error)

CreateV return a new model.Group

func (*GroupFactory) SetCategory

func (f *GroupFactory) SetCategory(i model.GroupCategory) *GroupBuilder

SetCategory set the Category field

func (*GroupFactory) SetName

func (f *GroupFactory) SetName(i string) *GroupBuilder

SetName set the Name field

type GroupMetaFactory

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

func (*GroupMetaFactory) Build

func (f *GroupMetaFactory) Build() *GroupFactory

Build create a GroupFactory from GroupMetaFactory

func (*GroupMetaFactory) SetAfterCreateFunc

func (f *GroupMetaFactory) SetAfterCreateFunc(fn func(ctx context.Context, i *model.Group) error) *GroupMetaFactory

SetAfterCreateFunc register a function to be called after struct create

func (*GroupMetaFactory) SetBeforeCreateFunc added in v0.1.1

func (f *GroupMetaFactory) SetBeforeCreateFunc(fn func(ctx context.Context, i *model.Group) error) *GroupMetaFactory

SetBeforeCreateFunc register a function to be called before struct create

func (*GroupMetaFactory) SetCategoryDefault

func (f *GroupMetaFactory) SetCategoryDefault(v model.GroupCategory) *GroupMetaFactory

SetCategoryDefault assign a default value to Category field

func (*GroupMetaFactory) SetCategoryFactory

func (f *GroupMetaFactory) SetCategoryFactory(fn func(ctx context.Context) (model.GroupCategory, error)) *GroupMetaFactory

SetCategoryFactory register a factory function and assign return value to Category, you can also use related factory's Create/CreateV as input function here

func (*GroupMetaFactory) SetCategoryLazy

func (f *GroupMetaFactory) SetCategoryLazy(fn func(ctx context.Context, i *model.Group) (model.GroupCategory, error)) *GroupMetaFactory

SetCategoryLazy register a function which accept the build struct and set return value to Category field

func (*GroupMetaFactory) SetCategorySequence

func (f *GroupMetaFactory) SetCategorySequence(fn func(ctx context.Context, i int) (model.GroupCategory, error)) *GroupMetaFactory

SetCategorySequence register a function which accept a sequence counter and set return value to Category field

func (*GroupMetaFactory) SetNameDefault

func (f *GroupMetaFactory) SetNameDefault(v string) *GroupMetaFactory

SetNameDefault assign a default value to Name field

func (*GroupMetaFactory) SetNameFactory

func (f *GroupMetaFactory) SetNameFactory(fn func(ctx context.Context) (string, error)) *GroupMetaFactory

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 (*GroupMetaFactory) SetNameLazy

func (f *GroupMetaFactory) SetNameLazy(fn func(ctx context.Context, i *model.Group) (string, error)) *GroupMetaFactory

SetNameLazy register a function which accept the build struct and set return value to Name field

func (*GroupMetaFactory) SetNameSequence

func (f *GroupMetaFactory) SetNameSequence(fn func(ctx context.Context, i int) (string, error)) *GroupMetaFactory

SetNameSequence register a function which accept a sequence counter and set return value to Name field

type UserBuilder

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

func (*UserBuilder) Create

func (b *UserBuilder) Create(ctx context.Context) (*model.User, error)

Create return a new *model.User

func (*UserBuilder) CreateBatch

func (b *UserBuilder) CreateBatch(ctx context.Context, n int) ([]*model.User, error)

func (*UserBuilder) CreateBatchV

func (b *UserBuilder) CreateBatchV(ctx context.Context, n int) ([]model.User, error)

func (*UserBuilder) CreateV

func (b *UserBuilder) CreateV(ctx context.Context) (model.User, error)

CreateV return a new model.User

func (*UserBuilder) SetEmail

func (b *UserBuilder) SetEmail(i string) *UserBuilder

SetEmail set the Email field

func (*UserBuilder) SetFooPost

func (b *UserBuilder) SetFooPost(i string) *UserBuilder

SetFooPost call the post function with string input

func (*UserBuilder) SetGroup

func (b *UserBuilder) SetGroup(i *model.Group) *UserBuilder

SetGroup set the Group field

func (*UserBuilder) SetName

func (b *UserBuilder) SetName(i string) *UserBuilder

SetName set the Name field

func (*UserBuilder) SetTitle

func (b *UserBuilder) SetTitle(i string) *UserBuilder

SetTitle set the Title field

func (*UserBuilder) WithAnonymousTrait

func (b *UserBuilder) WithAnonymousTrait() *UserBuilder

WithAnonymousTrait() enable the Anonymous trait

func (*UserBuilder) WithDefaultTrait

func (b *UserBuilder) WithDefaultTrait() *UserBuilder

WithDefaultTrait() enable the Default trait

func (*UserBuilder) WithFactoryTrait

func (b *UserBuilder) WithFactoryTrait() *UserBuilder

WithFactoryTrait() enable the Factory trait

func (*UserBuilder) WithLazyTrait

func (b *UserBuilder) WithLazyTrait() *UserBuilder

WithLazyTrait() enable the Lazy trait

func (*UserBuilder) WithMixemailTrait

func (b *UserBuilder) WithMixemailTrait() *UserBuilder

WithMixemailTrait() enable the Mixemail trait

func (*UserBuilder) WithMixnameTrait

func (b *UserBuilder) WithMixnameTrait() *UserBuilder

WithMixnameTrait() enable the Mixname trait

func (*UserBuilder) WithMixtitleTrait

func (b *UserBuilder) WithMixtitleTrait() *UserBuilder

WithMixtitleTrait() enable the Mixtitle trait

func (*UserBuilder) WithNilTrait

func (b *UserBuilder) WithNilTrait() *UserBuilder

WithNilTrait() enable the Nil trait

func (*UserBuilder) WithSequenceTrait

func (b *UserBuilder) WithSequenceTrait() *UserBuilder

WithSequenceTrait() enable the Sequence trait

type UserFactory

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

func (*UserFactory) Create

func (f *UserFactory) Create(ctx context.Context) (*model.User, error)

Create return a new *model.User

func (*UserFactory) CreateBatch

func (f *UserFactory) CreateBatch(ctx context.Context, n int) ([]*model.User, error)

CreateBatch return a []*model.User slice

func (*UserFactory) CreateBatchV

func (f *UserFactory) CreateBatchV(ctx context.Context, n int) ([]model.User, error)

CreateBatchV return a []model.User slice

func (*UserFactory) CreateV

func (f *UserFactory) CreateV(ctx context.Context) (model.User, error)

CreateV return a new model.User

func (*UserFactory) SetEmail

func (f *UserFactory) SetEmail(i string) *UserBuilder

SetEmail set the Email field

func (*UserFactory) SetFooPost

func (f *UserFactory) SetFooPost(i string) *UserBuilder

SetFooPost call the post function with string input

func (*UserFactory) SetGroup

func (f *UserFactory) SetGroup(i *model.Group) *UserBuilder

SetGroup set the Group field

func (*UserFactory) SetName

func (f *UserFactory) SetName(i string) *UserBuilder

SetName set the Name field

func (*UserFactory) SetTitle

func (f *UserFactory) SetTitle(i string) *UserBuilder

SetTitle set the Title field

func (*UserFactory) WithAnonymousTrait

func (f *UserFactory) WithAnonymousTrait() *UserBuilder

WithAnonymousTrait() enable the Anonymous trait

func (*UserFactory) WithDefaultTrait

func (f *UserFactory) WithDefaultTrait() *UserBuilder

WithDefaultTrait() enable the Default trait

func (*UserFactory) WithFactoryTrait

func (f *UserFactory) WithFactoryTrait() *UserBuilder

WithFactoryTrait() enable the Factory trait

func (*UserFactory) WithLazyTrait

func (f *UserFactory) WithLazyTrait() *UserBuilder

WithLazyTrait() enable the Lazy trait

func (*UserFactory) WithMixemailTrait

func (f *UserFactory) WithMixemailTrait() *UserBuilder

WithMixemailTrait() enable the Mixemail trait

func (*UserFactory) WithMixnameTrait

func (f *UserFactory) WithMixnameTrait() *UserBuilder

WithMixnameTrait() enable the Mixname trait

func (*UserFactory) WithMixtitleTrait

func (f *UserFactory) WithMixtitleTrait() *UserBuilder

WithMixtitleTrait() enable the Mixtitle trait

func (*UserFactory) WithNilTrait

func (f *UserFactory) WithNilTrait() *UserBuilder

WithNilTrait() enable the Nil trait

func (*UserFactory) WithSequenceTrait

func (f *UserFactory) WithSequenceTrait() *UserBuilder

WithSequenceTrait() enable the Sequence trait

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) SetAnonymousTrait

func (f *UserMetaFactory) SetAnonymousTrait(t *userTrait) *UserMetaFactory

SetAnonymousTrait accept a userTrait, will override builder using Trait's methods if enable

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) SetDefaultTrait

func (f *UserMetaFactory) SetDefaultTrait(t *userTrait) *UserMetaFactory

SetDefaultTrait accept a userTrait, will override builder using Trait's methods if enable

func (*UserMetaFactory) SetEmailDefault

func (f *UserMetaFactory) SetEmailDefault(v string) *UserMetaFactory

SetEmailDefault assign a default value to Email field

func (*UserMetaFactory) SetEmailFactory

func (f *UserMetaFactory) SetEmailFactory(fn func(ctx context.Context) (string, error)) *UserMetaFactory

SetEmailFactory register a factory function and assign return value to Email, you can also use related factory's Create/CreateV as input function here

func (*UserMetaFactory) SetEmailLazy

func (f *UserMetaFactory) SetEmailLazy(fn func(ctx context.Context, i *model.User) (string, error)) *UserMetaFactory

SetEmailLazy register a function which accept the build struct and set return value to Email field

func (*UserMetaFactory) SetEmailSequence

func (f *UserMetaFactory) SetEmailSequence(fn func(ctx context.Context, i int) (string, error)) *UserMetaFactory

SetEmailSequence register a function which accept a sequence counter and set return value to Email field

func (*UserMetaFactory) SetFactoryTrait

func (f *UserMetaFactory) SetFactoryTrait(t *userTrait) *UserMetaFactory

SetFactoryTrait accept a userTrait, will override builder using Trait's methods if enable

func (*UserMetaFactory) SetFooPostFunc

func (f *UserMetaFactory) SetFooPostFunc(fn func(ctx context.Context, set bool, obj *model.User, i string) error) *UserMetaFactory

SetFooPostFunc register a post function which will be called in factory SetFooPost method

func (*UserMetaFactory) SetGroupDefault

func (f *UserMetaFactory) SetGroupDefault(v *model.Group) *UserMetaFactory

SetGroupDefault assign a default value to Group field

func (*UserMetaFactory) SetGroupFactory

func (f *UserMetaFactory) SetGroupFactory(fn func(ctx context.Context) (*model.Group, error)) *UserMetaFactory

SetGroupFactory register a factory function and assign return value to Group, you can also use related factory's Create/CreateV as input function here

func (*UserMetaFactory) SetGroupLazy

func (f *UserMetaFactory) SetGroupLazy(fn func(ctx context.Context, i *model.User) (*model.Group, error)) *UserMetaFactory

SetGroupLazy register a function which accept the build struct and set return value to Group field

func (*UserMetaFactory) SetGroupSequence

func (f *UserMetaFactory) SetGroupSequence(fn func(ctx context.Context, i int) (*model.Group, error)) *UserMetaFactory

SetGroupSequence register a function which accept a sequence counter and set return value to Group field

func (*UserMetaFactory) SetLazyTrait

func (f *UserMetaFactory) SetLazyTrait(t *userTrait) *UserMetaFactory

SetLazyTrait accept a userTrait, will override builder using Trait's methods if enable

func (*UserMetaFactory) SetMixemailTrait

func (f *UserMetaFactory) SetMixemailTrait(t *userTrait) *UserMetaFactory

SetMixemailTrait accept a userTrait, will override builder using Trait's methods if enable

func (*UserMetaFactory) SetMixnameTrait

func (f *UserMetaFactory) SetMixnameTrait(t *userTrait) *UserMetaFactory

SetMixnameTrait accept a userTrait, will override builder using Trait's methods if enable

func (*UserMetaFactory) SetMixtitleTrait

func (f *UserMetaFactory) SetMixtitleTrait(t *userTrait) *UserMetaFactory

SetMixtitleTrait accept a userTrait, will override builder using Trait's methods if enable

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) SetNilTrait

func (f *UserMetaFactory) SetNilTrait(t *userTrait) *UserMetaFactory

SetNilTrait accept a userTrait, will override builder using Trait's methods if enable

func (*UserMetaFactory) SetSequenceTrait

func (f *UserMetaFactory) SetSequenceTrait(t *userTrait) *UserMetaFactory

SetSequenceTrait accept a userTrait, will override builder using Trait's methods if enable

func (*UserMetaFactory) SetTitleDefault

func (f *UserMetaFactory) SetTitleDefault(v string) *UserMetaFactory

SetTitleDefault assign a default value to Title field

func (*UserMetaFactory) SetTitleFactory

func (f *UserMetaFactory) SetTitleFactory(fn func(ctx context.Context) (string, error)) *UserMetaFactory

SetTitleFactory register a factory function and assign return value to Title, you can also use related factory's Create/CreateV as input function here

func (*UserMetaFactory) SetTitleLazy

func (f *UserMetaFactory) SetTitleLazy(fn func(ctx context.Context, i *model.User) (string, error)) *UserMetaFactory

SetTitleLazy register a function which accept the build struct and set return value to Title field

func (*UserMetaFactory) SetTitleSequence

func (f *UserMetaFactory) SetTitleSequence(fn func(ctx context.Context, i int) (string, error)) *UserMetaFactory

SetTitleSequence register a function which accept a sequence counter and set return value to Title field

Jump to

Keyboard shortcuts

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