2018-07-18 22:33:53 +00:00
|
|
|
package platform
|
|
|
|
|
2018-07-24 21:11:59 +00:00
|
|
|
import "encoding/hex"
|
|
|
|
|
2018-07-18 22:33:53 +00:00
|
|
|
// Owner represents a resource owner
|
|
|
|
type Owner struct {
|
|
|
|
ID ID
|
|
|
|
}
|
2018-07-24 21:11:59 +00:00
|
|
|
|
|
|
|
// Decode parses b as a hex-encoded byte-slice-string.
|
|
|
|
func (o *Owner) Decode(b []byte) error {
|
|
|
|
dst := make([]byte, hex.DecodedLen(len(b)))
|
|
|
|
_, err := hex.Decode(dst, b)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
o.ID = dst
|
|
|
|
return nil
|
|
|
|
}
|