Break core structs down into obj and leak packages

This commit is contained in:
2018-07-08 02:56:51 +01:00
parent 2fdb51166c
commit 6883984950
5 changed files with 21 additions and 16 deletions

21
obj/object.go Normal file
View File

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