mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:47:32 +00:00
chore: move the go code into a subfolder
This commit is contained in:
23
apps/api/internal/domain/url_template.go
Normal file
23
apps/api/internal/domain/url_template.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"io"
|
||||
"text/template"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/zerrors"
|
||||
)
|
||||
|
||||
func RenderURLTemplate(w io.Writer, tmpl string, data any) error {
|
||||
return renderURLTemplate(w, tmpl, data)
|
||||
}
|
||||
|
||||
func renderURLTemplate(w io.Writer, tmpl string, data any) error {
|
||||
parsed, err := template.New("").Parse(tmpl)
|
||||
if err != nil {
|
||||
return zerrors.ThrowInvalidArgument(err, "DOMAIN-oGh5e", "Errors.User.InvalidURLTemplate")
|
||||
}
|
||||
if err = parsed.Execute(w, data); err != nil {
|
||||
return zerrors.ThrowInvalidArgument(err, "DOMAIN-ieYa7", "Errors.User.InvalidURLTemplate")
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user