added WASM support

This commit is contained in:
2025-05-03 01:29:11 +01:00
parent ece1e63fda
commit 034f9e2896
56 changed files with 1293 additions and 10443 deletions

View File

@@ -1,3 +1,5 @@
//go:build cgo
package main
import "C"
@@ -16,23 +18,23 @@ import (
// --------------------------------- Container Control ----------------------------------------
//export StartContainer
func StartContainer(IP string) (output *C.char) {
container, err := abstractions.StartContainer(IP)
if err != nil {
return C.CString(err.Error())
}
return ConvertStructToJSONString(container)
}
//export RemoveContainer
func RemoveContainer(IP string, ID string) (output *C.char) {
err := abstractions.RemoveContainer(IP, ID)
if err != nil {
return C.CString(err.Error())
}
return C.CString("Success")
}
////export StartContainer
//func StartContainer(IP string) (output *C.char) {
// container, err := abstractions.StartContainer(IP)
// if err != nil {
// return C.CString(err.Error())
// }
// return ConvertStructToJSONString(container)
//}
//
////export RemoveContainer
//func RemoveContainer(IP string, ID string) (output *C.char) {
// err := abstractions.RemoveContainer(IP, ID)
// if err != nil {
// return C.CString(err.Error())
// }
// return C.CString("Success")
//}
// --------------------------------- Plugin Control ----------------------------------------