diff options
| author | mo khan <mo@mokhan.ca> | 2025-04-22 11:34:14 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-04-22 11:34:14 -0600 |
| commit | c11693668f7e230a21f806664b411a598bee9b10 (patch) | |
| tree | 0fecffe3b5b7a98b2134cc86402370a777fdcd4c /app/controllers/sparkles/init.go | |
| parent | 699ef9cc2a910774d1f210ef0562496d08f04e03 (diff) | |
feat: add tiny vue.js app to list and add new sparkles
Diffstat (limited to 'app/controllers/sparkles/init.go')
| -rw-r--r-- | app/controllers/sparkles/init.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/sparkles/init.go b/app/controllers/sparkles/init.go new file mode 100644 index 0000000..9efcac8 --- /dev/null +++ b/app/controllers/sparkles/init.go @@ -0,0 +1,20 @@ +package sparkles + +import ( + "net/http" + + "github.com/xlgmokha/x/pkg/log" + "github.com/xlgmokha/x/pkg/mapper" + "github.com/xlgmokha/x/pkg/serde" + "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/domain" +) + +func init() { + mapper.Register[*http.Request, *domain.Sparkle](func(r *http.Request) *domain.Sparkle { + sparkle, err := serde.FromHTTP[*domain.Sparkle](r) + if err != nil { + log.WithFields(r.Context(), log.Fields{"error": err}) + } + return sparkle + }) +} |
