# iris-server **Repository Path**: eric-mao/iris-server ## Basic Information - **Project Name**: iris-server - **Description**: 因为习惯 koa2的使用方式,同时也习惯spring-boot的开发风格,所以决定尽可能的满足这样的需求。 服务基于iris封装 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-29 - **Last Updated**: 2022-05-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: Go语言 ## README # iris-server #### 介绍 因为习惯 koa2的使用方式,同时也习惯spring-boot的开发风格,所以决定尽可能的满足这样的需求。 服务基于iris封装 --- #### 软件架构 软件架构说明 #### 安装教程 1. go mod tidy 2. xxxx 3. xxxx --- #### 构建镜像 ``` ruby ## 下载项目 git clone https://gitee.com/eric-mao/iris-server.git ## 初始化model下载依赖 go mod tidy ## 打包应用程序 go build ## 构建镜像 docker build -t iris-server:0.1.0 . ## docker测试 docker run --rm -it -p 8080:8080 iris-server:0.1.0 ## docker-compose测试 docker-compose up -d ``` --- ##### 清理 go modules 缓存 ``` ruby go clean --modcache ``` ##### 框架初始化 ``` ruby go get github.com/kataras/iris/v12@v12.1.8 ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request --- --- --- #### 常见问题 - **xorm 如果返回结构体中内嵌对象** ``` go type ExampleRes struct { // 在实体后面加上 `xorm:"extends"` 注解,xorm框架会自动装配 po.Example `xorm:"extends"` } ``` --- --- --- ##### docker-compose.yaml ``` yaml version: '3.1' services: iris-server: image: iris-server:0.1.0 container_name: iris-server restart: always ports: - 8000:8000 environment: # 配置数据库 DB_HOST: '172.16.15.6' DB_PORT: '3306' DB_USER: 'root' DB_PASSWORD: 'youpasswd' DB_NAME: 'cloud_dev_tools' ``` --- --- ---