Gogs Source Read Note 001

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.