mirror of
https://github.com/kataras/iris.git
synced 2025-02-09 02:34:55 +01:00
misspell
Former-commit-id: 3be90d3099bfd9eabebd299dc08f9d6c1e6c2a29
This commit is contained in:
parent
ad74d7b935
commit
44eafe739b
|
@ -8,7 +8,7 @@ package datamodels
|
||||||
// which could wrap by embedding the datamodels.Movie or
|
// which could wrap by embedding the datamodels.Movie or
|
||||||
// declare new fields instead butwe will use this datamodel
|
// declare new fields instead butwe will use this datamodel
|
||||||
// as the only one Movie model in our application,
|
// as the only one Movie model in our application,
|
||||||
// for the shake of simplicty.
|
// for the sake of simplicty.
|
||||||
type Movie struct {
|
type Movie struct {
|
||||||
ID uint64 `json:"id"`
|
ID uint64 `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
|
@ -46,7 +46,7 @@ func readBody(ctx iris.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// For the shake of the example, log the received payload.
|
// For the sake of the example, log the received payload.
|
||||||
ctx.Application().Logger().Infof("Received: %#+v", p)
|
ctx.Application().Logger().Infof("Received: %#+v", p)
|
||||||
|
|
||||||
// Send back the payload depending on the accept content type and accept-encoding of the client,
|
// Send back the payload depending on the accept content type and accept-encoding of the client,
|
||||||
|
|
|
@ -22,7 +22,7 @@ func main() {
|
||||||
// we should use t.Context if we want to rollback on any errors lives inside this function clojure.
|
// we should use t.Context if we want to rollback on any errors lives inside this function clojure.
|
||||||
t.Context().Text("Blablabla this should not be sent to the client because we will fill the err with a message and status")
|
t.Context().Text("Blablabla this should not be sent to the client because we will fill the err with a message and status")
|
||||||
|
|
||||||
// virtualize a fake error here, for the shake of the example
|
// virtualize a fake error here, for the sake of the example
|
||||||
fail := true
|
fail := true
|
||||||
if fail {
|
if fail {
|
||||||
err.StatusCode = iris.StatusInternalServerError
|
err.StatusCode = iris.StatusInternalServerError
|
||||||
|
|
|
@ -97,7 +97,7 @@ type MeController struct {
|
||||||
CurrentUserID Authenticated
|
CurrentUserID Authenticated
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get returns a message for the shake of the example.
|
// Get returns a message for the sake of the example.
|
||||||
// GET: /user
|
// GET: /user
|
||||||
func (c *MeController) Get() string {
|
func (c *MeController) Get() string {
|
||||||
return "This will be executed only when the user is logged in"
|
return "This will be executed only when the user is logged in"
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
// Keep note that the tags for public-use (for our web app)
|
// Keep note that the tags for public-use (for our web app)
|
||||||
// should be kept in other file like "web/viewmodels/user.go"
|
// should be kept in other file like "web/viewmodels/user.go"
|
||||||
// which could wrap by embedding the datamodels.User or
|
// which could wrap by embedding the datamodels.User or
|
||||||
// define completely new fields instead but for the shake
|
// define completely new fields instead but for the sake
|
||||||
// of the example, we will use this datamodel
|
// of the example, we will use this datamodel
|
||||||
// as the only one User model in our application.
|
// as the only one User model in our application.
|
||||||
type User struct {
|
type User struct {
|
||||||
|
|
|
@ -21,10 +21,10 @@ const (
|
||||||
MySQL
|
MySQL
|
||||||
)
|
)
|
||||||
|
|
||||||
// LoadUsers returns all users(empty map) from the memory, for the shake of simplicty.
|
// LoadUsers returns all users(empty map) from the memory, for the sake of simplicty.
|
||||||
func LoadUsers(engine Engine) (map[int64]datamodels.User, error) {
|
func LoadUsers(engine Engine) (map[int64]datamodels.User, error) {
|
||||||
if engine != Memory {
|
if engine != Memory {
|
||||||
return nil, errors.New("for the shake of simplicity we're using a simple map as the data source")
|
return nil, errors.New("for the sake of simplicity we're using a simple map as the data source")
|
||||||
}
|
}
|
||||||
|
|
||||||
return make(map[int64]datamodels.User), nil
|
return make(map[int64]datamodels.User), nil
|
||||||
|
|
|
@ -8,7 +8,7 @@ package datamodels
|
||||||
// which could wrap by embedding the datamodels.Movie or
|
// which could wrap by embedding the datamodels.Movie or
|
||||||
// declare new fields instead butwe will use this datamodel
|
// declare new fields instead butwe will use this datamodel
|
||||||
// as the only one Movie model in our application,
|
// as the only one Movie model in our application,
|
||||||
// for the shake of simplicty.
|
// for the sake of simplicty.
|
||||||
type Movie struct {
|
type Movie struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
|
@ -26,7 +26,7 @@ Resources:
|
||||||
- DIY
|
- DIY
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// package-level variables for the shake of the example
|
// package-level variables for the sake of the example
|
||||||
// but you can define them inside your main func
|
// but you can define them inside your main func
|
||||||
// and pass around this config whenever you need to create a client or a producer or a consumer or use a cluster.
|
// and pass around this config whenever you need to create a client or a producer or a consumer or use a cluster.
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -12,7 +12,7 @@ $ cd client && GOARCH=wasm GOOS=js /home/$yourname/go1.14/bin/go build -o hello.
|
||||||
func main() {
|
func main() {
|
||||||
app := iris.New()
|
app := iris.New()
|
||||||
|
|
||||||
// we could serve your assets like this the shake of the example,
|
// we could serve your assets like this the sake of the example,
|
||||||
// never include the .go files there in production.
|
// never include the .go files there in production.
|
||||||
app.HandleDir("/", "./client")
|
app.HandleDir("/", "./client")
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ func TestFuncResult(t *testing.T) {
|
||||||
|
|
||||||
type (
|
type (
|
||||||
testPreflightRequest struct {
|
testPreflightRequest struct {
|
||||||
FailCode int `json:"fail_code"` // for the shake of the test.
|
FailCode int `json:"fail_code"` // for the sake of the test.
|
||||||
}
|
}
|
||||||
|
|
||||||
testPreflightResponse struct {
|
testPreflightResponse struct {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user