Documentation
¶
Overview ¶
Package factory provides typed, persistence-agnostic test data factories.
Index ¶
- type Builder
- type Factory
- func (factory *Factory[T]) Build(traits ...Trait[T]) (*T, error)
- func (factory *Factory[T]) BuildList(count int, traits ...Trait[T]) ([]*T, error)
- func (factory *Factory[T]) Create(ctx context.Context, traits ...Trait[T]) (*T, error)
- func (factory *Factory[T]) CreateList(ctx context.Context, count int, traits ...Trait[T]) ([]*T, error)
- type Persister
- type Trait
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory[T any] struct { // contains filtered or unexported fields }
func (*Factory[T]) Build ¶
Build constructs an entity without persisting it. Traits run in call order.
Click to show internal directories.
Click to hide internal directories.