// FileGet gets file from file store by id
//export FileGet
FileGet gets file from file store by id
export FileGet
// FileGet gets file from file store by id // export FileGet
func FileGet(e *C.char) *C.char {
	type fileGet struct {
		ID string `json:"id"`
	}
	es := C.GoString(e)
	var f fileGet
	if err := json.NewDecoder(bytes.NewBufferString(es)).Decode(&f); err != nil {
		return nil
	}
	_, file := fs.Get(f.ID)
	if file == nil {
		return nil
	}
	r, err := envexec.FileToReader(file)
	if err != nil {
		return nil
	}
	if f, ok := r.(*os.File); ok {
		defer f.Close()
	}
	c, err := io.ReadAll(r)
	if err != nil {
		return nil
	}
	return C.CString(string(c))
}
func FileGet ( e * C . char ) * C . char { type fileGet struct { ID string `json:"id"` } es := C . GoString ( e ) var f fileGet if err := json . NewDecoder ( bytes . NewBufferString ( es ) ) . Decode ( & f ) ; err != nil { return nil } _ , file := fs . Get ( f . ID ) if file == nil { return nil } r , err := envexec . FileToReader ( file ) if err != nil { return nil } if f , ok := r . ( * os . File ) ; ok { defer f . Close ( ) } c , err := io . ReadAll ( r ) if err != nil { return nil } return C . CString ( string ( c ) ) }
FileGet gets file from file store by id
export FileGet
FileGet gets file from file store by id export FileGet