removed intermediate /internal directory

This commit is contained in:
2026-02-09 13:40:31 -07:00
parent b155280081
commit 0944703d2a
50 changed files with 117 additions and 101 deletions
+51
View File
@@ -0,0 +1,51 @@
package param
import (
"encoding"
"strconv"
"ruben/inventory2/domains/accounts"
)
// encoding.TextUnmarshaler instances for Spec
func Text(dst *string) encoding.TextUnmarshaler {
return (*rawText)(dst)
}
func Int(dst *int) encoding.TextUnmarshaler {
return (*intText)(dst)
}
func Platform(dst *accounts.Platform) encoding.TextUnmarshaler {
return (*platformText)(dst)
}
type (
rawText string
intText int
platformText accounts.Platform
)
func (t *rawText) UnmarshalText(text []byte) error {
*t = rawText(text)
return nil
}
func (n *intText) UnmarshalText(text []byte) error {
i, err := strconv.Atoi(string(text))
if err != nil {
return err
}
*n = intText(i)
return nil
}
func (p *platformText) UnmarshalText(text []byte) error {
v, err := accounts.NewPlatform(string(text))
if err != nil {
return err
}
*p = platformText(v)
return nil
}