Documentation ¶
Index ¶
- Constants
- func GetValueId(value interface{}) (interface{}, bool)
- func KernelMiddlewareLoader(factory FixtureBuilderFactory) kernel.MiddlewareFactory
- type AutoNumbered
- type BlobFixturesSettings
- type DdbWriterOption
- type FixtureBuilder
- type FixtureBuilderFactory
- type FixtureLoader
- type FixtureSet
- type FixtureWriter
- func NewBlobFixtureWriterWithInterfaces(logger log.Logger, batchRunner blob.BatchRunner, purger *blobPurger, ...) FixtureWriter
- func NewConfigurableKvStoreFixtureWriterWithInterfaces[T any](logger log.Logger, store kvstore.KvStore[T]) FixtureWriter
- func NewDynamoDbFixtureWriterWithInterfaces(logger log.Logger, factory ddbRepoFactory, purger *dynamodbPurger) FixtureWriter
- func NewDynamoDbKvStoreFixtureWriterWithInterfaces[T any](logger log.Logger, factory ddbKvstoreFactory[T], purger *dynamodbPurger) FixtureWriter
- func NewMysqlFixtureWriterWithInterfaces(logger log.Logger, metadata *db_repo.Metadata, repo db_repo.Repository, ...) FixtureWriter
- func NewMysqlPlainFixtureWriterWithInterfaces(logger log.Logger, client db.Client, metadata *MysqlPlainMetaData, ...) FixtureWriter
- func NewRedisFixtureWriterWithInterfaces(logger log.Logger, client redis.Client, purger *redisPurger, operation *string) FixtureWriter
- func NewRedisKvStoreFixtureWriterWithInterfaces[T any](logger log.Logger, store kvstore.KvStore[T], purger *redisPurger) FixtureWriter
- type FixtureWriterFactory
- func BlobFixtureWriterFactory(settings *BlobFixturesSettings) FixtureWriterFactory
- func ConfigurableKvStoreFixtureWriterFactory[T any](name string) FixtureWriterFactory
- func DynamoDbFixtureWriterFactory(settings *ddb.Settings, options ...DdbWriterOption) FixtureWriterFactory
- func DynamoDbKvStoreFixtureWriterFactory[T any](modelId *mdl.ModelId) FixtureWriterFactory
- func MysqlOrmFixtureWriterFactory(metadata *db_repo.Metadata) FixtureWriterFactory
- func MysqlPlainFixtureWriterFactory(metadata *MysqlPlainMetaData) FixtureWriterFactory
- func RedisFixtureWriterFactory(name *string, operation *string) FixtureWriterFactory
- func RedisKvStoreFixtureWriterFactory[T any](modelId *mdl.ModelId) FixtureWriterFactory
- type KvStoreFixture
- type MysqlPlainFixtureValues
- type MysqlPlainMetaData
- type NamedFixture
- type NamedFixtureSet
- func (l *NamedFixtureSet) All() []interface{}
- func (l *NamedFixtureSet) CountIf(f func(elem interface{}) bool) int
- func (l *NamedFixtureSet) FindAll(f func(elem interface{}) bool) []interface{}
- func (l *NamedFixtureSet) FindFirst(f func(elem interface{}) bool) (interface{}, bool)
- func (l *NamedFixtureSet) GetValueById(id interface{}) interface{}
- func (l *NamedFixtureSet) GetValueByName(name string) interface{}
- func (l *NamedFixtureSet) Len() int
- type RedisFixture
Constants ¶
View Source
const ( RedisOpRpush = "RPUSH" RedisOpSet = "SET" )
Variables ¶
This section is empty.
Functions ¶
func GetValueId ¶
func GetValueId(value interface{}) (interface{}, bool)
func KernelMiddlewareLoader ¶
func KernelMiddlewareLoader(factory FixtureBuilderFactory) kernel.MiddlewareFactory
Types ¶
type AutoNumbered ¶
type AutoNumbered struct {
// contains filtered or unexported fields
}
func NewAutoNumbered ¶
func NewAutoNumbered() *AutoNumbered
func NewAutoNumberedFrom ¶
func NewAutoNumberedFrom(initial uint) *AutoNumbered
func (*AutoNumbered) GetNext ¶
func (n *AutoNumbered) GetNext() *uint
GetNext provides a fresh id for a fixture in case you don't want to assign specific ids Keep in mind that the ids are unique only in the scope of the same *AutoNumbered instance
type BlobFixturesSettings ¶
type DdbWriterOption ¶
func WithDdbModelIdApplication ¶
func WithDdbModelIdApplication(application string) DdbWriterOption
type FixtureBuilder ¶
type FixtureBuilder interface {
Fixtures() []*FixtureSet
}
type FixtureBuilderFactory ¶
type FixtureBuilderFactory func(ctx context.Context) (FixtureBuilder, error)
func SimpleFixtureBuilderFactory ¶
func SimpleFixtureBuilderFactory(fixtureSets []*FixtureSet) FixtureBuilderFactory
type FixtureLoader ¶
type FixtureLoader interface {
Load(ctx context.Context, fixtureSets []*FixtureSet) error
}
func NewFixtureLoader ¶
type FixtureSet ¶
type FixtureSet struct { Enabled bool Purge bool Writer FixtureWriterFactory Fixtures []interface{} }
type FixtureWriter ¶
type FixtureWriter interface { Purge(ctx context.Context) error Write(ctx context.Context, fixture *FixtureSet) error }
func NewBlobFixtureWriterWithInterfaces ¶
func NewBlobFixtureWriterWithInterfaces(logger log.Logger, batchRunner blob.BatchRunner, purger *blobPurger, store blob.Store, basePath string) FixtureWriter
func NewDynamoDbFixtureWriterWithInterfaces ¶
func NewDynamoDbFixtureWriterWithInterfaces(logger log.Logger, factory ddbRepoFactory, purger *dynamodbPurger) FixtureWriter
func NewDynamoDbKvStoreFixtureWriterWithInterfaces ¶
func NewDynamoDbKvStoreFixtureWriterWithInterfaces[T any](logger log.Logger, factory ddbKvstoreFactory[T], purger *dynamodbPurger) FixtureWriter
func NewMysqlFixtureWriterWithInterfaces ¶
func NewMysqlFixtureWriterWithInterfaces(logger log.Logger, metadata *db_repo.Metadata, repo db_repo.Repository, purger *mysqlPurger) FixtureWriter
func NewMysqlPlainFixtureWriterWithInterfaces ¶
func NewMysqlPlainFixtureWriterWithInterfaces(logger log.Logger, client db.Client, metadata *MysqlPlainMetaData, purger *mysqlPurger) FixtureWriter
type FixtureWriterFactory ¶
type FixtureWriterFactory func(ctx context.Context, config cfg.Config, logger log.Logger) (FixtureWriter, error)
func BlobFixtureWriterFactory ¶
func BlobFixtureWriterFactory(settings *BlobFixturesSettings) FixtureWriterFactory
func ConfigurableKvStoreFixtureWriterFactory ¶
func ConfigurableKvStoreFixtureWriterFactory[T any](name string) FixtureWriterFactory
func DynamoDbFixtureWriterFactory ¶
func DynamoDbFixtureWriterFactory(settings *ddb.Settings, options ...DdbWriterOption) FixtureWriterFactory
func DynamoDbKvStoreFixtureWriterFactory ¶
func DynamoDbKvStoreFixtureWriterFactory[T any](modelId *mdl.ModelId) FixtureWriterFactory
func MysqlOrmFixtureWriterFactory ¶
func MysqlOrmFixtureWriterFactory(metadata *db_repo.Metadata) FixtureWriterFactory
func MysqlPlainFixtureWriterFactory ¶
func MysqlPlainFixtureWriterFactory(metadata *MysqlPlainMetaData) FixtureWriterFactory
func RedisFixtureWriterFactory ¶
func RedisFixtureWriterFactory(name *string, operation *string) FixtureWriterFactory
func RedisKvStoreFixtureWriterFactory ¶
func RedisKvStoreFixtureWriterFactory[T any](modelId *mdl.ModelId) FixtureWriterFactory
type KvStoreFixture ¶
type KvStoreFixture struct { Key interface{} Value interface{} }
type MysqlPlainFixtureValues ¶
type MysqlPlainFixtureValues []interface{}
type MysqlPlainMetaData ¶
type NamedFixture ¶
type NamedFixture struct { Name string Value interface{} }
type NamedFixtureSet ¶
type NamedFixtureSet []*NamedFixture
func GetNamedFixtures ¶
func GetNamedFixtures(container interface{}) []NamedFixtureSet
func (*NamedFixtureSet) All ¶
func (l *NamedFixtureSet) All() []interface{}
func (*NamedFixtureSet) CountIf ¶
func (l *NamedFixtureSet) CountIf(f func(elem interface{}) bool) int
func (*NamedFixtureSet) FindAll ¶
func (l *NamedFixtureSet) FindAll(f func(elem interface{}) bool) []interface{}
func (*NamedFixtureSet) FindFirst ¶
func (l *NamedFixtureSet) FindFirst(f func(elem interface{}) bool) (interface{}, bool)
func (*NamedFixtureSet) GetValueById ¶
func (l *NamedFixtureSet) GetValueById(id interface{}) interface{}
func (*NamedFixtureSet) GetValueByName ¶
func (l *NamedFixtureSet) GetValueByName(name string) interface{}
func (*NamedFixtureSet) Len ¶
func (l *NamedFixtureSet) Len() int
type RedisFixture ¶
Source Files ¶
- auto_numbered.go
- kernel_middleware.go
- loader_noop.go
- named.go
- purger_blob.go
- purger_dynamodb.go
- purger_mysql.go
- purger_redis.go
- types.go
- writer_blob.go
- writer_configurable_kvstore.go
- writer_ddb.go
- writer_ddb_kvstore.go
- writer_ddb_options.go
- writer_mysql_orm.go
- writer_mysql_plain.go
- writer_redis.go
- writer_redis_kvstore.go
Click to show internal directories.
Click to hide internal directories.