mock mode: database queries implemented and checkbox on account page built
This commit is contained in:
@@ -21,6 +21,10 @@ func Int64(dst *int64) encoding.TextUnmarshaler {
|
||||
return (*int64Text)(dst)
|
||||
}
|
||||
|
||||
func Bool(dst *bool) encoding.TextUnmarshaler {
|
||||
return (*boolText)(dst)
|
||||
}
|
||||
|
||||
func Platform(dst *accounts.Platform) encoding.TextUnmarshaler {
|
||||
return (*platformText)(dst)
|
||||
}
|
||||
@@ -29,6 +33,7 @@ type (
|
||||
rawText string
|
||||
intText int
|
||||
int64Text int64
|
||||
boolText bool
|
||||
platformText accounts.Platform
|
||||
)
|
||||
|
||||
@@ -55,6 +60,15 @@ func (n *int64Text) UnmarshalText(text []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *boolText) UnmarshalText(text []byte) error {
|
||||
v, err := strconv.ParseBool(string(text))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*b = boolText(v)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *platformText) UnmarshalText(text []byte) error {
|
||||
v, err := accounts.NewPlatform(string(text))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user