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