Documentation ¶
Index ¶
- func BundleReaderFactory(db database.Database) (repo storage.BundleReader)
- func BundleWriterFactory(db database.Database) (repo storage.BundleWriter)
- func DataReaderFactory(db database.Database) (repo storage.DataReader)
- func DataWriterFactory(db database.Database) (repo storage.DataWriter)
- func DatabaseFactory(conf config.Database) (db database.Database, err error)
- func SchemaReaderFactory(db database.Database) (repo storage.SchemaReader)
- func SchemaWriterFactory(db database.Database) (repo storage.SchemaWriter)
- func TenantReaderFactory(db database.Database) (repo storage.TenantReader)
- func TenantWriterFactory(db database.Database) (repo storage.TenantWriter)
- func WatcherFactory(db database.Database) (repo storage.Watcher)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BundleReaderFactory ¶ added in v0.6.0
func BundleReaderFactory(db database.Database) (repo storage.BundleReader)
BundleReaderFactory is a factory function that creates and returns a BundleReader based on the type of database engine being used.
func BundleWriterFactory ¶ added in v0.6.0
func BundleWriterFactory(db database.Database) (repo storage.BundleWriter)
BundleWriterFactory is a factory function that creates and returns a BundleWriter based on the type of database engine being used.
func DataReaderFactory ¶ added in v0.5.0
func DataReaderFactory(db database.Database) (repo storage.DataReader)
DataReaderFactory creates and returns a DataReader based on the database engine type.
func DataWriterFactory ¶ added in v0.5.0
func DataWriterFactory(db database.Database) (repo storage.DataWriter)
DataWriterFactory creates and returns a DataWriter based on the database engine type.
func DatabaseFactory ¶
DatabaseFactory is a factory function that creates a database instance according to the given configuration. It supports different types of databases, such as PostgreSQL and in-memory databases.
conf: the configuration object containing the necessary information to create a database connection.
It should have the following properties: - Engine: the type of the database, e.g., POSTGRES or MEMORY - URI: the connection string for the database (only required for some database engines, e.g., POSTGRES) - MaxOpenConnections: the maximum number of open connections to the database - MaxIdleConnections: the maximum number of idle connections in the connection pool - MaxConnectionIdleTime: the maximum amount of time a connection can be idle before being closed - MaxConnectionLifetime: the maximum amount of time a connection can be reused before being closed - WatchBufferSize: specifies the buffer size for database watch operations, impacting how many changes can be queued - MaxDataPerWrite: sets the maximum amount of data per write operation to the database - MaxRetries: defines the maximum number of retries for database operations in case of failure
Returns a database.Database instance if the database connection is successfully created, or an error if the creation fails or the specified database engine is unsupported.
func SchemaReaderFactory ¶
func SchemaReaderFactory(db database.Database) (repo storage.SchemaReader)
SchemaReaderFactory creates and returns a SchemaReader based on the database engine type.
func SchemaWriterFactory ¶
func SchemaWriterFactory(db database.Database) (repo storage.SchemaWriter)
SchemaWriterFactory creates and returns a SchemaWriter based on the database engine type.
func TenantReaderFactory ¶ added in v0.3.0
func TenantReaderFactory(db database.Database) (repo storage.TenantReader)
TenantReaderFactory creates and returns a TenantReader based on the database engine type.
func TenantWriterFactory ¶ added in v0.3.0
func TenantWriterFactory(db database.Database) (repo storage.TenantWriter)
TenantWriterFactory creates and returns a TenantWriter based on the database engine type.
Types ¶
This section is empty.