influxdb/owner.go

20 lines
338 B
Go
Raw Normal View History

package platform
2018-07-24 21:11:59 +00:00
import "encoding/hex"
// 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
}