Initial work to get full output format working

This commit is contained in:
2018-07-07 22:22:57 +01:00
parent d45170a933
commit d3e8f08f54
6 changed files with 124 additions and 39 deletions

21
object.go Normal file
View File

@@ -0,0 +1,21 @@
package main
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
}