Giter VIP home page Giter VIP logo

beedoc's Introduction

This project is the source for http://beego.vip/docs

If you are using beego v1.x, please change to v1.x tag.

More examples

How to contribute?

Fork, update and submit a pull request. No matter how big or small, your contributions to this project are welcome!

How does it work?

A beego Web server checks for updates to this repository (https://github.com/beego/beedoc) and updates the main documentation automatically.

Note

beego documentation is written using standard markdown syntax (https://guides.github.com/features/mastering-markdown/). Please submit your changes using the same syntax.

Community

Welcome to join us in Slack: https://beego.slack.com, you can get invited here

License

Apache License, Version 2.0.

beedoc's People

Contributors

adamwuyu avatar alphawong avatar astaxie avatar auula avatar codysnider avatar cr7pt0gr4ph7 avatar defp avatar dennismao avatar flycash avatar genedna avatar hvnsweeting avatar ihippik avatar jessonchan avatar jimmy99 avatar jrs100000 avatar lei-cao avatar markstory avatar miraclesu avatar mmirolim avatar mychaelgo avatar onlyloveoleg avatar rossrogers avatar semihtok avatar sergeylanzman avatar shinriyo avatar shutup avatar slene avatar unknwon avatar weirubo avatar zhangshengshan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beedoc's Issues

GOPATH 没设置

执行
go get github.com/beego/bee
go get github.com/astaxie/beego
报错
package github.com/beego/bee: cannot download, $GOPATH not set. For more details see: go help gopath
怎么设置GOPATH?

build output "docs" already exists and is a directory

按照官方命令 运行
第一开启应用内文档开关,在配置文件中设置:EnableDocs = true,
第二步就是使用bee generate docs生成docs文件,
然后在你的main.go函数中引入_ "beeapi/docs"。
这样你就已经内置了docs在你的API应用中,然后你就使用bee run watchall true,让我们的API应用跑起来,同时第四个参数true表示每次自动化的build文档,
现在我们就要看我们的API文档了,你可以打开另一个命令窗口执行bee run docs -isDownload=true然后就会自动的下载swagger文档查看器,同时运行在了8089端口,你也可以使用bee run docs -docport=8888修改相应地端口。

运行 bee run docs -isDownload=true
报错如下:

2015/11/16 18:18:50 [INFO] Uses 'docs' as 'appname'
2015/11/16 18:18:50 [INFO] Initializing watcher...
2015/11/16 18:18:50 [TRAC] Directory(/Users/xRain/Documents/GoLang/Projects/src/api.simcu.com/controllers)
2015/11/16 18:18:50 [TRAC] Directory(/Users/xRain/Documents/GoLang/Projects/src/api.simcu.com)
2015/11/16 18:18:50 [TRAC] Directory(/Users/xRain/Documents/GoLang/Projects/src/api.simcu.com/models)
2015/11/16 18:18:50 [TRAC] Directory(/Users/xRain/Documents/GoLang/Projects/src/api.simcu.com/routers)
2015/11/16 18:18:50 [TRAC] Directory(/Users/xRain/Documents/GoLang/Projects/src/api.simcu.com/tests)
2015/11/16 18:18:50 [INFO] Start building...
go install api.simcu.com: build output "docs" already exists and is a directory
2015/11/16 18:18:51 [ERRO] ============== Build failed ===================

Slack (or something like that) chat for maintainers beedoc/beego

Hey @astaxie!

I think it's need for all of us. Chat it's pretty good solution for fast checking proposals and solutions. We'll are able to have discussion about translates, new doc pages, new modules and instruments and other things.

What you think about some fast and living communication?
Thanks.

Reflect changes in different languages

Beego is certainly a major Go project and it now support doc translation in 3 languages, but I see some problem the way the documentation is managed/produced.

For instance, this PR #152 some changes need to be applied to other languages and if the PR author is not comfortable with the other languages it might be hard or even impossible for him/her to reflect those changes.

So looking at the best documentation tool out there, Sphinx, they seems to handle this by using Gettext (http://sphinx-doc.org/latest/intl.html)and also provide bidding with Transifex, maybe it would be a nicer path to follow. We will need to choose one root language that is the most understandable by everyone and manage the translation with Gettext.

I hope we can debate the best approach here, Beego is originate in China where I would image make English harder to approach and this might put Beego in difficult spot to try to reach others community (Europe, US, etc...).

For what it's worth, I'm a Belgian, leaving in Spain, and I'm writing in English... and I would love one day to learn Chinese :)

So the question is how to bring sanity here and try to stay DRY at the same time? How to ensure update in one language of the documentation will reflect everywhere? To my opinion we need to centralize the doc on a Root language.

Docs messed up in chrome

Not sure exactly why this is happening, but certain docs get messed up in chrome. Seconds after load they swap to a sort of unformatted text

screen shot 2016-01-16 at 8 13 56 pm

validation模块的Match发现一个BUG

场景过滤字符串第4、5位不等于00、01、03、07、05、11的值:
010004374018931 正则表达式:

/^010(00|01|02|03|05|07|11)(\\d){10}/

使用regexp可以过滤成功

regexp.MatchString("/^010(00|01|02|03|05|07|11)(\\d){10}/", "010004374018931") 返回false

使用validation就无效同时长度判断也无效

type params struct {
    Imsi  string `valid:"Match(/^010(00|01|02|03|05|07|11)(\\d){10}/)"`
    Token string `valid:"Required"`
}

参数配置那一章里有一个小错误?

EnableHTTPS

是否启用 HTTPS,默认是 false 关闭。当需要启用时,先设置 EnableHTTPListen = false,并设置HTTPSCertFile 和 HTTPSKeyFile

beego.BConfig.Listen.EnableHTTPS = false

其中EnableHTTPListen应为EnableHTTP

Dealing with multiple `init()`

How do you deal with multiple init functions to register a model?

In the example here, you take the example of model.go and main.go there is a problem.
Indeed, the init() function of the main.go is called before model.go.

So if I call orm.RunCommand() in the init(), we can see that the models are not registered.

orthographical variants of Beego

您好

There are orthographical variants of Beego in the documents.
Beego or beego. (capital B or not)
Which is correct?

謝謝

关于beego的log库

最近才使用log库,发现在windows操作系统系下有问题,
logger.SetLogger("file", {"filename":"+filename+" , "maxdays":+strconv.Itoa(maxdays)+})
这里的filename 在windows 下,文件不会自动创建,而且有目录的情况,好像也创建不成功

不知道这块在windows下要怎么去做?

Confusion on accessing config variables

In the beego docs I see two ways of accessing Config variables but only former works later not working. Am I missing anything?

For example:

  1. According to http://beego.me/docs/mvc/controller/config.md

SessionProvider variable should be accessed like

beego.BConfig.WebConfig.Session.SessionProvider = "file"

  1. But according to http://beego.me/docs/mvc/controller/session.md

SessionProvider variable can be accessed like

beego.SessionProvider = "file"

However 2. is nor working. It Says beego.SessionProvider undefined

Can you guys help me understand what is happening?

Thanks in advance.

Russian translate for left sidebar menu on beego.me

Hi @astaxie, how we can translate left menu on beego.me website? Thanks.

For example:
Beego introduction -> Введение в Beego
Contributing -> Разработка Beego
Release Notes -> Список изменений
Upgrade Guide -> Инструкция по обновлению

Install / Upgrade -> Установка / Обновление
Bee tool usage -> Использование инструмента Bee (or: Инструмент Bee)

Quickstart -> Быстрый старт
Create new project -> Создать новый проект (or: Новый проект)
Routing setting -> Настройки роутинга
Controller -> Контроллер
Models -> Модели
View -> Представление
Static files -> Файлы статики
Modules -> Модули

In this section i have two proposal: first variant it's translate to natural language, but i think second proposal looks like most preference because Session, Cache and others it's modules names and i think not right to translate it:

Session Module -> Модуль сессий (or: Модуль Session)
Cache Module -> Модуль кэша (or: Модуль Cache)
Logs Module -> Модуль логов (or: Модуль Logs)
Httplib Module -> Модуль Httplib
Context Module -> Модуль контекста (or: Модуль Context)
Toolbox Module -> Модуль Toolbox
Config Module -> Модуль конфигурации (or: Модуль Config)
i18n Module -> Модуль переводов (or: Модуль i18n)

Advanced Beego -> Продвинутый Beego
Live Monitor -> Live-монитор
Automated API Document -> Автоматическая документация для API

Deployment -> Процесс релиза
Stand alone Deploy -> Релиз самостоятельного приложения
Deploy with Supervisord -> Релиз с Supervisord
Deploy with nginx -> Релиз с nginx
Deploy with Apache -> Релиз с apache

Middleware contribution -> (I've skip it, because i don't know how translate it right. I'll provide something about this menu item some later)

Demos -> Демки
Chat Room -> Чат
URL Shortener -> Сокращатель ссылок
Todo List -> Список задач
FAQ -> FAQ (it's normal)

dORM的问题

在多对多查询的说明中,dORM表示的什么啊?
NewORMWithDB?

关于ReadOrCreate返回值err的问题

ReadOrCreate
尝试从数据库读取,不存在的话就创建一个

默认必须传入一个参数作为条件字段,同时也支持多个参数多个条件字段

o := orm.NewOrm()
user := User{Name: "slene"}
// 三个返回参数依次为:是否新创建的,对象Id值,错误
if created, id, err := o.ReadOrCreate(&user, "Name"); err != nil {
    if created {
        fmt.Println("New Insert an object. Id:", id)
    } else {
        fmt.Println("Get an object. Id:", id)
    }
}

这段代码里面的

if created, id, err := o.ReadOrCreate(&user, "Name"); err != nil {

应该是

if created, id, err := o.ReadOrCreate(&user, "Name"); err == nil {

吧?

Environment variables such as BEEGO_RUNMODE

Would be nice if these were documented in Configuration section. Reason I'm not submitting a pull request is I don't know what other , if any, environment variables that beego relies on.

QuerySeter 是否拼写错误?

QuerySeter 如果我理解没有错误的话,意思为查询设置器,英语中设置器/获取器应该是 setter/getter,而不能是 seter/geter,因此我感觉应该改成 QuerySetter 比较好。否则用这个结构时,总是感觉拼写错误,不知我的建议对不对?

typo

in http://beego.me/docs/install/bee.md section version:

这个命令是动态获取bee、beego和Go的版本,这样一旦用户出现错误,可以通过改命令来查看当前的...

should be

这个命令是动态获取bee、beego和Go的版本,这样一旦用户出现错误,可以通过---该---命令来查看当前的...

orm: In single quotation marks can not use placeholder('?')

My code is:
sql := "SELECT * FROM member WHERE tenant_id = ? AND (name LIKE '%?%' OR abbr LIKE '%|?%')"
_, err = o.Raw(sql, tid, q, q).QueryRows(&ml)
and beego told me:
statement expects 1 inputs; got 3
so, In single quotation marks did not identify the placeholder ('?')

namespace+Include

你好

In the "advantage/docs.md" document.
What is "namespace+Include"?
Is it typo or not?
Could you tell me does it mean?

beego http最大连接数配置

类似Tomcat的线程池大小配置,beego里有协程数量的配置吗,代码里边只是看到启动多核并行处理。

Api项目运行测试无法生成路由

我在运行API项目测试的时候发现我更改了路由信息(比如controller里增加了一个方法)如果不先运行一下bee run直接就运行测试的话会报404。
并且,API项目会在测试目录下生成routers目录,里面包含的是最新的路径信息,但是测试在实际运行过程中使用的应该还是项目根目录下routers中的数据,而根目录下的routers中commentsRouter_*文件在不运行bee run的情况下直接运行go test是不会更新。

关于自动化创建API的问题

抱歉,问一个问题:在自动创建API后,又增加了些表,该怎么生成新创建的表的一些model,controller,自动注册commentsRouters呢?

提一个小小的建议,beego.AutoRouter 是否可以优化下下

beego.Router("/admin/category", &admin.CategoryController{})
beego.AutoRouter(&admin.CategoryController{})

我的本意是 CategoryController 匹配 /admin/category ,
其他的方法 匹配 /admin/category/add ,/admin/category/del 等等。现在的情况是
其他的方法匹配的是 /category/add,/category/del
尝试过注解,但是感觉略微麻烦,时候可以把 beego.AutoRouter(&admin.CategoryController{}) 该写成

beego.AutoRouter("/admin/"&admin.CategoryController{}) 或者其他更方便的方式

建议开发文档里面的方法描述增加标题点击后跳转到源码查看页面

建议开发文档里面的方法描述增加标题点击后跳转到源码查看页面,具体如:

Prepare() 查看

这个函数主要是为了用户扩展用的,这个函数会在下面定义的这些 Method 方法之前执行,用户可以重写这个函数实现类似用户验证之类。

或者:
Prepare()

这个函数主要是为了用户扩展用的,这个函数会在下面定义的这些 Method 方法之前执行,用户可以重写这个函数实现类似用户验证之类。

unknown bee test command

lizh@FX-JSJ522 MINGW64 /e/git/code/go/src/goapi/tests (test)
$ bee version
bee :1.4.1
beego :1.6.0
Go :go version go1.5rc1 windows/amd64

lizh@FX-JSJ522 MINGW64 /e/git/code/go/src/goapi/tests (test)
$ bee test goapi
bee: unknown subcommand "test"
Run 'bee help' for usage.

执行bee generate docs 时报错

创建api应用后,执行bee generate docs 提示
[ERRO] the model models.modelName parser.ParseDir error,请问是什么原因?

已解决,,数据库字段名称中使用了"-"(中划线)

Sqlite3 时区设置

文档 时区设置 中
注意: 鉴于 Sqlite3 的设计,存取默认都为 UTC 时间


建议增加多一个属性可以让开发者自行进行设置 读取时候的值转为本地时区。

使用namespace后,controller 里面就不能使用函数了

package controllers

import (
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
)

type MainController struct {
beego.Controller
}

func (this *MainController) Get() {

}
func a(ctx *context.Context) {

}

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x5a7d2]

goroutine 16 [running]:
runtime.panic(0x5022a0, 0x84f544)
/usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
github.com/astaxie/beego.parserPkg(0xc2080a9080, 0x2c, 0x5dfbf0, 0x13, 0x0, 0x0)
/Users/dongjian/DJGO/src/github.com/astaxie/beego/parser.go:69 +0x612
github.com/astaxie/beego.(_ControllerRegistor).Include(0xc20809a060, 0xc208001ba0, 0x1, 0x1)
/Users/dongjian/DJGO/src/github.com/astaxie/beego/router.go:193 +0x5a3
github.com/astaxie/beego.(_Namespace).Include(0xc20809a080, 0xc208001ba0, 0x1, 0x1, 0x0)
/Users/dongjian/DJGO/src/github.com/astaxie/beego/namespace.go:182 +0x49
github.com/astaxie/beego.func·008(0xc20809a080)
/Users/dongjian/DJGO/src/github.com/astaxie/beego/namespace.go:299 +0x39
github.com/astaxie/beego.NewNamespace(0x565f30, 0x5, 0xc208030090, 0x1, 0x1, 0x4eb220)
/Users/dongjian/DJGO/src/github.com/astaxie/beego/namespace.go:38 +0x114
github.com/astaxie/beego.func·020(0xc20809a040)
/Users/dongjian/DJGO/src/github.com/astaxie/beego/namespace.go:383 +0x42
github.com/astaxie/beego.NewNamespace(0x565ff0, 0x3, 0x991ed8, 0x1, 0x1, 0xc20809a000)
/Users/dongjian/DJGO/src/github.com/astaxie/beego/namespace.go:38 +0x114
tianyin/routers.init·2()
/Users/dongjian/DJGO/src/tianyin/routers/router.go:21 +0x249
tianyin/routers.init()
/Users/dongjian/DJGO/src/tianyin/routers/router.go:23 +0x55
main.init()
/Users/dongjian/DJGO/src/tianyin/main.go:38 +0x46

goroutine 19 [finalizer wait]:
runtime.park(0x14ec0, 0x8559b0, 0x853c49)
/usr/local/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x8559b0, 0x853c49)
/usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
/usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1445

goroutine 20 [chan receive]:
github.com/astaxie/beego/logs.(*BeeLogger).startLogger(0xc208023bf0)
/Users/dongjian/DJGO/src/github.com/astaxie/beego/logs/log.go:158 +0x6d
created by github.com/astaxie/beego/logs.NewLogger
/Users/dongjian/DJGO/src/github.com/astaxie/beego/logs/log.go:80 +0x92
14-07-18 10:15:22 [SKIP] "/Users/dongjian/DJGO/src/tianyin/routers/router.go": MODIFY|ATTRIB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.