Documentation
¶
Index ¶
- Variables
- type CredentialMod
- type CredentialModFunc
- type CredentialModSlice
- type CredentialTemplate
- func (o *CredentialTemplate) Apply(ctx context.Context, mods ...CredentialMod)
- func (o CredentialTemplate) Build() *models.Credential
- func (o CredentialTemplate) BuildMany(number int) models.CredentialSlice
- func (o CredentialTemplate) BuildManySetter(number int) []*models.CredentialSetter
- func (o CredentialTemplate) BuildSetter() *models.CredentialSetter
- func (o *CredentialTemplate) Create(ctx context.Context, exec bob.Executor) (*models.Credential, error)
- func (o CredentialTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.CredentialSlice, error)
- func (o CredentialTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.CredentialSlice
- func (o *CredentialTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.Credential
- func (o *CredentialTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.Credential
- func (o CredentialTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.CredentialSlice
- type Factory
- func (f *Factory) AddBaseCredentialMod(mods ...CredentialMod)
- func (f *Factory) AddBaseFileMod(mods ...FileMod)
- func (f *Factory) AddBaseItemMod(mods ...ItemMod)
- func (f *Factory) AddBaseSchemaMigrationMod(mods ...SchemaMigrationMod)
- func (f *Factory) AddBaseUserMod(mods ...UserMod)
- func (f *Factory) ClearBaseCredentialMods()
- func (f *Factory) ClearBaseFileMods()
- func (f *Factory) ClearBaseItemMods()
- func (f *Factory) ClearBaseSchemaMigrationMods()
- func (f *Factory) ClearBaseUserMods()
- func (f *Factory) NewCredential(ctx context.Context, mods ...CredentialMod) *CredentialTemplate
- func (f *Factory) NewFile(ctx context.Context, mods ...FileMod) *FileTemplate
- func (f *Factory) NewItem(ctx context.Context, mods ...ItemMod) *ItemTemplate
- func (f *Factory) NewSchemaMigration(ctx context.Context, mods ...SchemaMigrationMod) *SchemaMigrationTemplate
- func (f *Factory) NewUser(ctx context.Context, mods ...UserMod) *UserTemplate
- type FileMod
- type FileModFunc
- type FileModSlice
- type FileTemplate
- func (o *FileTemplate) Apply(ctx context.Context, mods ...FileMod)
- func (o FileTemplate) Build() *models.File
- func (o FileTemplate) BuildMany(number int) models.FileSlice
- func (o FileTemplate) BuildManySetter(number int) []*models.FileSetter
- func (o FileTemplate) BuildSetter() *models.FileSetter
- func (o *FileTemplate) Create(ctx context.Context, exec bob.Executor) (*models.File, error)
- func (o FileTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FileSlice, error)
- func (o FileTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FileSlice
- func (o *FileTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.File
- func (o *FileTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.File
- func (o FileTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FileSlice
- type ItemMod
- type ItemModFunc
- type ItemModSlice
- type ItemTemplate
- func (o *ItemTemplate) Apply(ctx context.Context, mods ...ItemMod)
- func (o ItemTemplate) Build() *models.Item
- func (o ItemTemplate) BuildMany(number int) models.ItemSlice
- func (o ItemTemplate) BuildManySetter(number int) []*models.ItemSetter
- func (o ItemTemplate) BuildSetter() *models.ItemSetter
- func (o *ItemTemplate) Create(ctx context.Context, exec bob.Executor) (*models.Item, error)
- func (o ItemTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.ItemSlice, error)
- func (o ItemTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.ItemSlice
- func (o *ItemTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.Item
- func (o *ItemTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.Item
- func (o ItemTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.ItemSlice
- type SchemaMigrationMod
- type SchemaMigrationModFunc
- type SchemaMigrationModSlice
- type SchemaMigrationTemplate
- func (o *SchemaMigrationTemplate) Apply(ctx context.Context, mods ...SchemaMigrationMod)
- func (o SchemaMigrationTemplate) Build() *models.SchemaMigration
- func (o SchemaMigrationTemplate) BuildMany(number int) models.SchemaMigrationSlice
- func (o SchemaMigrationTemplate) BuildManySetter(number int) []*models.SchemaMigrationSetter
- func (o SchemaMigrationTemplate) BuildSetter() *models.SchemaMigrationSetter
- func (o *SchemaMigrationTemplate) Create(ctx context.Context, exec bob.Executor) (*models.SchemaMigration, error)
- func (o SchemaMigrationTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.SchemaMigrationSlice, error)
- func (o SchemaMigrationTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.SchemaMigrationSlice
- func (o *SchemaMigrationTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.SchemaMigration
- func (o *SchemaMigrationTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.SchemaMigration
- func (o SchemaMigrationTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.SchemaMigrationSlice
- type UserMod
- type UserModFunc
- type UserModSlice
- type UserTemplate
- func (o *UserTemplate) Apply(ctx context.Context, mods ...UserMod)
- func (o UserTemplate) Build() *models.User
- func (o UserTemplate) BuildMany(number int) models.UserSlice
- func (o UserTemplate) BuildManySetter(number int) []*models.UserSetter
- func (o UserTemplate) BuildSetter() *models.UserSetter
- func (o *UserTemplate) Create(ctx context.Context, exec bob.Executor) (*models.User, error)
- func (o UserTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.UserSlice, error)
- func (o UserTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.UserSlice
- func (o *UserTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.User
- func (o *UserTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.User
- func (o UserTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.UserSlice
Constants ¶
This section is empty.
Variables ¶
var CredentialMods credentialMods
Credential has methods that act as mods for the CredentialTemplate
var FileMods fileMods
File has methods that act as mods for the FileTemplate
var ItemMods itemMods
Item has methods that act as mods for the ItemTemplate
var SchemaMigrationMods schemaMigrationMods
SchemaMigration has methods that act as mods for the SchemaMigrationTemplate
var UserMods userMods
User has methods that act as mods for the UserTemplate
Functions ¶
This section is empty.
Types ¶
type CredentialMod ¶
type CredentialMod interface {
Apply(context.Context, *CredentialTemplate)
}
type CredentialModFunc ¶
type CredentialModFunc func(context.Context, *CredentialTemplate)
func (CredentialModFunc) Apply ¶
func (f CredentialModFunc) Apply(ctx context.Context, n *CredentialTemplate)
type CredentialModSlice ¶
type CredentialModSlice []CredentialMod
func (CredentialModSlice) Apply ¶
func (mods CredentialModSlice) Apply(ctx context.Context, n *CredentialTemplate)
type CredentialTemplate ¶
type CredentialTemplate struct { CredID func() string CredPublicKey func() []byte SignCount func() int32 Transports func() sql.Null[string] UserVerified func() sql.Null[bool] BackupEligible func() sql.Null[bool] BackupState func() sql.Null[bool] AttestationObject func() sql.Null[[]byte] AttestationClientData func() sql.Null[[]byte] CreatedAt func() time.Time LastUsed func() time.Time UserID func() int32 // contains filtered or unexported fields }
CredentialTemplate is an object representing the database table. all columns are optional and should be set by mods
func (*CredentialTemplate) Apply ¶
func (o *CredentialTemplate) Apply(ctx context.Context, mods ...CredentialMod)
Apply mods to the CredentialTemplate
func (CredentialTemplate) Build ¶
func (o CredentialTemplate) Build() *models.Credential
Build returns an *models.Credential Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use CredentialTemplate.Create
func (CredentialTemplate) BuildMany ¶
func (o CredentialTemplate) BuildMany(number int) models.CredentialSlice
BuildMany returns an models.CredentialSlice Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use CredentialTemplate.CreateMany
func (CredentialTemplate) BuildManySetter ¶
func (o CredentialTemplate) BuildManySetter(number int) []*models.CredentialSetter
BuildManySetter returns an []*models.CredentialSetter this does nothing with the relationship templates
func (CredentialTemplate) BuildSetter ¶
func (o CredentialTemplate) BuildSetter() *models.CredentialSetter
BuildSetter returns an *models.CredentialSetter this does nothing with the relationship templates
func (*CredentialTemplate) Create ¶
func (o *CredentialTemplate) Create(ctx context.Context, exec bob.Executor) (*models.Credential, error)
Create builds a credential and inserts it into the database Relations objects are also inserted and placed in the .R field
func (CredentialTemplate) CreateMany ¶
func (o CredentialTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.CredentialSlice, error)
CreateMany builds multiple credentials and inserts them into the database Relations objects are also inserted and placed in the .R field
func (CredentialTemplate) CreateManyOrFail ¶
func (o CredentialTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.CredentialSlice
CreateManyOrFail builds multiple credentials 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 (*CredentialTemplate) CreateOrFail ¶
func (o *CredentialTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.Credential
CreateOrFail builds a credential 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 (*CredentialTemplate) MustCreate ¶
func (o *CredentialTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.Credential
MustCreate builds a credential and inserts it into the database Relations objects are also inserted and placed in the .R field panics if an error occurs
func (CredentialTemplate) MustCreateMany ¶
func (o CredentialTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.CredentialSlice
MustCreateMany builds multiple credentials 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 (*Factory) AddBaseCredentialMod ¶
func (f *Factory) AddBaseCredentialMod(mods ...CredentialMod)
func (*Factory) AddBaseFileMod ¶
func (*Factory) AddBaseItemMod ¶
func (*Factory) AddBaseSchemaMigrationMod ¶
func (f *Factory) AddBaseSchemaMigrationMod(mods ...SchemaMigrationMod)
func (*Factory) AddBaseUserMod ¶
func (*Factory) ClearBaseCredentialMods ¶
func (f *Factory) ClearBaseCredentialMods()
func (*Factory) ClearBaseFileMods ¶
func (f *Factory) ClearBaseFileMods()
func (*Factory) ClearBaseItemMods ¶
func (f *Factory) ClearBaseItemMods()
func (*Factory) ClearBaseSchemaMigrationMods ¶
func (f *Factory) ClearBaseSchemaMigrationMods()
func (*Factory) ClearBaseUserMods ¶
func (f *Factory) ClearBaseUserMods()
func (*Factory) NewCredential ¶
func (f *Factory) NewCredential(ctx context.Context, mods ...CredentialMod) *CredentialTemplate
func (*Factory) NewFile ¶
func (f *Factory) NewFile(ctx context.Context, mods ...FileMod) *FileTemplate
func (*Factory) NewItem ¶
func (f *Factory) NewItem(ctx context.Context, mods ...ItemMod) *ItemTemplate
func (*Factory) NewSchemaMigration ¶
func (f *Factory) NewSchemaMigration(ctx context.Context, mods ...SchemaMigrationMod) *SchemaMigrationTemplate
type FileMod ¶
type FileMod interface {
Apply(context.Context, *FileTemplate)
}
type FileModFunc ¶
type FileModFunc func(context.Context, *FileTemplate)
func (FileModFunc) Apply ¶
func (f FileModFunc) Apply(ctx context.Context, n *FileTemplate)
type FileModSlice ¶
type FileModSlice []FileMod
func (FileModSlice) Apply ¶
func (mods FileModSlice) Apply(ctx context.Context, n *FileTemplate)
type FileTemplate ¶
type FileTemplate struct { ID func() int32 Name func() string Data func() []byte UserID func() int32 // contains filtered or unexported fields }
FileTemplate is an object representing the database table. all columns are optional and should be set by mods
func (*FileTemplate) Apply ¶
func (o *FileTemplate) Apply(ctx context.Context, mods ...FileMod)
Apply mods to the FileTemplate
func (FileTemplate) Build ¶
func (o FileTemplate) Build() *models.File
Build returns an *models.File Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use FileTemplate.Create
func (FileTemplate) BuildMany ¶
func (o FileTemplate) BuildMany(number int) models.FileSlice
BuildMany returns an models.FileSlice Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use FileTemplate.CreateMany
func (FileTemplate) BuildManySetter ¶
func (o FileTemplate) BuildManySetter(number int) []*models.FileSetter
BuildManySetter returns an []*models.FileSetter this does nothing with the relationship templates
func (FileTemplate) BuildSetter ¶
func (o FileTemplate) BuildSetter() *models.FileSetter
BuildSetter returns an *models.FileSetter this does nothing with the relationship templates
func (*FileTemplate) Create ¶
Create builds a file and inserts it into the database Relations objects are also inserted and placed in the .R field
func (FileTemplate) CreateMany ¶
func (o FileTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FileSlice, error)
CreateMany builds multiple files and inserts them into the database Relations objects are also inserted and placed in the .R field
func (FileTemplate) CreateManyOrFail ¶
func (o FileTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FileSlice
CreateManyOrFail builds multiple files 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 (*FileTemplate) CreateOrFail ¶
func (o *FileTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.File
CreateOrFail builds a file 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 (*FileTemplate) MustCreate ¶
MustCreate builds a file and inserts it into the database Relations objects are also inserted and placed in the .R field panics if an error occurs
func (FileTemplate) MustCreateMany ¶
func (o FileTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FileSlice
MustCreateMany builds multiple files and inserts them into the database Relations objects are also inserted and placed in the .R field panics if an error occurs
type ItemMod ¶
type ItemMod interface {
Apply(context.Context, *ItemTemplate)
}
type ItemModFunc ¶
type ItemModFunc func(context.Context, *ItemTemplate)
func (ItemModFunc) Apply ¶
func (f ItemModFunc) Apply(ctx context.Context, n *ItemTemplate)
type ItemModSlice ¶
type ItemModSlice []ItemMod
func (ItemModSlice) Apply ¶
func (mods ItemModSlice) Apply(ctx context.Context, n *ItemTemplate)
type ItemTemplate ¶
type ItemTemplate struct { ID func() int32 Name func() string Added func() time.Time Description func() string Price func() float32 Quantity func() int32 UserID func() int32 // contains filtered or unexported fields }
ItemTemplate is an object representing the database table. all columns are optional and should be set by mods
func (*ItemTemplate) Apply ¶
func (o *ItemTemplate) Apply(ctx context.Context, mods ...ItemMod)
Apply mods to the ItemTemplate
func (ItemTemplate) Build ¶
func (o ItemTemplate) Build() *models.Item
Build returns an *models.Item Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use ItemTemplate.Create
func (ItemTemplate) BuildMany ¶
func (o ItemTemplate) BuildMany(number int) models.ItemSlice
BuildMany returns an models.ItemSlice Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use ItemTemplate.CreateMany
func (ItemTemplate) BuildManySetter ¶
func (o ItemTemplate) BuildManySetter(number int) []*models.ItemSetter
BuildManySetter returns an []*models.ItemSetter this does nothing with the relationship templates
func (ItemTemplate) BuildSetter ¶
func (o ItemTemplate) BuildSetter() *models.ItemSetter
BuildSetter returns an *models.ItemSetter this does nothing with the relationship templates
func (*ItemTemplate) Create ¶
Create builds a item and inserts it into the database Relations objects are also inserted and placed in the .R field
func (ItemTemplate) CreateMany ¶
func (o ItemTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.ItemSlice, error)
CreateMany builds multiple items and inserts them into the database Relations objects are also inserted and placed in the .R field
func (ItemTemplate) CreateManyOrFail ¶
func (o ItemTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.ItemSlice
CreateManyOrFail builds multiple items 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 (*ItemTemplate) CreateOrFail ¶
func (o *ItemTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.Item
CreateOrFail builds a item 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 (*ItemTemplate) MustCreate ¶
MustCreate builds a item and inserts it into the database Relations objects are also inserted and placed in the .R field panics if an error occurs
func (ItemTemplate) MustCreateMany ¶
func (o ItemTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.ItemSlice
MustCreateMany builds multiple items and inserts them into the database Relations objects are also inserted and placed in the .R field panics if an error occurs
type SchemaMigrationMod ¶
type SchemaMigrationMod interface {
Apply(context.Context, *SchemaMigrationTemplate)
}
type SchemaMigrationModFunc ¶
type SchemaMigrationModFunc func(context.Context, *SchemaMigrationTemplate)
func (SchemaMigrationModFunc) Apply ¶
func (f SchemaMigrationModFunc) Apply(ctx context.Context, n *SchemaMigrationTemplate)
type SchemaMigrationModSlice ¶
type SchemaMigrationModSlice []SchemaMigrationMod
func (SchemaMigrationModSlice) Apply ¶
func (mods SchemaMigrationModSlice) Apply(ctx context.Context, n *SchemaMigrationTemplate)
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 ¶
func (o *SchemaMigrationTemplate) Apply(ctx context.Context, mods ...SchemaMigrationMod)
Apply mods to the SchemaMigrationTemplate
func (SchemaMigrationTemplate) Build ¶
func (o SchemaMigrationTemplate) Build() *models.SchemaMigration
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 ¶
func (o SchemaMigrationTemplate) BuildMany(number int) models.SchemaMigrationSlice
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 ¶
func (o SchemaMigrationTemplate) BuildSetter() *models.SchemaMigrationSetter
BuildSetter returns an *models.SchemaMigrationSetter this does nothing with the relationship templates
func (*SchemaMigrationTemplate) Create ¶
func (o *SchemaMigrationTemplate) Create(ctx context.Context, exec bob.Executor) (*models.SchemaMigration, error)
Create builds a schemaMigration and inserts it into the database Relations objects are also inserted and placed in the .R field
func (SchemaMigrationTemplate) CreateMany ¶
func (o SchemaMigrationTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.SchemaMigrationSlice, error)
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 ¶
func (o *SchemaMigrationTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.SchemaMigration
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 ¶
func (o *SchemaMigrationTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.SchemaMigration
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
type UserMod ¶
type UserMod interface {
Apply(context.Context, *UserTemplate)
}
type UserModFunc ¶
type UserModFunc func(context.Context, *UserTemplate)
func (UserModFunc) Apply ¶
func (f UserModFunc) Apply(ctx context.Context, n *UserTemplate)
type UserModSlice ¶
type UserModSlice []UserMod
func (UserModSlice) Apply ¶
func (mods UserModSlice) Apply(ctx context.Context, n *UserTemplate)
type UserTemplate ¶
type UserTemplate struct { ID func() int32 Username func() string Password func() string ProfilePictureID func() sql.Null[int32] WebauthnID func() string // contains filtered or unexported fields }
UserTemplate is an object representing the database table. all columns are optional and should be set by mods
func (*UserTemplate) Apply ¶
func (o *UserTemplate) Apply(ctx context.Context, mods ...UserMod)
Apply mods to the UserTemplate
func (UserTemplate) Build ¶
func (o UserTemplate) Build() *models.User
Build returns an *models.User Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use UserTemplate.Create
func (UserTemplate) BuildMany ¶
func (o UserTemplate) BuildMany(number int) models.UserSlice
BuildMany returns an models.UserSlice Related objects are also created and placed in the .R field NOTE: Objects are not inserted into the database. Use UserTemplate.CreateMany
func (UserTemplate) BuildManySetter ¶
func (o UserTemplate) BuildManySetter(number int) []*models.UserSetter
BuildManySetter returns an []*models.UserSetter this does nothing with the relationship templates
func (UserTemplate) BuildSetter ¶
func (o UserTemplate) BuildSetter() *models.UserSetter
BuildSetter returns an *models.UserSetter this does nothing with the relationship templates
func (*UserTemplate) Create ¶
Create builds a user and inserts it into the database Relations objects are also inserted and placed in the .R field
func (UserTemplate) CreateMany ¶
func (o UserTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.UserSlice, error)
CreateMany builds multiple users and inserts them into the database Relations objects are also inserted and placed in the .R field
func (UserTemplate) CreateManyOrFail ¶
func (o UserTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.UserSlice
CreateManyOrFail builds multiple users 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 (*UserTemplate) CreateOrFail ¶
func (o *UserTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.User
CreateOrFail builds a user 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 (*UserTemplate) MustCreate ¶
MustCreate builds a user and inserts it into the database Relations objects are also inserted and placed in the .R field panics if an error occurs
func (UserTemplate) MustCreateMany ¶
func (o UserTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.UserSlice
MustCreateMany builds multiple users and inserts them into the database Relations objects are also inserted and placed in the .R field panics if an error occurs