factory

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeviceLocationMods deviceLocationMods

DeviceLocation has methods that act as mods for the DeviceLocationTemplate

View Source
var SchemaMigrationMods schemaMigrationMods

SchemaMigration has methods that act as mods for the SchemaMigrationTemplate

Functions

This section is empty.

Types

type DeviceLocationMod

type DeviceLocationMod interface {
	Apply(context.Context, *DeviceLocationTemplate)
}

type DeviceLocationModFunc

type DeviceLocationModFunc func(context.Context, *DeviceLocationTemplate)

func (DeviceLocationModFunc) Apply

type DeviceLocationModSlice

type DeviceLocationModSlice []DeviceLocationMod

func (DeviceLocationModSlice) Apply

type DeviceLocationTemplate

type DeviceLocationTemplate struct {
	Time      func() time.Time
	DeviceID  func() string
	SpaceSlug func() string
	Latitude  func() float64
	Longitude func() float64
	Accuracy  func() float64
	// contains filtered or unexported fields
}

DeviceLocationTemplate is an object representing the database table. all columns are optional and should be set by mods

func (*DeviceLocationTemplate) Apply

Apply mods to the DeviceLocationTemplate

func (DeviceLocationTemplate) Build

Build returns an *models.DeviceLocation Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use DeviceLocationTemplate.Create

func (DeviceLocationTemplate) BuildMany

BuildMany returns an models.DeviceLocationSlice Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use DeviceLocationTemplate.CreateMany

func (DeviceLocationTemplate) BuildManySetter

func (o DeviceLocationTemplate) BuildManySetter(number int) []*models.DeviceLocationSetter

BuildManySetter returns an []*models.DeviceLocationSetter this does nothing with the relationship templates

func (DeviceLocationTemplate) BuildSetter

BuildSetter returns an *models.DeviceLocationSetter this does nothing with the relationship templates

func (*DeviceLocationTemplate) Create

Create builds a deviceLocation and inserts it into the database Relations objects are also inserted and placed in the .R field

func (DeviceLocationTemplate) CreateMany

CreateMany builds multiple deviceLocations and inserts them into the database Relations objects are also inserted and placed in the .R field

func (DeviceLocationTemplate) CreateManyOrFail

func (o DeviceLocationTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.DeviceLocationSlice

CreateManyOrFail builds multiple deviceLocations and inserts them into the database Relations objects are also inserted and placed in the .R field It calls `tb.Fatal(err)` on the test/benchmark if an error occurs

func (*DeviceLocationTemplate) CreateOrFail

CreateOrFail builds a deviceLocation and inserts it into the database Relations objects are also inserted and placed in the .R field It calls `tb.Fatal(err)` on the test/benchmark if an error occurs

func (*DeviceLocationTemplate) MustCreate

MustCreate builds a deviceLocation and inserts it into the database Relations objects are also inserted and placed in the .R field panics if an error occurs

func (DeviceLocationTemplate) MustCreateMany

func (o DeviceLocationTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.DeviceLocationSlice

MustCreateMany builds multiple deviceLocations and inserts them into the database Relations objects are also inserted and placed in the .R field panics if an error occurs

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func New

func New() *Factory

func (*Factory) AddBaseDeviceLocationMod

func (f *Factory) AddBaseDeviceLocationMod(mods ...DeviceLocationMod)

func (*Factory) AddBaseSchemaMigrationMod

func (f *Factory) AddBaseSchemaMigrationMod(mods ...SchemaMigrationMod)

func (*Factory) ClearBaseDeviceLocationMods

func (f *Factory) ClearBaseDeviceLocationMods()

func (*Factory) ClearBaseSchemaMigrationMods

func (f *Factory) ClearBaseSchemaMigrationMods()

func (*Factory) FromExistingDeviceLocation

func (f *Factory) FromExistingDeviceLocation(m *models.DeviceLocation) *DeviceLocationTemplate

func (*Factory) FromExistingSchemaMigration

func (f *Factory) FromExistingSchemaMigration(m *models.SchemaMigration) *SchemaMigrationTemplate

func (*Factory) NewDeviceLocation

func (f *Factory) NewDeviceLocation(mods ...DeviceLocationMod) *DeviceLocationTemplate

func (*Factory) NewDeviceLocationWithContext

func (f *Factory) NewDeviceLocationWithContext(ctx context.Context, mods ...DeviceLocationMod) *DeviceLocationTemplate

func (*Factory) NewSchemaMigration

func (f *Factory) NewSchemaMigration(mods ...SchemaMigrationMod) *SchemaMigrationTemplate

func (*Factory) NewSchemaMigrationWithContext

func (f *Factory) NewSchemaMigrationWithContext(ctx context.Context, mods ...SchemaMigrationMod) *SchemaMigrationTemplate

type SchemaMigrationMod

type SchemaMigrationMod interface {
	Apply(context.Context, *SchemaMigrationTemplate)
}

type SchemaMigrationModFunc

type SchemaMigrationModFunc func(context.Context, *SchemaMigrationTemplate)

func (SchemaMigrationModFunc) Apply

type SchemaMigrationModSlice

type SchemaMigrationModSlice []SchemaMigrationMod

func (SchemaMigrationModSlice) Apply

type SchemaMigrationTemplate

type SchemaMigrationTemplate struct {
	Version func() string
	// contains filtered or unexported fields
}

SchemaMigrationTemplate is an object representing the database table. all columns are optional and should be set by mods

func (*SchemaMigrationTemplate) Apply

Apply mods to the SchemaMigrationTemplate

func (SchemaMigrationTemplate) Build

Build returns an *models.SchemaMigration Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use SchemaMigrationTemplate.Create

func (SchemaMigrationTemplate) BuildMany

BuildMany returns an models.SchemaMigrationSlice Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use SchemaMigrationTemplate.CreateMany

func (SchemaMigrationTemplate) BuildManySetter

func (o SchemaMigrationTemplate) BuildManySetter(number int) []*models.SchemaMigrationSetter

BuildManySetter returns an []*models.SchemaMigrationSetter this does nothing with the relationship templates

func (SchemaMigrationTemplate) BuildSetter

BuildSetter returns an *models.SchemaMigrationSetter this does nothing with the relationship templates

func (*SchemaMigrationTemplate) Create

Create builds a schemaMigration and inserts it into the database Relations objects are also inserted and placed in the .R field

func (SchemaMigrationTemplate) CreateMany

CreateMany builds multiple schemaMigrations and inserts them into the database Relations objects are also inserted and placed in the .R field

func (SchemaMigrationTemplate) CreateManyOrFail

func (o SchemaMigrationTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.SchemaMigrationSlice

CreateManyOrFail builds multiple schemaMigrations and inserts them into the database Relations objects are also inserted and placed in the .R field It calls `tb.Fatal(err)` on the test/benchmark if an error occurs

func (*SchemaMigrationTemplate) CreateOrFail

CreateOrFail builds a schemaMigration and inserts it into the database Relations objects are also inserted and placed in the .R field It calls `tb.Fatal(err)` on the test/benchmark if an error occurs

func (*SchemaMigrationTemplate) MustCreate

MustCreate builds a schemaMigration and inserts it into the database Relations objects are also inserted and placed in the .R field panics if an error occurs

func (SchemaMigrationTemplate) MustCreateMany

func (o SchemaMigrationTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.SchemaMigrationSlice

MustCreateMany builds multiple schemaMigrations and inserts them into the database Relations objects are also inserted and placed in the .R field panics if an error occurs

Jump to

Keyboard shortcuts

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