1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-24 14:00:54 +00:00
Commit Graph

2647 Commits

Author SHA1 Message Date
astaxie
a65ad1a4bc fix the time test case 2014-05-31 14:28:44 +08:00
astaxie
bdc01f52a0 Merge pull request #626 from mvpmvh/michael
Michael
2014-05-31 14:25:40 +08:00
Michael
a673a85d4a added tests config/json_test that test missing key usecases. created a template function to fetch AppConfig values 2014-05-30 23:48:23 -05:00
Michael
61008fe75c udpated timezone in templatefunc_test. changed error message to be more descriptive when tests fail 2014-05-30 14:12:21 -05:00
astaxie
5dee6b7d19 beego: fix the namespace cond 2014-05-28 10:23:31 +08:00
astaxie
f6c7a6bd32 beego: improve the admin router print 2014-05-27 17:27:22 +08:00
astaxie
d2eece9a39 session: #620 make the session never read empty 2014-05-27 15:45:35 +08:00
astaxie
c3a23b28ee beego: improve the RandomCreateBytes #620
when rand.Read is failed. will use the math/rand to generate the rand
bytes
2014-05-27 15:29:43 +08:00
astaxie
9083927c6a beego: enhance the XSRFKEY from 15 to 32 #620 2014-05-27 15:00:10 +08:00
astaxie
3f7e91e6a4 beego:fix *.* router bug 2014-05-26 10:15:56 +08:00
astaxie
a2a6f47afa beego: support other config provider 2014-05-25 22:37:38 +08:00
astaxie
23229ef9ef beego: BeegoServerName & beego.Run
BeegoServerName change to beegoServer+Version
beego.Run(“:8089”)
2014-05-25 22:35:20 +08:00
astaxie
0d17d974cd beego: update namespace 2014-05-23 15:56:25 +08:00
astaxie
17104c25a2 beego: Refactoring Filter & add comments 2014-05-20 18:47:41 +08:00
astaxie
8b374d7f90 beego: add benchmark 2014-05-20 18:20:44 +08:00
astaxie
fa3234147a httplib:drone can't upload file 2014-05-20 17:34:52 +08:00
astaxie
33ad6c1370 beego: remove app funciont & fix #590
config := tls.Config{
    ClientAuth: tls.RequireAndVerifyClientCert,
    Certificates: []tls.Certificate{cert},
    ClientCAs: pool,
}
config.Rand = rand.Reader

beego.BeeApp.Server. TLSConfig = &config
2014-05-20 17:28:06 +08:00
astaxie
04290dfc68 beego: delete hotupdate 2014-05-20 16:41:39 +08:00
astaxie
03080b3ef2 beego:1.2.0 2014-05-20 15:53:41 +08:00
astaxie
3f2a712ba8 beego:change default port 2014-05-20 15:40:05 +08:00
astaxie
f215aa4810 beego: change the error tips 2014-05-20 15:34:27 +08:00
astaxie
18a02d7d60 beego:support https & http listen 2014-05-20 15:30:17 +08:00
astaxie
3f4d750dc4 utils: improve the file grep 2014-05-20 14:32:06 +08:00
astaxie
9f01aeed31 beego:remove unused code 2014-05-19 18:52:48 +08:00
astaxie
b45f0b9bf6 beego: fix #478 2014-05-17 02:56:50 +08:00
astaxie
cf04ade603 merger master 2014-05-17 02:29:41 +08:00
astaxie
92f6181616 beego: change the version to 1.2.0 2014-05-17 02:26:52 +08:00
astaxie
9270a0504a beego: admin support link 2014-05-17 02:26:52 +08:00
astaxie
1da37f6ce1 beego: controller add ServeFormatted
ServeFormatted serve Xml OR Json, depending on the value of the Accept
header
2014-05-17 02:26:52 +08:00
astaxie
ef6d9b9a94 session: support memcache interface 2014-05-17 02:26:52 +08:00
astaxie
c265786251 session:support struct.
gob.Register(v)
2014-05-17 02:26:51 +08:00
astaxie
c5c806b58e beego: XSRF support Controller level fix #610
default value is true when you Enable Global XSRF, also can control in
the prepare function to change the value.
2014-05-17 02:26:51 +08:00
astaxie
e657dcfd5f beego: support namespace
ns := beego.NewNamespace("/v1/api/")
ns.Cond(func(ctx *context.Context)bool{
	    if ctx.Input.Domain() == "www.beego.me" {
	    	return true
	    }
	    return false
	})
.Filter("before", Authenticate)
.Router("/order",	&admin.OrderController{})
.Get("/version",func (ctx *context.Context) {
	ctx.Output.Body([]byte("1.0.0"))
})
.Post("/login",func (ctx *context.Context) {
	if ctx.Query("username") == "admin" && ctx.Query("username") ==
"password" {

	}
})
.Namespace(
	NewNamespace("/shop").
		Get("/order/:id", func(ctx *context.Context) {
		ctx.Output.Body([]byte(ctx.Input.Param(":id")))
	}),
)
2014-05-17 02:26:51 +08:00
slene
2ed9b2bffd orm: add test for unexported struct field 2014-05-17 02:26:51 +08:00
astaxie
55ad951bce beego: support more router
//design model
	beego.Get(router, beego.FilterFunc)
	beego.Post(router, beego.FilterFunc)
	beego.Put(router, beego.FilterFunc)
	beego.Head(router, beego.FilterFunc)
	beego.Options(router, beego.FilterFunc)
	beego.Delete(router, beego.FilterFunc)
	beego.Handler(router, http.Handler)

//example

beego.Get("/user", func(ctx *context.Context) {
	ctx.Output.Body([]byte("Get userlist"))
})

beego.Post("/user", func(ctx *context.Context) {
	ctx.Output.Body([]byte("add userlist"))
})

beego.Delete("/user/:id", func(ctx *context.Context) {
	ctx.Output.Body([]byte([]byte(ctx.Input.Param(":id")))
})

import (
    "http"
    "github.com/gorilla/rpc"
    "github.com/gorilla/rpc/json"
)

func init() {
    s := rpc.NewServer()
    s.RegisterCodec(json.NewCodec(), "application/json")
    s.RegisterService(new(HelloService), "")
    beego.Handler("/rpc", s)
}
2014-05-17 02:26:51 +08:00
astaxie
ef815bf5fc config: fix the import issue 2014-05-17 02:26:51 +08:00
jessonchan
6082a0af3e bug fixed 2014-05-17 02:26:51 +08:00
jessonchan
be30fb7937 refator func 2014-05-17 02:26:51 +08:00
toby.zxj
f4e7d63e65 httplib support to set the protocol version for incoming requests 2014-05-17 02:26:51 +08:00
astaxie
14688f240f httplib:support file upload 2014-05-17 02:26:51 +08:00
astaxie
dce09837b9 fix the typo 2014-05-17 02:26:50 +08:00
astaxie
3b9a404138 beego: support other analisys & fix typo 2014-05-17 02:26:50 +08:00
astaxie
a6f55b59cf beego: add link in the admin console 2014-05-17 02:26:50 +08:00
astaxie
c188cbbcb4 update all files License 2014-05-17 02:26:50 +08:00
astaxie
4245521660 fix #576 2014-05-17 02:26:50 +08:00
astaxie
05e5baaa9f beego:add post test case 2014-05-17 02:26:50 +08:00
astaxie
54b92e9599 context:add Bind function
// Bind data from request.Form[key] to dest
// like
/?id=123&isok=true&ft=1.2&ol[0]=1&ol[1]=2&ul[]=str&ul[]=array&user.Name=
astaxie
// var id int  beegoInput.Bind(&id, "id")  id ==123
// var isok bool  beegoInput.Bind(&isok, "isok")  id ==true
// var ft float64  beegoInput.Bind(&ft, "ft")  ft ==1.2
// ol := make([]int, 0, 2)  beegoInput.Bind(&ol, "ol")  ol ==[1 2]
// ul := make([]string, 0, 2)  beegoInput.Bind(&ul, "ul")  ul ==[str
array]
// user struct{Name}  beegoInput.Bind(&user, "user")  user ==
{Name:"astaxie"}
2014-05-17 02:26:50 +08:00
astaxie
aa68ffecec beego: support not-empty value in router fix #555 2014-05-17 02:26:50 +08:00
Lin Luxiang
78991c81ab make Maxage work 2014-05-17 02:26:49 +08:00
Donald Zhan
348ff13857 update the error message 2014-05-17 02:26:49 +08:00