mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 15:49:49 +00:00
23 lines
419 B
Go
23 lines
419 B
Go
package libgopeed
|
|
|
|
// #cgo LDFLAGS: -static-libstdc++
|
|
import "C"
|
|
import (
|
|
"encoding/json"
|
|
"github.com/GopeedLab/gopeed/pkg/rest"
|
|
"github.com/GopeedLab/gopeed/pkg/rest/model"
|
|
)
|
|
|
|
func Start(cfg string) (int, error) {
|
|
var config model.StartConfig
|
|
if err := json.Unmarshal([]byte(cfg), &config); err != nil {
|
|
return 0, err
|
|
}
|
|
config.ProductionMode = true
|
|
return rest.Start(&config)
|
|
}
|
|
|
|
func Stop() {
|
|
rest.Stop()
|
|
}
|