Documentation
¶
Index ¶
- func NewFakeAuthProvider(user auth.Identifiable, err error) auth.Provider
- func NewInMemoryBus() *event.InMemoryBus
- func NewMemoryTempDriver(t *testing.T) (*memory.Driver, func())
- func NewTestRegistry(t *testing.T, models ...any) (*database.Registry, func())
- func PublishSync(ctx context.Context, b event.Bus, ev any) error
- func WriteString(t *testing.T, d *memory.Driver, key, content string)
- type FakeAuthProvider
- type TestUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeAuthProvider ¶
func NewFakeAuthProvider(user auth.Identifiable, err error) auth.Provider
func NewInMemoryBus ¶
func NewInMemoryBus() *event.InMemoryBus
NewInMemoryBus returns a ready-to-use in-memory event bus for tests.
func NewMemoryTempDriver ¶
NewMemoryTempDriver creates a memory storage driver backed by a temporary directory.
func NewTestRegistry ¶
NewTestRegistry returns an in-memory sqlite *gorm.DB and a cleanup function for tests.
func PublishSync ¶
PublishSync publishes an event and waits for handlers to complete. This is a small helper that simply calls bus.Publish and returns its result.
Types ¶
type FakeAuthProvider ¶
type FakeAuthProvider struct {
User auth.Identifiable
Err error
}
FakeAuthProvider is a simple AuthProvider that returns a preset user or error.
func (*FakeAuthProvider) Verify ¶
func (f *FakeAuthProvider) Verify(ctx context.Context, token string) (auth.Identifiable, error)
Click to show internal directories.
Click to hide internal directories.