Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Creator ¶
type CreatorSubject ¶
type CreatorSubject[Ent, ID any] spechelper.CRD[Ent, ID]
type Deleter ¶
type DeleterSubject ¶
type DeleterSubject[Ent, ID any] interface { spechelper.CRD[Ent, ID] crud.Deleter[ID] }
type FindOne ¶
type FindOne[Ent, ID any] struct { Subject func(testing.TB) FinderSubject[Ent, ID] MakeCtx func(testing.TB) context.Context MakeEnt func(testing.TB) Ent // MethodName is the name of the test subject QueryOne method of this contract specification. MethodName string // ToQuery takes an entity ptr and returns with a closure that has the knowledge about how to query on the Subject resource to find the entity. // // By convention, any preparation action that affect the resource must take place prior to returning the closure. // The QueryOne closure should only have the Method call with the already mapped values. // ToQuery will be evaluated in the beginning of the testing, // and executed after all the test Context preparation is done. ToQuery func(tb testing.TB, resource FinderSubject[Ent, ID], ent Ent) QueryOne[Ent] // Specify allow further specification describing for a given FindOne query function. // If none specified, this field will be ignored Specify func(testing.TB) }
type Finder ¶
type FinderSubject ¶
type FinderSubject[Ent, ID any] interface { spechelper.CRD[Ent, ID] crud.AllFinder[Ent, ID] }
type OnePhaseCommitProtocol ¶ added in v0.72.0
type OnePhaseCommitProtocol[Ent, ID any] struct { Subject func(testing.TB) OnePhaseCommitProtocolSubject[Ent, ID] MakeCtx func(testing.TB) context.Context MakeEnt func(testing.TB) Ent }
func (OnePhaseCommitProtocol[Ent, ID]) Benchmark ¶ added in v0.72.0
func (c OnePhaseCommitProtocol[Ent, ID]) Benchmark(b *testing.B)
func (OnePhaseCommitProtocol[Ent, ID]) Spec ¶ added in v0.72.0
func (c OnePhaseCommitProtocol[Ent, ID]) Spec(s *testcase.Spec)
func (OnePhaseCommitProtocol[Ent, ID]) Test ¶ added in v0.72.0
func (c OnePhaseCommitProtocol[Ent, ID]) Test(t *testing.T)
type OnePhaseCommitProtocolSubject ¶ added in v0.72.0
type OnePhaseCommitProtocolSubject[Ent, ID any] struct { Resource spechelper.CRD[Ent, ID] CommitManager comproto.OnePhaseCommitProtocol }
type Purger ¶
type PurgerSubject ¶
type PurgerSubject[Ent, ID any] interface { spechelper.CRD[Ent, ID] crud.Purger }
type QueryOne ¶
QueryOne is the generic representation of a query that meant to find one result. It is really similar to resources.Finder#FindByID, with the exception that the closure meant to know the query method name on the subject and the inputs it requires.
QueryOne is generated through ToQuery factory function in FindOne resource contract specification.
type Updater ¶
type Updater[Ent any, ID any] struct { Subject func(testing.TB) UpdaterSubject[Ent, ID] MakeCtx func(testing.TB) context.Context MakeEnt func(testing.TB) Ent // ChangeEnt is an optional option that allows fine control over // what will be changed on an Entity during the test of Update method. ChangeEnt func(testing.TB, *Ent) }
Updater will request an update for a wrapped entity object in the Resource
type UpdaterSubject ¶
Click to show internal directories.
Click to hide internal directories.