mirror of
https://github.com/Luzifer/sii.git
synced 2024-12-21 00:21:15 +00:00
Add RawValue
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
a9607ba090
commit
c3612d8a19
1 changed files with 15 additions and 0 deletions
15
datatypes.go
15
datatypes.go
|
@ -105,3 +105,18 @@ func (p *Ptr) UnmarshalSII(in []byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// resource_tie => native type string
|
// resource_tie => native type string
|
||||||
|
|
||||||
|
// RawValue is used in places where a key can has multiple types and
|
||||||
|
// clean parsing into Go types is no longer possible. Sadly even parsing
|
||||||
|
// into interface{} is not possible as even for that the type of the value
|
||||||
|
// must be known
|
||||||
|
type RawValue []byte
|
||||||
|
|
||||||
|
func (r RawValue) MarshalSII() ([]byte, error) { return r, nil }
|
||||||
|
|
||||||
|
func (r *RawValue) UnmarshalSII(in []byte) error {
|
||||||
|
*r = in
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Add converter functions from / to RawValue
|
||||||
|
|
Loading…
Reference in a new issue