Files
coding-standards/components/storages.md
T
2026-11-14 19:16:24 +05:00

12 lines
962 B
Markdown

# Storages
Storages are a special kind of packages that are responsible for high-level operations on storages. That said, database connections, S3 connections and other types of low-level operations are out of scope of this type of packages.
Storages should reside in `storage` directory in domain, e.g. for PostgreSQL configuration storage that directory will be `internal/domains/core/config/storage/postgresql`.
Every storage should be responsible only for one kind of storage, so PostgreSQL, MariaDB, S3 and local files storages should have own directories under `storage` directory.
Every storage should have own data models and should not use each other's models in function signatures. More on models in [DTOs and models](dtos-models.md).
Every storage should have own logger and may use other domains, so initializer should receive `*application.Application` that is used for obtaining logger and domains that implement low-level storage functions.