Skip to content

Maintenance/move to internal package#164

Merged
l00ptr merged 1 commit into
orgrim:masterfrom
l00ptr:maintenance/move-to-internal-package
Jun 2, 2026
Merged

Maintenance/move to internal package#164
l00ptr merged 1 commit into
orgrim:masterfrom
l00ptr:maintenance/move-to-internal-package

Conversation

@l00ptr
Copy link
Copy Markdown
Collaborator

@l00ptr l00ptr commented Apr 20, 2026

No description provided.

@l00ptr l00ptr changed the title Maintenance/move to internal package Draft: Maintenance/move to internal package Apr 20, 2026
@orgrim
Copy link
Copy Markdown
Owner

orgrim commented Apr 21, 2026

Hi, it's nice to reorganize code like this.

Just one comment on pg_back.conf, I think it should be left a the root of the project for better visibility. If that's not possible with embed, maybe just add a symlink so that it can be found easily from the root.

Regards

We also standardize logger dependencies.

Centralize responsibilities across the code by reorganizing logic
into domain-oriented internal packages and making dependencies
explicit in function signatures.

With this commit, we also:

- Move storage-related logic (upload, purge, locking) into internal/storage;
- Move PostgreSQL helpers (connection, SQL execution) into internal/postgresql;
- Move hashing and checksum utilities into internal/crypto and improve them;
- Move command hooks (pre/post execution) into the command package;
- Move shared helpers (path formatting, naming, relPath, etc.) into a
  helpers package;
- Move logger and configuration handling into internal packages;
- Refactor pg_dump handling and move command-related logic into internal;

Additionally, update function signatures to explicitly pass dependencies
(e.g. logger instances) instead of relying on implicit or package-level
state. For example:

```
lockPath(path string) → LockPath(logger *logger.LevelLog, path string)
```

This change is intentionally broad and mostly mechanical. While somewhat
naive, it establishes a consistent pattern for dependency injection,
improves observability, and removes hidden coupling across packages.
This is a first step before deeper refactoring.
@l00ptr l00ptr force-pushed the maintenance/move-to-internal-package branch from 109404a to fd98f12 Compare April 23, 2026 12:55
@l00ptr l00ptr changed the title Draft: Maintenance/move to internal package Maintenance/move to internal package Apr 23, 2026
@l00ptr l00ptr requested review from orgrim April 23, 2026 12:57
@l00ptr
Copy link
Copy Markdown
Collaborator Author

l00ptr commented May 21, 2026

@orgrim Could you please review that merge request? If you prefer i can split it into smaller commits.

Copy link
Copy Markdown
Owner

@orgrim orgrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@l00ptr l00ptr merged commit 2cd5006 into orgrim:master Jun 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants