mirror of
https://github.com/jimeh/rbheap.git
synced 2026-02-19 04:46:40 +00:00
22 lines
362 B
Go
22 lines
362 B
Go
package obj
|
|
|
|
import "encoding/json"
|
|
|
|
//go:generate easyjson -all object.go
|
|
|
|
func NewObject(inputJSON []byte) (*Object, error) {
|
|
var obj Object
|
|
err := json.Unmarshal(inputJSON, &obj)
|
|
|
|
return &obj, err
|
|
}
|
|
|
|
type Object struct {
|
|
Address string `json:"address"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
func (s *Object) Index() string {
|
|
return s.Address + ":" + s.Type
|
|
}
|