forked from Mirrors/jsonapi
Add method passthrough to runtime
This commit is contained in:
parent
a337a3bc9f
commit
5005a0cfae
10
runtime.go
10
runtime.go
|
@ -4,6 +4,7 @@ import (
|
|||
"crypto/rand"
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -50,6 +51,15 @@ func (r *Runtime) UnmarshalPayload(reader io.Reader, model interface{}) error {
|
|||
})
|
||||
}
|
||||
|
||||
func (r *Runtime) UnmarshalManyPayload(reader io.Reader, kind reflect.Type) (elems []interface{}, err error) {
|
||||
r.instrumentCall(UnmarshalStart, UnmarshalStop, func() error {
|
||||
elems, err = UnmarshalManyPayload(reader, kind)
|
||||
return err
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (r *Runtime) MarshalOnePayload(w io.Writer, model interface{}) error {
|
||||
return r.instrumentCall(MarshalStart, MarshalStop, func() error {
|
||||
return MarshalOnePayload(w, model)
|
||||
|
|
Loading…
Reference in New Issue