asasfans-api

module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2022 License: Apache-2.0

README

asasfans-goapi

asasfans api支持

项目主页

环境

  • golang 1.17+
  • mysql 8.0+

目录结构

├─builder # 构建目录
│  ├─asasapi
│  └─asasspider
├─cmd # 可执行文件
│  └─asasapi
├─config   # 配置文件
└─internal # 内部使用
   ├─app   # 具体应用
   │  └─asasapi 
   │      ├─apperrors
   │      ├─handler # http handler
   │      ├─help    # 助手函数
   │      ├─idl     # 资源定义
   │      ├─middlewares # 中间件
   │      ├─repository
   │      ├─router  # http router
   │      ├─service 
   │      ├─spider 
   │      └─util 工具库
   ├─launcher  # 基础启动器
   └─pkg   # 第三方依赖封装
      ├─bilibili
        ├─cache
        ├─config
        ├─database
        ├─httpclient
        ├─httpserver
        ├─log
        └─smsclient

开始

本地运行
# clone repository
git clone git@github.com:A-SoulFan/asasfans-api.git

# download go mod 
cd asasfans-api && go mod download
Docker builder
builder api server
# clone repository
git clone git@github.com:A-SoulFan/asasfans-api.git

cd asasfans-api

# docker builder
# 如果在 CN 进行 build 请自行将 Dockerfile 中注释的镜像源相关行开启
docker build --rm -t asasfans-api:latest -f builder/asasapi/Dockerfile .

# spider builder 可选的
docker build --rm -t asasfans-spider:latest -f builder/asasspider/Dockerfile .

# copy config file 并自行修改相关配置
cp config/config.template.yml config/asasapi.yml

# docker run
docker run \
  --detach \
  --name asasfans-api \
  --volume $PWD/config:/config \
  asasfans-api:latest

开发者规范

命名规范
  • 文件命名
    • 全小写
    • 尽可能短
    • 尽量避免使用 _,如果一定要分割,使用 _
  • 变量命名
    • 驼峰
  • 常量命名
    • 驼峰
开发流程

Fork & Pull Request 流程

  • fork repository
  • checkout develop -> feature
  • coding
  • pull request
  • review
  • merge
相关工具
  • apifox
    • 注册后联系管理者加组

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL