cachecontracts

package
v0.130.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[Entity, ID any] struct {
	MakeSubject func(testing.TB) CacheSubject[Entity, ID]
	MakeContext func(testing.TB) context.Context
	MakeEntity  func(testing.TB) Entity
}

func (Cache[Entity, ID]) Benchmark

func (c Cache[Entity, ID]) Benchmark(b *testing.B)

func (Cache[Entity, ID]) Spec

func (c Cache[Entity, ID]) Spec(s *testcase.Spec)

func (Cache[Entity, ID]) Test

func (c Cache[Entity, ID]) Test(t *testing.T)

type CacheSubject

type CacheSubject[Entity, ID any] struct {
	Cache      cacheCache[Entity, ID]
	Source     cacheSource[Entity, ID]
	Repository cache.Repository[Entity, ID]
}

type EntityRepository

type EntityRepository[Entity, ID any] struct {
	MakeSubject func(testing.TB) (cache.EntityRepository[Entity, ID], comproto.OnePhaseCommitProtocol)
	MakeContext func(testing.TB) context.Context
	MakeEntity  func(testing.TB) Entity
}

func (EntityRepository[Entity, ID]) Benchmark

func (c EntityRepository[Entity, ID]) Benchmark(b *testing.B)

func (EntityRepository[Entity, ID]) Spec

func (c EntityRepository[Entity, ID]) Spec(s *testcase.Spec)

func (EntityRepository[Entity, ID]) Test

func (c EntityRepository[Entity, ID]) Test(t *testing.T)

type Repository

type Repository[Entity, ID any] struct {
	MakeSubject func(testing.TB) cache.Repository[Entity, ID]
	MakeContext func(testing.TB) context.Context
	MakeEntity  func(testing.TB) Entity
}

func (Repository[Entity, ID]) Benchmark

func (c Repository[Entity, ID]) Benchmark(b *testing.B)

func (Repository[Entity, ID]) Spec

func (c Repository[Entity, ID]) Spec(s *testcase.Spec)

func (Repository[Entity, ID]) Test

func (c Repository[Entity, ID]) Test(t *testing.T)

type SpySource

type SpySource[Entity, ID any] struct {
	// contains filtered or unexported fields
}

func (*SpySource[Entity, ID]) FindByID

func (stub *SpySource[Entity, ID]) FindByID(ctx context.Context, id ID) (_ent Entity, _found bool, _err error)

Jump to

Keyboard shortcuts

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