mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 13:05:56 +00:00
fix typo
Former-commit-id: 7b5d5530279789a3118190feb57776948b305662
This commit is contained in:
2
_examples/cache/simple/main.go
vendored
2
_examples/cache/simple/main.go
vendored
@@ -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"))
|
||||
}
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
//
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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: ")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user