chore: move the go code into a subfolder

This commit is contained in:
Florian Forster
2025-08-05 15:20:32 -07:00
parent 4ad22ba456
commit cd2921de26
2978 changed files with 373 additions and 300 deletions

View File

@@ -0,0 +1,28 @@
package form
import (
"net/http"
"github.com/gorilla/schema"
"github.com/zitadel/zitadel/internal/zerrors"
)
type Parser struct {
decoder *schema.Decoder
}
func NewParser() *Parser {
d := schema.NewDecoder()
d.IgnoreUnknownKeys(true)
return &Parser{d}
}
func (p *Parser) Parse(r *http.Request, data interface{}) error {
err := r.ParseForm()
if err != nil {
return zerrors.ThrowInternal(err, "FORM-lCC9zI", "Errors.Internal")
}
return p.decoder.Decode(data, r.Form)
}