func (resp *Response) Update() (data []byte, err error) {
	if resp.DataType != rt.PT_WorkData &&
		resp.DataType != rt.PT_WorkWarning {
		err = ErrDataType
		return
	}
	data = resp.Data
	if resp.DataType == rt.PT_WorkWarning {
		err = ErrWorkWarning
	}
	return
}
Extract the job's update
package client
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"strconv"
	rt "github.com/appscode/g2/pkg/runtime"
)
type ResponseHandler func(*Response)
type Response struct {
	DataType  rt.PT
	Data, UID []byte
	Handle    string
}
func (resp *Response) Result() (data []byte, err error) {
	switch resp.DataType {
	case rt.PT_WorkFail:
		resp.Handle = string(resp.Data)
		err = ErrWorkFail
		return
	case rt.PT_WorkException:
		err = ErrWorkException
		fallthrough
	case rt.PT_WorkComplete:
		data = resp.Data
	default:
		err = ErrDataType
	}
	return
}