Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lookup ¶
Example ¶
package main import ( "fmt" "github.com/adamluzsi/frameless/ports/crud/extid" ) type Entity struct { ID string `ext:"id"` } func main() { ent := Entity{} _, ok := extid.Lookup[string](ent) fmt.Println(`found:`, ok) // false ent.ID = `42` id, ok := extid.Lookup[string](ent) fmt.Println(`found:`, ok) // true fmt.Println(`id value:`, id) // "42" }
Output:
func RegisterType ¶ added in v0.127.0
func Set ¶
Example ¶
package main import ( "fmt" "github.com/adamluzsi/frameless/ports/crud/extid" ) type Entity struct { ID string `ext:"id"` } func main() { ent := Entity{} id := "id-value" if err := extid.Set(&ent, id); err != nil { panic(err) } fmt.Println(`ent.ID == id:`, ent.ID == id) // true }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.