feat: add v3

This commit is contained in:
xxnuo
2025-11-02 22:11:48 +08:00
parent a7e564133d
commit 3e57e8ea3a
35 changed files with 40 additions and 3 deletions

1
.gitignore vendored
View File

@@ -13,3 +13,4 @@ core
/node_modules
/packages
pnpm-lock.yaml
/v3/bin

30
v3/Makefile Normal file
View File

@@ -0,0 +1,30 @@
.PHONY: download-core
# Detect OS and architecture
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
# Set binary suffix for Windows, js
ifeq ($(GOOS),windows)
SUFFIX := .exe
else ifeq ($(GOOS),js)
SUFFIX := .wasm
else
SUFFIX :=
endif
# GitHub release URL
GITHUB_REPO := xxnuo/MTranCore
RELEASE_TAG := latest
WORKER_BINARY := worker-$(GOOS)-$(GOARCH)$(SUFFIX)
DOWNLOAD_URL := https://github.com/$(GITHUB_REPO)/releases/latest/download/$(WORKER_BINARY)
# Download core binary from https://github.com/xxnuo/MTranCore/releases/latest
# Support: linux-amd64, linux-arm64, linux-386, windows-amd64, darwin-amd64, darwin-arm64
download-core:
@echo "Detecting platform: $(GOOS)-$(GOARCH)"
@echo "Downloading $(WORKER_BINARY) from $(DOWNLOAD_URL)..."
@mkdir -p bin
@curl -L -o bin/worker$(SUFFIX) $(DOWNLOAD_URL) || (echo "Failed to download worker binary" && exit 1)
@chmod +x bin/worker$(SUFFIX)
@echo "Downloaded successfully to bin/worker$(SUFFIX)"

View File

@@ -1,5 +1,3 @@
# Golang version
Server implementation is in this repository.
# MTranServer v3
Core implementation is in [MTranCore](https://github.com/xxnuo/MTranCore)

View File

@@ -0,0 +1,5 @@
package main
func main() {
}

3
v3/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module github.com/xxnuo/MTranServer/v3
go 1.25.3