Skip to content

Commit

Permalink
Merge pull request #947 from flycash/master
Browse files Browse the repository at this point in the history
replace beego.me with beego.vip
  • Loading branch information
flycash authored Nov 29, 2021
2 parents 290b518 + ea2a30e commit 1bd108f
Show file tree
Hide file tree
Showing 44 changed files with 167 additions and 167 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

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

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

Expand Down
12 changes: 6 additions & 6 deletions en-US/intro/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ New Features:
6. `UrlFor` support all type of the parameters
7. controller `GetInt/GetString` function support default value, like: `GetInt("a",12)`
8. add `CompareNot/NotNil` template function
9. support Controller defeine error,[controller Error](http://beego.me/docs/mvc/controller/errors.md#controller%E5%AE%9A%E4%B9%89error)
9. support Controller defeine error,[controller Error](http://beego.vip/docs/mvc/controller/errors.md#controller%E5%AE%9A%E4%B9%89error)
10. `ParseForm` support slices of ints and strings
11. improve ORM interface

Expand Down Expand Up @@ -490,7 +490,7 @@ bugfix:
1. Router *.* can't be parsed

# Beego 1.3.0
Hi guys! After the hard working for one month, we are so excited to release Beego 1.3.0. We brought many useful features. [Upgrade notes](http://beego.me/docs/intro/upgrade.md)
Hi guys! After the hard working for one month, we are so excited to release Beego 1.3.0. We brought many useful features. [Upgrade notes](http://beego.vip/docs/intro/upgrade.md)

#### The brand new router system
We rewrote the router system to tree router. It improved the performance significantly and supported more formats.
Expand Down Expand Up @@ -525,7 +525,7 @@ beego.NewNamespace("/v1",
),
)
```
For more information please check [namespace](http://beego.me/docs/mvc/controller/router.md#namespace)
For more information please check [namespace](http://beego.vip/docs/mvc/controller/router.md#namespace)

#### Annotation Router
```
Expand All @@ -548,7 +548,7 @@ func (this *CMSController) StaticBlock() {
func (this *CMSController) AllBlock() {
}
```
[Annotation Router](http://beego.me/docs/mvc/controller/router.md#annotations)
[Annotation Router](http://beego.vip/docs/mvc/controller/router.md#annotations)

#### Automated API Document
Automated document is a very cool feature that I wish to have. Now it became real in Beego. As I said Beego will not only boost the development of API but also make the API easy to use for the user.
Expand All @@ -560,7 +560,7 @@ The API document can be generated by annotations automatically and can be tested

![](../images/doc_test.png)

For more information please check [Automated Document](http://beego.me/docs/advantage/docs.md)
For more information please check [Automated Document](http://beego.vip/docs/advantage/docs.md)

#### config supports different Runmode

Expand Down Expand Up @@ -739,7 +739,7 @@ ctx.Input.Bind(&user, "user") //user =={Name:"astaxie"}
#### 8.httplib supports file upload interface

```
b:=httplib.Post("http://beego.me/")
b:=httplib.Post("http://beego.vip/")
b.Param("username","astaxie")
b.Param("password","123456")
b.PostFile("uploadfile1", "httplib.pdf")
Expand Down
2 changes: 1 addition & 1 deletion en-US/module/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ admin.AddHealthCheck("database",&DatabaseCheck{})

After this you can send get request to `/healthcheck`:

$ curl http://beego.me:8088/healthcheck
$ curl http://beego.vip:8088/healthcheck
* deadlocks: OK
* database: OK

Expand Down
8 changes: 4 additions & 4 deletions en-US/module/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ The Input object is the encapsulation of request. Here are the implemented metho

- Url

The URL of request. E.g.: `http://beego.me/about?username=astaxie`
The URL of request. E.g.: `http://beego.vip/about?username=astaxie`

- Site

The combination of scheme and domain. E.g.: `http://beego.me`
The combination of scheme and domain. E.g.: `http://beego.vip`

- Scheme

The request scheme. E.g.: `http`, `https`

- Domain

The request domain. E.g.: `beego.me`
The request domain. E.g.: `beego.vip`

- Host

Expand Down Expand Up @@ -88,7 +88,7 @@ The Input object is the encapsulation of request. Here are the implemented metho

- SubDomains

Return the sub domains of the request. For example, request domain is `blog.beego.me`, then this function returns `blog`.
Return the sub domains of the request. For example, request domain is `blog.beego.vip`, then this function returns `blog`.

- Port

Expand Down
24 changes: 12 additions & 12 deletions en-US/module/httplib.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Import package:

Initialize request method and url:

req := httplib.Get("http://beego.me/")
req := httplib.Get("http://beego.vip/")

Send the request and retrieve the data in the response:

Expand Down Expand Up @@ -47,11 +47,11 @@ Enable debug information output:

Then it will output debug information:

httplib.Get("http://beego.me/").Debug(true).Response()
httplib.Get("http://beego.vip/").Debug(true).Response()

// Output
GET / HTTP/0.0
Host: beego.me
Host: beego.vip
User-Agent: beegoServer

## HTTPS Request
Expand All @@ -70,21 +70,21 @@ Can set request timeout and data reading timeout by:

It is a function of request object. So it can be done like this:

httplib.Get("http://beego.me/").SetTimeout(100 * time.Second, 30 * time.Second).Response()
httplib.Get("http://beego.vip/").SetTimeout(100 * time.Second, 30 * time.Second).Response()

## Set Request Params

For Put or Post requests, we may need to send parameters. Parameters can be set in the following manner:

req := httplib.Post("http://beego.me/")
req := httplib.Post("http://beego.vip/")
req.Param("username","astaxie")
req.Param("password","123456")

## Send big data

To simulate file uploading or to send big data, one can use the `Body` function:

req := httplib.Post("http://beego.me/")
req := httplib.Post("http://beego.vip/")
bt,err:=ioutil.ReadFile("hello.txt")
if err!=nil{
log.Fatal("read file err:",err)
Expand All @@ -96,22 +96,22 @@ To simulate file uploading or to send big data, one can use the `Body` function:
To simulate header values, e.g.:

Accept-Encoding:gzip,deflate,sdch
Host:beego.me
Host:beego.vip
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36

Can use `Header` function:

req := httplib.Post("http://beego.me/")
req := httplib.Post("http://beego.vip/")
req.Header("Accept-Encoding","gzip,deflate,sdch")
req.Header("Host","beego.me")
req.Header("Host","beego.vip")
req.Header("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36")

## Upload file

PostFile function requires the first parameter to be the name of form and the second parameter is the filename or filepath you want to send.

```
b:=httplib.Post("http://beego.me/")
b:=httplib.Post("http://beego.vip/")
b.Param("username","astaxie")
b.Param("password","123456")
b.PostFile("uploadfile1", "httplib.pdf")
Expand Down Expand Up @@ -196,7 +196,7 @@ It's used to support `Prometheus` framework to collect metric data.
ServerName: "User-server-1",
RunMode: "dev",
}
req := httplib.Get("http://beego.me/")
req := httplib.Get("http://beego.vip/")
// only work for this request, or using SetDefaultSetting to support all requests
req.AddFilters(builder.FilterChain)

Expand All @@ -215,7 +215,7 @@ If you don't use Beego's admin service, you must expose `prometheus` port manual

```go
builder := opentracing.FilterChainBuilder{}
req := httplib.Get("http://beego.me/")
req := httplib.Get("http://beego.vip/")
// only work for this request, or using SetDefaultSetting to support all requests
req.AddFilters(builder.FilterChain)

Expand Down
20 changes: 10 additions & 10 deletions en-US/module/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sort: 8

# Introduction to i18n

This module is mainly used for i18n of sites and applications, which provides multiple-language options to users, improve user experience. Sites like [Go Walker](http://gowalker.org) and [Beego.me](http://beego.me) use this module to implement Chinese and English user interfaces.
This module is mainly used for i18n of sites and applications, which provides multiple-language options to users, improve user experience. Sites like [Go Walker](http://gowalker.org) and [beego.vip](http://beego.vip) use this module to implement Chinese and English user interfaces.

You can use the following command to install this module:

Expand All @@ -19,9 +19,9 @@ First of all, you have to import this package:
"github.com/beego/i18n"
)

The format of locale files is very much like the INI format configuration file, which is basically key-value pairs. But this module has some improvements. Every language corresponds to a locale file, for example, under `conf` folder of beego.me, there are two files called `locale_en-US.ini` and `locale_zh-CN.ini`.
The format of locale files is very much like the INI format configuration file, which is basically key-value pairs. But this module has some improvements. Every language corresponds to a locale file, for example, under `conf` folder of beego.vip, there are two files called `locale_en-US.ini` and `locale_zh-CN.ini`.

The name and extensions of locale files can be anything, but we strongly recommend you to follow the style of beego.me.
The name and extensions of locale files can be anything, but we strongly recommend you to follow the style of beego.vip.

## Minimal example

Expand All @@ -43,13 +43,13 @@ bye = 再见

### Use in controller

For every request, Beego uses individual goroutines to handle the request; therefore, you can embed an `i18n.Locale` as an anonymous field to process locale operations of the current request. This requires that you understand the idea of `baseController` and `Prepare` method. See source file `routers/router.go` of beego.me for more details.
For every request, Beego uses individual goroutines to handle the request; therefore, you can embed an `i18n.Locale` as an anonymous field to process locale operations of the current request. This requires that you understand the idea of `baseController` and `Prepare` method. See source file `routers/router.go` of beego.vip for more details.

After accepting the request, use the `Prepare` method of `baseController` to do language operations, which you only need to write the same code once and use it in all the upper level controllers.

#### Register locale files

The following code is from beego.me source file `routers/init.go`:
The following code is from beego.vip source file `routers/init.go`:

```go
// Initialized language type list.
Expand All @@ -72,11 +72,11 @@ for _, lang := range langs {
}
```

In this piece of code, we get languages that we want to support in the configuration file, in this case, we have `en-US` and `zh-CN`. Then we initialize a slice for users to change language option(not discussed here). Finally, we call the `i18n.SetMessage` function in a loop to load all the locale files. Here you can see why we recommend the you use the naming conventions of beego.me for locale files.
In this piece of code, we get languages that we want to support in the configuration file, in this case, we have `en-US` and `zh-CN`. Then we initialize a slice for users to change language option(not discussed here). Finally, we call the `i18n.SetMessage` function in a loop to load all the locale files. Here you can see why we recommend the you use the naming conventions of beego.vip for locale files.

#### Initialize controller language

The following code is from the beego.me source file `routers/router.go`, which decides on which user language option to use in the following order: 1: URL specified 2: Cookies and 3: browser `Accept-Language`.
The following code is from the beego.vip source file `routers/router.go`, which decides on which user language option to use in the following order: 1: URL specified 2: Cookies and 3: browser `Accept-Language`.

```go
// setLangVer sets site language version.
Expand Down Expand Up @@ -147,7 +147,7 @@ func (this *baseRouter) setLangVer() bool {
}
```

The variable `isNeedRedir` indicates whether user uses URL to specify the language option. To keep the URL clean, beego.me automatically sets the value in cookies and redirect.
The variable `isNeedRedir` indicates whether user uses URL to specify the language option. To keep the URL clean, beego.vip automatically sets the value in cookies and redirect.

The line `this.Data["Lang"] = curLang.Lang` sets user language option to template variable `Lang` so that we can handle language in template files.

Expand All @@ -156,7 +156,7 @@ Following two lines:
this.Data["CurLang"] = curLang.Name
this.Data["RestLangs"] = restLangs

For users to change language option, see beego.me source code for more details.
For users to change language option, see beego.vip source code for more details.

#### Handle language in controller

Expand All @@ -166,7 +166,7 @@ While the `i18n.Locale` is an anonymous field to be embedded in `baseController`

By passing template variable `Lang` to indicate language option, you are able to do localization in template. But before that, you need to register a template function.

Following code is from beego.me source file `beeweb.go`:
Following code is from beego.vip source file `beeweb.go`:

beego.AddFuncMap("i18n", i18n.Tr)

Expand Down
2 changes: 1 addition & 1 deletion en-US/mvc/controller/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (u *user) Valid(v *validation.Validation) {

func main() {
valid := validation.Validation{}
u := user{Name: "Beego", Age: 2, Email: "dev@beego.me"}
u := user{Name: "Beego", Age: 2, Email: "dev@beego.vip"}
b, err := valid.Valid(&u)
if err != nil {
// handle error
Expand Down
2 changes: 1 addition & 1 deletion en-US/mvc/model/orm.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ maxConn := 30
orm.RegisterDataBase("default", "mysql", "root:root@/orm_test?charset=utf8", maxIdle, maxConn)
```

See [Test.md](https://beego.me/docs/mvc/model/test.md) for more information on database connection strings.
See [Test.md](https://beego.vip/docs/mvc/model/test.md) for more information on database connection strings.

#### SetMaxIdleConns

Expand Down
2 changes: 1 addition & 1 deletion en-US/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Beego contains sample applications to help you learn and use the Beego app frame

You will need a [Go](https://golang.org) 1.1+ installation for this to work.

You will need to install or upgrade [Beego](http://beego.me/docs/install/bee.md) and the [Bee](http://beego.me/docs/install/bee.md) dev tool:
You will need to install or upgrade [Beego](http://beego.vip/docs/install/bee.md) and the [Bee](http://beego.vip/docs/install/bee.md) dev tool:

```
go get -u github.com/beego/beego/v2
Expand Down
2 changes: 1 addition & 1 deletion en-US/quickstart/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type MainController struct {
}
func (this *MainController) Get() {
this.Data["Website"] = "beego.me"
this.Data["Website"] = "beego.vip"
this.Data["Email"] = "[email protected]"
this.TplName = "index.tpl" // version 1.6 use this.TplName = "index.tpl"
}
Expand Down
2 changes: 1 addition & 1 deletion en-US/screencasts.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ https://github.com/beego/tutorial

<iframe width="640" height="360" src="//www.youtube.com/embed/w7RziV_Sn-g" frameborder="0" allowfullscreen></iframe>

blog: [Building Web API with Auto Generated API Document Support](http://beego.me/blog/beego_api)
blog: [Building Web API with Auto Generated API Document Support](http://beego.vip/blog/beego_api)

8 changes: 4 additions & 4 deletions ja/module/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ Input object is the encapsulation of request. Here are the implemented methods:

- Url

The URL of request. E.g.: `http://beego.me/about?username=astaxie`
The URL of request. E.g.: `http://beego.vip/about?username=astaxie`

- Site

The combination of scheme and domain. E.g.: `http://beego.me`
The combination of scheme and domain. E.g.: `http://beego.vip`

- Scheme

The request scheme. E.g.: `http`, `https`

- Domain

The request domain. E.g.: `beego.me`
The request domain. E.g.: `beego.vip`

- Host

Expand Down Expand Up @@ -88,7 +88,7 @@ Input object is the encapsulation of request. Here are the implemented methods:

- SubDomains

Return the root domain of request. For example, request domain is `blog.beego.me`, then this function returns `beego.me`.
Return the root domain of request. For example, request domain is `blog.beego.vip`, then this function returns `beego.vip`.

- Port

Expand Down
Loading

0 comments on commit 1bd108f

Please sign in to comment.