cachecontracts

package
v0.94.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 18 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] interface {
	crud.Creator[Entity]
	crud.Finder[Entity, ID]
	crud.Updater[Entity]
	crud.Deleter[ID]
	pubsub.CreatorPublisher[Entity]
	pubsub.UpdaterPublisher[Entity]
	pubsub.DeleterPublisher[ID]
}

type EntityRepository added in v0.82.0

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 added in v0.82.0

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

func (EntityRepository[Entity, ID]) Spec added in v0.82.0

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

func (EntityRepository[Entity, ID]) Test added in v0.82.0

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

type Manager

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

func (Manager[Entity, ID]) Benchmark

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

func (Manager[Entity, ID]) ManagerSubject

func (c Manager[Entity, ID]) ManagerSubject() testcase.Var[ManagerSubject[Entity, ID]]

func (Manager[Entity, ID]) Spec

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

func (Manager[Entity, ID]) Test

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

type ManagerSubject

type ManagerSubject[Entity, ID any] struct {
	Cache         Cache[Entity, ID]
	Source        cache.Source[Entity, ID]
	CommitManager comproto.OnePhaseCommitProtocol
}

type Repository added in v0.82.0

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 added in v0.82.0

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

func (Repository[Entity, ID]) Spec added in v0.82.0

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

func (Repository[Entity, ID]) Test added in v0.82.0

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

type SpySource

type SpySource[Entity, ID any] struct {
	cache.Source[Entity, ID]
	// 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