Test Status Codecov Release Discord

English | 中文

介绍

GolangFlutter

下载

已支持平台

  • windows
  • macos
  • linux
  • android
  • ios
  • web
  • docker
xattr -d com.apple.quarantine /Applications/Gopeed.app

命令行工具

go install
go install github.com/monkeyWie/gopeed/cmd/gopeed

Docker

直接运行

docker run -d -p 9999:9999 -v /path/to/download:/download liwei2633/gopeed

使用 Docker Compose

version: '3'

services:
  gopeed:
    container_name: gopeed
    ports:
      - 9999:9999
    image: liwei2633/gopeed
    volumes:
      - ~/Downloads:/download
    restart: unless-stopped

输入以下指令启动容器:

docker-compose up -d

访问服务

http://localhost:9999
/download

界面展示

开发

flutterGolanghttpunix sockettcp
ui/flutter

环境要求

  1. Golang 1.19+
  2. Flutter 3.0+

克隆项目

git clone git@github.com:monkeyWie/gopeed.git

编译

桌面端

cgo

构建命令:

  • windows
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/monkeyWie/gopeed/bind/desktop
cd ui/flutter
flutter build windows
  • macos
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/macos/Frameworks/libgopeed.dylib github.com/monkeyWie/gopeed/bind/desktop
cd ui/flutter
flutter build macos
  • linux
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/monkeyWie/gopeed/bind/desktop
cd ui/flutter
flutter build linux

移动端

cgogomobile
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init

构建命令:

  • android
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg=com.gopeed github.com/monkeyWie/gopeed/bind/mobile
cd ui/flutter
flutter build apk

Web 端(推荐本地调试使用)

Web 端直接与后端 http 服务通讯,不需要额外准备环境。

构建命令:

cd ui/flutter
flutter build web
cd ../../
rm -rf cmd/web/dist
cp -r ui/flutter/build/web cmd/web/dist
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/monkeyWie/gopeed/cmd/web

开源许可

基于 GPLv3 协议开源。