Lots of work
This commit is contained in:
parent
a2a937791d
commit
3086b0e9b4
28 changed files with 1284 additions and 2 deletions
30
storage/userIdentType.go
Normal file
30
storage/userIdentType.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
package storage
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
)
|
||||
|
||||
type Being string
|
||||
|
||||
const (
|
||||
BEING_HUMAN = Being("human")
|
||||
BEING_CAT = Being("cat")
|
||||
BEING_FOX = Being("fox")
|
||||
BEING_DOG = Being("dog")
|
||||
BEING_ROBOT = Being("robot")
|
||||
BEING_DOLL = Being("doll")
|
||||
)
|
||||
|
||||
func (r *Being) Value() (driver.Value, error) {
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (r *Being) Scan(raw any) error {
|
||||
if v, ok := raw.(string); ok {
|
||||
*r = Being(v)
|
||||
return nil
|
||||
} else {
|
||||
return errors.New("value not a string")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue