// Exec runs command inside container runner
//export Exec
Exec runs command inside container runner
export Exec
// Exec runs command inside container runner // export Exec
func Exec(e *C.char) *C.char {
	es := C.GoString(e)
	var req model.Request
	if err := json.NewDecoder(bytes.NewBufferString(es)).Decode(&req); err != nil {
		return nil
	}
	r, err := model.ConvertRequest(&req, srcPrefix)
	if err != nil {
		return nil
	}
	rtCh, _ := work.Submit(context.TODO(), r)
	rt := <-rtCh
	ret, err := model.ConvertResponse(rt, true)
	if err != nil {
		return nil
	}
	defer ret.Close()
	var buf bytes.Buffer
	if err := json.NewEncoder(&buf).Encode(ret); err != nil {
		return nil
	}
	return C.CString(buf.String())
}
func Exec ( e * C . char ) * C . char { es := C . GoString ( e ) var req model . Request if err := json . NewDecoder ( bytes . NewBufferString ( es ) ) . Decode ( & req ) ; err != nil { return nil } r , err := model . ConvertRequest ( & req , srcPrefix ) if err != nil { return nil } rtCh , _ := work . Submit ( context . TODO ( ) , r ) rt := <- rtCh ret , err := model . ConvertResponse ( rt , true ) if err != nil { return nil } defer ret . Close ( ) var buf bytes . Buffer if err := json . NewEncoder ( & buf ) . Encode ( ret ) ; err != nil { return nil } return C . CString ( buf . String ( ) ) }
Exec runs command inside container runner
export Exec
Exec runs command inside container runner export Exec