This is a creation in Article, where the information may have evolved or changed.
Gogs Source Read Note 001
Gogs project is quite good, this note is actually based on Gogs fork version git-122a66f.
Gitea
(Gitea version origin) [https://blog.gitea.io/2016/12/welcome-to-gitea/]
Todo
- SOURCE structure
- Compile execution
- List of function sheets
- function corresponding to the source of the daytime
SOURCE structure
Gogs's source structure should follow the author's code specification for GO projects.
The following is the general project structure, according to different WEB framework habits, you can use parentheses in the text substitution, depending on the project type and requirements, you can freely delete some structures:
- templates (views) # 模板文件- public (static) # 静态文件 - css - fonts - img - js - routers (controllers) # 路由逻辑处理- models # 数据逻辑层- modules # 子模块 - setting # 应用配置存取- cmd # 命令行程序命令- conf # 默认配置 - locale # i18n 本地化文件- custom # 自定义配置- data # 应用生成数据文件- log # 应用生成日志文件
Compile execution
- Install Gogs from source
- Install Gitea from source
Refer to the compile command for Gitea or gogs:
TAGS="sqlite" make build
Or
go build -tags 'sqlite'
Postscript
Gogs supports multiple database backend: MySQL, Postgres, MSSQL, Sqlite3.
In order to facilitate the start-up and test, I chose Sqlite3, but because of Golang unfamiliar,
It's been a long time but I can't find the sqlite3 install option.
Actually, I have manually installed it, go-sqlite3 looked at the models_sqlite.go file, also set it up EnableSQLite3 = true .
In fact, the reason is on the head of this file // +build sqlite , you must specify tags when building.
Start
./gitea web
List of function sheets
Gitea is a github-like Git server, refer to the following introduction, it is more convenient to know what features Gitea support.
Gitea Introduction
- What is Gitea?
- Purpose
- Features