mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-09 21:49:39 -05:00
db: add sqlite "source of truth" schema
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
committed by
Kristoffer Dalby
parent
855c48aec2
commit
c6736dd6d6
@@ -70,13 +70,14 @@ func (TextSerialiser) Scan(ctx context.Context, field *schema.Field, dst reflect
|
||||
} else {
|
||||
dstField.Set(fieldValue.Elem())
|
||||
}
|
||||
|
||||
return nil
|
||||
} else {
|
||||
return fmt.Errorf("unsupported type: %T", fieldValue.Interface())
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
return err
|
||||
}
|
||||
|
||||
func (TextSerialiser) Value(ctx context.Context, field *schema.Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) {
|
||||
@@ -92,6 +93,7 @@ func (TextSerialiser) Value(ctx context.Context, field *schema.Field, dst reflec
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return string(b), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("only encoding.TextMarshaler is supported, got %t", v)
|
||||
|
||||
Reference in New Issue
Block a user