This commit is contained in:
jack77213 2020-02-28 09:22:31 +08:00
parent aeff6a1d2a
commit df836ae0c9
Signed by: jack77213
GPG Key ID: CA81AA7BB873B9F1
1 changed files with 4 additions and 15 deletions

View File

@ -16,14 +16,12 @@ package main
import "C"
import (
"os"
"flag"
"fmt"
"log"
"net/http"
"strings"
"unsafe"
"net/http"
"encoding/json"
"io/ioutil"
)
var cb C.callbackProc
@ -50,17 +48,8 @@ func RVExtensionVersion(output *C.char, outputsize C.size_t) {
C.strncpy(output, version, size)
// Load config
const configPath string = "~/.a3web.conf"
type Config struct {
serverURL string `json:"serverURL"`
}
var config Config
if _, err := os.Stat(configPath); err == nil {
configFile, _ := ioutil.ReadFile(configPath)
json.Unmarshal(configFile, &config)
serverURL = config.serverURL
}
flag.StringVar(&serverURL, "-a3webserver", "http://localhost:5000", "a string")
flag.Parse()
}
// RVExtensionArgs STRING callExtension ARRAY