1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 13:05:56 +00:00
Former-commit-id: 7b5d5530279789a3118190feb57776948b305662
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-06-07 21:07:08 +03:00
parent 9c92952a40
commit 7af5f139e0
40 changed files with 73 additions and 73 deletions

View File

@@ -61,7 +61,7 @@ func main() {
app.Logger().SetLevel("debug")
app.Get("/", cache.Handler(10*time.Second), writeMarkdown)
// saves its content on the first request and serves it instead of re-calculating the content.
// After 10 seconds it will be cleared and resetted.
// After 10 seconds it will be cleared and reset.
app.Run(iris.Addr(":8080"))
}

View File

@@ -17,7 +17,7 @@ func main() {
ctx.Writef("Hello from %s", ctx.Path())
})
// Any custom fields here. Handler and ErrorLog are setted to the server automatically
// Any custom fields here. Handler and ErrorLog are set to the server automatically
srv := &http.Server{Addr: ":8080"}
// http://localhost:8080/

View File

@@ -22,10 +22,10 @@ func newApp() *iris.Application {
// it tries to find the language by:
// ctx.Values().GetString("language")
// if that was empty then
// it tries to find from the URLParameter setted on the configuration
// it tries to find from the URLParameter set on the configuration
// if not found then
// it tries to find the language by the "language" cookie
// if didn't found then it it set to the Default setted on the configuration
// if didn't found then it it set to the Default set on the configuration
// hi is the key, 'iris' is the %s on the .ini file
// the second parameter is optional

View File

@@ -943,7 +943,7 @@ type Context interface {
// ContentType sets the response writer's header key "Content-Type" to the 'cType'.
ContentType(cType string)
// GetContentType returns the response writer's header value of "Content-Type"
// which may, setted before with the 'ContentType'.
// which may, set before with the 'ContentType'.
GetContentType() string
// GetContentType returns the request's header value of "Content-Type".
GetContentTypeRequested() string
@@ -1236,7 +1236,7 @@ type Context interface {
//
// This function may be used in the following cases:
//
// * if response body is too big (more than iris.LimitRequestBodySize(if setted)).
// * if response body is too big (more than iris.LimitRequestBodySize(if set)).
// * if response body is streamed from slow external sources.
// * if response body must be streamed to the client in chunks.
// (aka `http server push`).
@@ -1276,7 +1276,7 @@ type Context interface {
// is being called afterwards, in the same request.
// Useful when need to set or/and change a layout based on the previous handlers in the chain.
//
// Note that the 'layoutTmplFile' argument can be setted to iris.NoLayout || view.NoLayout
// Note that the 'layoutTmplFile' argument can be set to iris.NoLayout || view.NoLayout
// to disable the layout for a specific view render action,
// it disables the engine's configuration's layout property.
//

View File

@@ -44,7 +44,7 @@ func main() {
//set session values
s.Set("name", "iris")
//test if setted here
//test if set here
ctx.Writef("All ok session value of the 'name' is: %s", s.GetString("name"))
})
@@ -54,7 +54,7 @@ func main() {
// set session values
s.Set(key, value)
// test if setted here
// test if set here
ctx.Writef("All ok session value of the '%s' is: %s", key, s.GetString(key))
})

View File

@@ -45,7 +45,7 @@ func main() {
//set session values
s.Set("name", "iris")
//test if setted here
//test if set here
ctx.Writef("All ok session value of the 'name' is: %s", s.GetString("name"))
})
@@ -55,7 +55,7 @@ func main() {
// set session values
s.Set(key, value)
// test if setted here
// test if set here
ctx.Writef("All ok session value of the '%s' is: %s", key, s.GetString(key))
})

View File

@@ -54,7 +54,7 @@ func main() {
//set session values
s.Set("name", "iris")
//test if setted here
//test if set here
ctx.Writef("All ok session value of the 'name' is: %s", s.GetString("name"))
})
@@ -64,7 +64,7 @@ func main() {
// set session values
s.Set(key, value)
// test if setted here
// test if set here
ctx.Writef("All ok session value of the '%s' is: %s", key, s.GetString(key))
})
@@ -75,7 +75,7 @@ func main() {
// set session values
s.Set(key, value)
valueSet := s.Get(key)
// test if setted here
// test if set here
ctx.Writef("All ok session value of the '%s' is: %v", key, valueSet)
})

View File

@@ -13,7 +13,7 @@ func main() {
app.Get("/set", func(ctx iris.Context) {
s := sess.Start(ctx)
s.SetFlash("name", "iris")
ctx.Writef("Message setted, is available for the next request")
ctx.Writef("Message set, is available for the next request")
})
app.Get("/get", func(ctx iris.Context) {

View File

@@ -39,8 +39,8 @@ func newApp() *iris.Application {
s := mySessions.Start(ctx)
s.Set("name", "iris")
//test if setted here
ctx.Writef("All ok session setted to: %s", s.GetString("name"))
//test if set here
ctx.Writef("All ok session set to: %s", s.GetString("name"))
})
app.Get("/get", func(ctx iris.Context) {

View File

@@ -14,14 +14,14 @@ func TestSessionsEncodeDecode(t *testing.T) {
es := e.GET("/set").Expect()
es.Status(iris.StatusOK)
es.Cookies().NotEmpty()
es.Body().Equal("All ok session setted to: iris")
es.Body().Equal("All ok session set to: iris")
e.GET("/get").Expect().Status(iris.StatusOK).Body().Equal("The name on the /set was: iris")
// delete and re-get
e.GET("/delete").Expect().Status(iris.StatusOK)
e.GET("/get").Expect().Status(iris.StatusOK).Body().Equal("The name on the /set was: ")
// set, clear and re-get
e.GET("/set").Expect().Body().Equal("All ok session setted to: iris")
e.GET("/set").Expect().Body().Equal("All ok session set to: iris")
e.GET("/clear").Expect().Status(iris.StatusOK)
e.GET("/get").Expect().Status(iris.StatusOK).Body().Equal("The name on the /set was: ")
}

View File

@@ -44,8 +44,8 @@ func main() {
s := sess.Start(ctx)
s.Set("name", "iris")
//test if setted here.
ctx.Writef("All ok session setted to: %s", s.GetString("name"))
//test if set here.
ctx.Writef("All ok session set to: %s", s.GetString("name"))
// Set will set the value as-it-is,
// if it's a slice or map

View File

@@ -29,7 +29,7 @@ func main() {
})
app.Get("/", func(ctx iris.Context) {
ctx.ViewData("BodyMessage", "a sample text here... setted by the route handler")
ctx.ViewData("BodyMessage", "a sample text here... set by the route handler")
if err := ctx.View("index.html"); err != nil {
ctx.Application().Logger().Infof(err.Error())
}
@@ -37,7 +37,7 @@ func main() {
app.Get("/about", func(ctx iris.Context) {
ctx.ViewData("Title", "My About Page")
ctx.ViewData("BodyMessage", "about text here... setted by the route handler")
ctx.ViewData("BodyMessage", "about text here... set by the route handler")
// same file, just to keep things simple.
if err := ctx.View("index.html"); err != nil {