Add method passthrough to runtime

This commit is contained in:
Sam Woodard 2016-05-25 09:14:49 -07:00
parent a337a3bc9f
commit 5005a0cfae
1 changed files with 10 additions and 0 deletions

View File

@ -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)