scafolding#137
Open
mdeyell-valid-mind wants to merge 2 commits into
Open
Conversation
mdeyell-valid-mind
force-pushed
the
scafolding
branch
from
July 14, 2026 21:44
4d5a687 to
860cb5a
Compare
| // runs after the built-in routes are registered and outside every auth | ||
| // middleware chain (like /healthz): each extra route is responsible for its | ||
| // own authentication. Patterns must not collide with built-in routes. | ||
| func WithRoutes(register func(mux *http.ServeMux)) Option { |
Contributor
Author
There was a problem hiding this comment.
this is what external callers use to add routes to atryum
| // AddExtraRoutes registers a callback that may mount additional routes on the | ||
| // server mux built by Routes. Patterns must not collide with built-in routes | ||
| // (http.ServeMux panics on duplicate registration). | ||
| func (h *Handler) AddExtraRoutes(register func(mux *http.ServeMux)) { |
Contributor
Author
There was a problem hiding this comment.
This is the internal atryum function that lets routes get added to it
| // migrations (built-in and extension) have been applied, before the server | ||
| // starts accepting requests. usePostgres distinguishes the SQL dialect, with | ||
| // false meaning SQLite (the same convention as migrations.Step). | ||
| func WithDatabase(hook func(db *sql.DB, usePostgres bool)) Option { |
Contributor
Author
There was a problem hiding this comment.
this is what external callers use to give atryum its database
| // own, so each extension numbers its migrations from 1 and new upstream | ||
| // migrations can never collide with them. The namespace identifies the | ||
| // extension (e.g. "authority") and must stay stable across releases. | ||
| func WithMigrations(namespace string, definitions []migrations.Definition) Option { |
Contributor
Author
There was a problem hiding this comment.
this is how external callers tell atryum about their migrations. The external migrations run after internal
mdeyell-valid-mind
marked this pull request as ready for review
July 14, 2026 22:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testing:
I ran atryum and didn't see any changes