mirror of
https://github.com/jimeh/rbheap.git
synced 2026-02-19 04:46:40 +00:00
Break core structs down into obj and leak packages
This commit is contained in:
21
obj/object.go
Normal file
21
obj/object.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user