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"
|
"crypto/rand"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"reflect"
|
||||||
"time"
|
"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 {
|
func (r *Runtime) MarshalOnePayload(w io.Writer, model interface{}) error {
|
||||||
return r.instrumentCall(MarshalStart, MarshalStop, func() error {
|
return r.instrumentCall(MarshalStart, MarshalStop, func() error {
|
||||||
return MarshalOnePayload(w, model)
|
return MarshalOnePayload(w, model)
|
||||||
|
|
Loading…
Reference in New Issue