Ejemplo n.º 1
0
// Unmarshal a recordjar record into a player
func (p *Player) Unmarshal(d recordjar.Decoder) {
	p.account = d.String("account")
	p.password = d.String("password")
	p.salt = d.String("salt")
	p.created = d.Time("created")

	p.Mobile.Unmarshal(d)
}
Ejemplo n.º 2
0
// Unmarshal should decode the passed recordjar.Decoder into the current
// receiver. A unique ID should be allocated automatically.
func (t *Thing) Unmarshal(d recordjar.Decoder) {
	t.name = d.String("name")
	t.description = d.String(":data:")
	t.aliases = d.KeywordList("aliases")
	t.UID = <-uid.Next
}