feat(smalltrip): new smalltrip package

This is a new package to reimplement the groute package with new
improvements and a better API
This commit is contained in:
Guz
2025-02-24 08:03:07 -03:00
commit 4fac484f1f
4 changed files with 301 additions and 0 deletions

28
options.go Normal file
View File

@@ -0,0 +1,28 @@
package smalltrip
import (
"log/slog"
"net/http"
"forge.capytal.company/loreddev/x/tinyssert"
)
type Option func(*router)
func WithAssertions(assertions tinyssert.Assertions) Option {
return func(r *router) {
r.assert = assertions
}
}
func WithLogger(logger *slog.Logger) Option {
return func(r *router) {
r.log = logger
}
}
func WithServeMux(mux *http.ServeMux) Option {
return func(r *router) {
r.mux = mux
}
}