mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 23:40:35 +01:00
Merge pull request #4 from kataras/master
Update Former-commit-id: 41b81853b5235b30e801662441959b325b492803
This commit is contained in:
commit
a48d7f2577
|
@ -1,6 +1,6 @@
|
|||
# Contributing
|
||||
|
||||
First of all read our [Code of Conduct](https://github.com/kataras/iris/tree/master/CODE_OF_CONDUCT.md).
|
||||
First of all read our [Code of Conduct](https://github.com/kataras/iris/blob/master/CODE_OF_CONDUCT.md).
|
||||
|
||||
## PR
|
||||
|
||||
|
@ -16,7 +16,7 @@ First of all read our [Code of Conduct](https://github.com/kataras/iris/tree/mas
|
|||
|
||||
## Donate
|
||||
|
||||
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras) or [BTC](https://iris-go.com/v8/donate)!
|
||||
Help this project to continue deliver awesome and unique features with the higher code quality as possible by donating any amount via [PayPal](https://www.paypal.me/kataras) or [BTC](https://iris-go.com/donate)!
|
||||
|
||||
| Name | Amount | Membership |
|
||||
| -----------|--------|--------|
|
||||
|
@ -47,7 +47,7 @@ Instructions can be found at: https://github.com/kataras/iris/issues/796
|
|||
|
||||
Write an article about Iris in https://medium.com , https://dev.to or if you're being a hackathon at https://hackernoon.com, some examples:
|
||||
|
||||
* [A Todo MVC Application using Iris and Vue.js](https://dev.to/kataras/a-todo-mvc-application-using-iris-and-vuejs-1hn9)
|
||||
* [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064)
|
||||
* [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](bit.ly/2lmKaAZ)
|
||||
* [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b)
|
||||
* [Iris Go Framework + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c)
|
||||
|
|
12
FAQ.md
12
FAQ.md
|
@ -1,5 +1,15 @@
|
|||
# FAQ
|
||||
|
||||
## [![iris](https://img.shields.io/badge/iris-powered-2196f3.svg?style=for-the-badge)](https://github.com/kataras/iris)
|
||||
|
||||
Add a `badge` to your open-source projects powered by [Iris](https://iris-go.com) by pasting the below code snippet to the project repo's README.md:
|
||||
|
||||
```md
|
||||
[![iris](https://img.shields.io/badge/iris-powered-2196f3.svg?style=for-the-badge)](https://github.com/kataras/iris)
|
||||
```
|
||||
|
||||
> The badge is optionally, of course, it is just a simple and fast way to support Iris. The badge is work of a third-party, taken from https://github.com/blob-go/blob-go which was published by our friend @clover113 and we loved it<3
|
||||
|
||||
## How to upgrade
|
||||
|
||||
```sh
|
||||
|
@ -12,7 +22,7 @@ More than 50 practical examples, tutorials and articles at:
|
|||
|
||||
- https://github.com/kataras/iris/tree/master/_examples
|
||||
- https://github.com/iris-contrib/examples
|
||||
- https://iris-go.com/v8/recipe
|
||||
- https://iris-go.com/v10/recipe
|
||||
- https://docs.iris-go.com (in-progress)
|
||||
- https://godoc.org/github.com/kataras/iris
|
||||
|
||||
|
|
2
Gopkg.lock
generated
2
Gopkg.lock
generated
|
@ -173,7 +173,7 @@
|
|||
branch = "master"
|
||||
name = "github.com/satori/go.uuid"
|
||||
packages = ["."]
|
||||
revision = "5bf94b69c6b68ee1b541973bb8e1144db23a194b"
|
||||
revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
|
|
|
@ -63,8 +63,8 @@
|
|||
name = "github.com/ryanuber/columnize"
|
||||
|
||||
[[constraint]]
|
||||
branch = "v1.2.0"
|
||||
name = "github.com/satori/go.uuid"
|
||||
revision = "5bf94b69c6b68ee1b541973bb8e1144db23a194b"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
|
|
34
HISTORY.md
34
HISTORY.md
|
@ -1,4 +1,4 @@
|
|||
# History/Changelog <a href="HISTORY_ZH.md"> <img width="20px" src="https://iris-go.com/images/flag-china.svg?v=10" /></a>
|
||||
# History/Changelog <a href="HISTORY_ZH.md"> <img width="20px" src="https://iris-go.com/images/flag-china.svg?v=10" /></a> <a href="HISTORY_GR.md"> <img width="20px" src="https://iris-go.com/images/flag-greece.svg?v=10" /></a>
|
||||
|
||||
### Looking for free and real-time support?
|
||||
|
||||
|
@ -17,6 +17,34 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene
|
|||
|
||||
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris` or let the automatic updater do that for you.
|
||||
|
||||
# Mo, 15 Jenuary 2018 | v10.0.1
|
||||
|
||||
Not any serious problems were found to be resolved here but one, the first one which is important for devs that used the [cache](cache) package.
|
||||
|
||||
- fix a single one cache handler didn't work across multiple route handlers at the same time https://github.com/kataras/iris/pull/852, as reported at https://github.com/kataras/iris/issues/850
|
||||
- merge PR https://github.com/kataras/iris/pull/862
|
||||
- do not allow concurrent access to the `ExecuteWriter -> Load` when `view#Engine##Reload` was true, as requested at https://github.com/kataras/iris/issues/872
|
||||
- badge for open-source projects powered by Iris, learn how to add that badge to your open-source project at [FAQ.md](FAQ.md) file
|
||||
|
||||
## New Backers
|
||||
|
||||
1. https://opencollective.com/cetin-basoz
|
||||
|
||||
## New Translations
|
||||
|
||||
1. The Chinese README_ZH.md and HISTORY_ZH.md was translated by @Zeno-Code via https://github.com/kataras/iris/pull/858
|
||||
2. New Russian README_RU.md translations by @merrydii via https://github.com/kataras/iris/pull/857
|
||||
3. New Greek README_GR.md and HISTORY_GR.md translations via https://github.com/kataras/iris/commit/8c4e17c2a5433c36c148a51a945c4dc35fbe502a#diff-74b06c740d860f847e7b577ad58ddde0 and https://github.com/kataras/iris/commit/bb5a81c540b34eaf5c6c8e993f644a0e66a78fb8
|
||||
|
||||
## New Examples
|
||||
|
||||
1. [MVC - Register Middleware](_examples/mvc/middleware)
|
||||
|
||||
## New Articles
|
||||
|
||||
1. [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064)
|
||||
2. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](bit.ly/2lmKaAZ)
|
||||
|
||||
# Mo, 01 Jenuary 2018 | v10.0.0
|
||||
|
||||
We must thanks [Mrs. Diana](https://www.instagram.com/merry.dii/) for our awesome new [logo](https://iris-go.com/images/icon.svg)!
|
||||
|
@ -24,7 +52,7 @@ We must thanks [Mrs. Diana](https://www.instagram.com/merry.dii/) for our awesom
|
|||
You can [contact](mailto:Kovalenkodiana8@gmail.com) her for any design-related enquiries or explore and send a direct message via [instagram](https://www.instagram.com/merry.dii/).
|
||||
|
||||
<p align="center">
|
||||
<img width="145px" src="https://iris-go.com/images/icon.svg?v=10" />
|
||||
<img width="145px" src="https://iris-go.com/images/icon.svg?v=a" />
|
||||
</p>
|
||||
|
||||
At this version we have many internal improvements but just two major changes and one big feature, called **hero**.
|
||||
|
@ -149,7 +177,7 @@ Example can be found [here](_examples/http_request/upload-files/main.go).
|
|||
|
||||
## context#View
|
||||
|
||||
Just a minor addition, add a second optional variadic argument to the `context#view` method to accept a single value for template binding.
|
||||
Just a minor addition, add a second optional variadic argument to the `context#View` method to accept a single value for template binding.
|
||||
When you just want one value and not key-value pairs, you used to use an empty string on the `ViewData`, which is fine, especially if you preload these from a previous handler/middleware in the request handlers chain.
|
||||
|
||||
```go
|
||||
|
|
206
HISTORY_GR.md
Normal file
206
HISTORY_GR.md
Normal file
|
@ -0,0 +1,206 @@
|
|||
# Ιστορικό <a href="HISTORY.md"> <img width="20px" src="https://iris-go.com/images/flag-unitedkingdom.svg?v=10" /></a> <a href="HISTORY_ZH.md"> <img width="20px" src="https://iris-go.com/images/flag-china.svg?v=10" /></a>
|
||||
|
||||
### Ψάχνετε για δωρεάν υποστήριξη σε πραγματικό χρόνο;
|
||||
|
||||
https://github.com/kataras/iris/issues
|
||||
https://chat.iris-go.com
|
||||
|
||||
### Ψάχνετε για προηγούμενες εκδόσεις;
|
||||
|
||||
https://github.com/kataras/iris/releases
|
||||
|
||||
### Πρέπει να αναβαθμίσω το Iris μου;
|
||||
|
||||
Οι προγραμματιστές δεν αναγκάζονται να αναβαθμίσουν αν δεν το χρειάζονται πραγματικά. Αναβαθμίστε όποτε αισθάνεστε έτοιμοι.
|
||||
|
||||
> Το Iris εκμεταλλεύεται τη λεγόμενη λειτουργία [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo). Παίρνετε πλήρως αναπαραγωγίσιμα builds, καθώς αυτή η μέθοδος προστατεύει από τις upstream μετονομασίες και διαγραφές.
|
||||
|
||||
**Πώς να αναβαθμίσετε**: Ανοίξτε την γραμμή εντολών σας και εκτελέστε αυτήν την εντολή: `go get -u github.com/kataras/iris` ή αφήστε το αυτόματο updater να το κάνει αυτό για σας.
|
||||
|
||||
# Mo, 15 Jenuary 2018 | v10.0.1
|
||||
|
||||
- διόρθωση του cache handler που δεν δούλευε όπως έπρεπε όταν γινόταν εγγραφή σε πάνω από ένα handler, παλιότερα ήταν ένα cache handler προς ένα route handler, τώρα το ίδιο handler μπορεί να καταχωρηθεί σε όσα route handlers θέλετε https://github.com/kataras/iris/pull/852, όπως είχε αναφερθεί στο https://github.com/kataras/iris/issues/850
|
||||
- συγχώνευση PR https://github.com/kataras/iris/pull/862
|
||||
- απαγόρευση της ταυτόχρονης προσπέλασης του `ExecuteWriter -> Load` όταν το `view#Engine##Reload` είναι true, όπως είχε ζητηθεί στο https://github.com/kataras/iris/issues/872
|
||||
|
||||
## Νέοι Υποστηρικτές
|
||||
|
||||
1. https://opencollective.com/cetin-basoz
|
||||
|
||||
## Νέες Μεταφράσεις
|
||||
|
||||
1. Aναβαθμίσεις για την Κινέζικη μετάφραση README_ZH.md (νέο) και HISTORY_ZH.md από @Zeno-Code μέσω του https://github.com/kataras/iris/pull/858
|
||||
2. Το Ρώσικο README_RU.md μεταφράστηκε από την @merrydii μέσω του https://github.com/kataras/iris/pull/857
|
||||
3. Τα Ελληνικά README_GR.md και HISTORY_GR.md μεταφράστηκαν μέσω των https://github.com/kataras/iris/commit/8c4e17c2a5433c36c148a51a945c4dc35fbe502a#diff-74b06c740d860f847e7b577ad58ddde0 και https://github.com/kataras/iris/commit/bb5a81c540b34eaf5c6c8e993f644a0e66a78fb8
|
||||
|
||||
## Νέα Παραδείγματα
|
||||
|
||||
1. [MVC - Register Middleware](_examples/mvc/middleware)
|
||||
|
||||
## Νέα Άρθρα
|
||||
|
||||
1. [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064)
|
||||
2. [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](bit.ly/2lmKaAZ)
|
||||
|
||||
# Mo, 01 Jenuary 2018 | v10.0.0
|
||||
|
||||
Πρέπει να ευχαριστήσουμε την [Κυρία Diana](https://www.instagram.com/merry.dii/) για το νέο μας [λογότυπο](https://iris-go.com/images/icon.svg)!
|
||||
|
||||
Μπορείτε να [επικοινωνήσετε](mailto:Kovalenkodiana8@gmail.com) μαζί της για οποιεσδήποτε σχετικές με το σχεδιασμό εργασίες ή να της στείλειτε ένα άμεσο μήνυμα μέσω [instagram](https://www.instagram.com/merry.dii/).
|
||||
|
||||
<p align="center">
|
||||
<img width="145px" src="https://iris-go.com/images/icon.svg?v=a" />
|
||||
</p>
|
||||
|
||||
Σε αυτή την έκδοση έχουμε πολλές εσωτερικές βελτιώσεις αλλά μόνο δύο μεγάλες αλλαγές και ένα μεγάλο χαρακτηριστικό, που ονομάζεται **hero**.
|
||||
|
||||
> Η νέα έκδοση προσθέτει 75 καινούρια commits, το PR βρίσκεται [εδώ](https://github.com/kataras/iris/pull/849). Παρακαλώ διαβάστε τις εσωτερικές αλλαγές αν σχεδιάζετε ένα web framework που βασίζεται στο Iris. Γιατί η έκδοση 9 παραλείφθηκε; Έτσι.
|
||||
|
||||
## Hero
|
||||
|
||||
Το νέο πακέτο [hero](hero) περιέχει χαρακτηριστικά για σύνδεση(binding) οποιουδήποτε αντικειμένου ή function το οποίο τα `handlers` μπορεί να χρησημοποιούν, αυτά λεγόνται εξαρτήσεις(dependencies). Τα Hero funcs μπορούν επίσης να επιστρέψουν οποιαδήποτε τιμή, οποιουδήποτε τύπου, αυτές οι τιμές αποστέλλονται στον πελάτη(client).
|
||||
|
||||
> Μπορεί να είχατε ξαναδει "εξαρτήσεις" και "δέσιμο" πριν αλλά ποτέ με υποστήριξη από τον επεξεργαστή κώδικα (code editor), με το Iris πέρνεις πραγματικά ασφαλή "δεσίματα"(bindings) χάρη στο νέο `hero` πακέτο. Αυτή η όλη εκτέλεση(implementation) είναι επίσης η ποιο γρήγορη που έχει επιτευχθεί εως τώρα, η επίδοση είναι πολύ κοντά στα απλά "handlers" και αυτό γιατί το Iris υπολογίζει τα πάντα πριν καν ο server τρέξει!
|
||||
|
||||
Παρακάτω θα δείτε μερικά στιγμιότυπα που ετοιμάσαμε για εσάς, ώστε να γίνουν πιο κατανοητά τα παραπάνω:
|
||||
|
||||
### 1. Παράμετροι διαδρομής - Ενσωματωμένες Εξαρτήσεις (Built'n Dependencies)
|
||||
|
||||
![](https://github.com/kataras/explore/raw/master/iris/hero/hero-1-monokai.png)
|
||||
|
||||
### 2. Υπηρεσίες - Στατικές Eξαρτήσεις (Static Dependencies)
|
||||
|
||||
![](https://github.com/kataras/explore/raw/master/iris/hero/hero-2-monokai.png)
|
||||
|
||||
### 3. Ανά Αίτηση - Δυναμικές Eξαρτήσεις (Dynamic Dependencies)
|
||||
|
||||
![](https://github.com/kataras/explore/raw/master/iris/hero/hero-3-monokai.png)
|
||||
|
||||
Είναι πραγματικά πολύ εύκολο να καταλάβεις πως δουλεύουν τα `hero funcs` και όταν αρχίσεις να τα χρησιμοποιείς **δεν γυρίζεις ποτέ πίσω**.
|
||||
|
||||
Παραδείγματα:
|
||||
|
||||
- [Βασικό](_examples/hero/basic/main.go)
|
||||
- [Επισκόπηση](_examples/hero/overview)
|
||||
|
||||
## MVC
|
||||
|
||||
Πρέπει να καταλάβεις πως δουλεύει το `hero` πακετό ώστε να να δουλέψεις με το `mvc`, γιατί το `mvc` πακέτο βασίζετε στο `hero` για τις μεθόδους του controller σου, οι ίδιοι κανόνες εφαρμόζονται και εκεί.
|
||||
|
||||
Παραδείγματα:
|
||||
|
||||
**Αν χρησημοποιούσατε το MVC πριν, διαβάστε προσεχτικά: Το MVC ΠΕΡΙΕΧΕΙ ΟΡΙΣΜΕΝΕΣ ΑΛΛΑΓΕΣ, ΜΠΟΡΕΙΤΕ ΝΑ ΚΑΝΕΤΕ ΠΕΡΙΣΣΟΤΕΡΑ ΑΠΟ'ΤΙ ΠΡΙΝ**
|
||||
|
||||
**ΠΑΡΑΚΑΛΩ ΔΙΑΒΑΣΤΕ ΤΑ ΠΑΡΑΔΕΙΓΜΑΤΑ ΠΡΟΣΕΧΤΙΚΑ, ΓΙΑ ΕΣΑΣ ΦΤΙΑΧΤΗΚΑΝ**
|
||||
|
||||
Τα παλιά παραδείγματα είναι επίσης εδώ ώστε να μπορείτε να τα συγκρίνετε με τα καινούρια.
|
||||
|
||||
| ΤΩΡΑ | ΠΡΙΝ |
|
||||
| -----------|-------------|
|
||||
| [Hello world](_examples/mvc/hello-world/main.go) | [ΠΑΛΙΟ Hello world](https://github.com/kataras/iris/blob/v8/_examples/mvc/hello-world/main.go) |
|
||||
| [Session Controller](_examples/mvc/session-controller/main.go) | [ΠΑΛΙΟ Session Controller](https://github.com/kataras/iris/blob/v8/_examples/mvc/session-controller/main.go) |
|
||||
| [Overview - Plus Repository and Service layers](_examples/mvc/overview) | [ΠΑΛΙΟ Overview - Plus Repository and Service layers](https://github.com/kataras/iris/tree/v8/_examples/mvc/overview) |
|
||||
| [Login showcase - Plus Repository and Service layers](_examples/mvc/login) | [ΠΑΛΙΟ Login showcase - Plus Repository and Service layers](https://github.com/kataras/iris/tree/v8/_examples/mvc/login) |
|
||||
| [Singleton](_examples/mvc/singleton) | **NEO** |
|
||||
| [Websocket Controller](_examples/mvc/websocket) | **NEO** |
|
||||
| [Vue.js Todo MVC](_examples/tutorial/vuejs-todo-mvc) | **NEO** |
|
||||
|
||||
## context#PostMaxMemory
|
||||
|
||||
Αφαίρεση της παλιάς στατικής μεταβλητής `context.DefaultMaxMemory` και αντικατάσταση με ρύθμιση στο configuration `WithPostMaxMemory`.
|
||||
|
||||
```go
|
||||
// WithPostMaxMemory sets the maximum post data size
|
||||
// that a client can send to the server, this differs
|
||||
// from the overral request body size which can be modified
|
||||
// by the `context#SetMaxRequestBodySize` or `iris#LimitRequestBodySize`.
|
||||
//
|
||||
// Defaults to 32MB or 32 << 20 if you prefer.
|
||||
func WithPostMaxMemory(limit int64) Configurator
|
||||
```
|
||||
|
||||
Αν χρησημοποιούσατε την παλιά στατική μεταβλητή θα χρειαστεί να κάνετε μια αλλαγή σε εκείνη τη γραμμή του κώδικα.
|
||||
|
||||
```go
|
||||
import "github.com/kataras/iris"
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
// [...]
|
||||
|
||||
app.Run(iris.Addr(":8080"), iris.WithPostMaxMemory(10 << 20))
|
||||
}
|
||||
```
|
||||
|
||||
## context#UploadFormFiles
|
||||
|
||||
Νέα μέθοδος για ανέβασμα πολλαπλών αρχείων από τον client, πρέπει να χρησημοποιείται για απλές και συνηθισμένες καταστάσεις, ένα helper είναι μόνο.
|
||||
|
||||
```go
|
||||
// UploadFormFiles uploads any received file(s) from the client
|
||||
// to the system physical location "destDirectory".
|
||||
//
|
||||
// The second optional argument "before" gives caller the chance to
|
||||
// modify the *miltipart.FileHeader before saving to the disk,
|
||||
// it can be used to change a file's name based on the current request,
|
||||
// all FileHeader's options can be changed. You can ignore it if
|
||||
// you don't need to use this capability before saving a file to the disk.
|
||||
//
|
||||
// Note that it doesn't check if request body streamed.
|
||||
//
|
||||
// Returns the copied length as int64 and
|
||||
// a not nil error if at least one new file
|
||||
// can't be created due to the operating system's permissions or
|
||||
// http.ErrMissingFile if no file received.
|
||||
//
|
||||
// If you want to receive & accept files and manage them manually you can use the `context#FormFile`
|
||||
// instead and create a copy function that suits your needs, the below is for generic usage.
|
||||
//
|
||||
// The default form's memory maximum size is 32MB, it can be changed by the
|
||||
// `iris#WithPostMaxMemory` configurator at main configuration passed on `app.Run`'s second argument.
|
||||
//
|
||||
// See `FormFile` to a more controlled to receive a file.
|
||||
func (ctx *context) UploadFormFiles(
|
||||
destDirectory string,
|
||||
before ...func(string, string),
|
||||
) (int64, error)
|
||||
```
|
||||
|
||||
Το παράδειγμα μπορεί να βρεθεί [εδώ](_examples/http_request/upload-files/main.go).
|
||||
|
||||
## context#View
|
||||
|
||||
Απλά μια μικρή προσθήκη μια δεύτερης προαιρετικής variadic παράμετρου στη `context#View` μέθοδο για να δέχεται μια μονή τιμή για template binding.
|
||||
Όταν απλά θέλετε να εμφάνισετε ένα struct value και όχι ζεύγη από κλειδί-τιμή, παλιότερα για να το κάνετε αυτό έπρεπε να δηλώσετε κενό string στη 1η παράμετρο στη `context#ViewData` μέθοδο, το οποίο είναι μια χαρά ειδικά αν δηλώνατε αυτά τα δεδομένα σε προηγούμενο handler της αλυσίδας.
|
||||
|
||||
```go
|
||||
func(ctx iris.Context) {
|
||||
ctx.ViewData("", myItem{Name: "iris" })
|
||||
ctx.View("item.html")
|
||||
}
|
||||
```
|
||||
|
||||
Το ίδιο όπως:
|
||||
|
||||
```go
|
||||
func(ctx iris.Context) {
|
||||
ctx.View("item.html", myItem{Name: "iris" })
|
||||
}
|
||||
```
|
||||
|
||||
```html
|
||||
Item's name: {{.Name}}
|
||||
```
|
||||
|
||||
## context#YAML
|
||||
|
||||
Προσθήκη νέας μεθόδου, `context#YAML`, εμφανίζει δομημένο yaml κείμενο από struct value.
|
||||
|
||||
```go
|
||||
// YAML marshals the "v" using the yaml marshaler and renders its result to the client.
|
||||
func YAML(v interface{}) (int, error)
|
||||
```
|
||||
|
||||
## Session#GetString
|
||||
|
||||
Η μέθοδος `sessions/session#GetString` μπορεί πλέον να επιστρέψει τιμή ακόμα και απο τιμή που αποθηκεύτηκαι σαν αριθμός (integer), όπως ακριβώς κάνουν ήδη τα: memstore, η προσωρινή μνήμη του context, οι δυναμικές μεταβλητές του path routing και οι παράμετροι του url query.
|
|
@ -1,4 +1,4 @@
|
|||
# 更新记录 <a href="HISTORY.md"> <img width="20px" src="https://iris-go.com/images/flag-unitedkingdom.svg?v=10" /></a>
|
||||
# 更新记录 <a href="HISTORY.md"> <img width="20px" src="https://iris-go.com/images/flag-unitedkingdom.svg?v=10" /></a> <a href="HISTORY_GR.md"> <img width="20px" src="https://iris-go.com/images/flag-greece.svg?v=10" /></a>
|
||||
|
||||
### 想得到免费即时的支持?
|
||||
|
||||
|
@ -17,6 +17,10 @@
|
|||
|
||||
**如何升级**: 打开命令行执行以下命令: `go get -u github.com/kataras/iris` 或者等待自动更新。
|
||||
|
||||
# Mo, 15 Jenuary 2018 | v10.0.1
|
||||
|
||||
Translation is missing for this specific history entry, please navigate through [english version of HISTORY.md](HISTORY.md#mo-15-jenuary-2018--v1001) instead or check back later on.
|
||||
|
||||
# 2018 元旦 | v10.0.0 版本发布
|
||||
|
||||
我们必须感谢 [Mrs. Diana](https://www.instagram.com/merry.dii/) 帮我们绘制的漂亮 [logo](https://iris-go.com/images/icon.svg)!
|
||||
|
@ -24,7 +28,7 @@
|
|||
如果有设计相关的需求,你可以[发邮件](mailto:Kovalenkodiana8@gmail.com)给他,或者通过 [instagram](https://www.instagram.com/merry.dii/) 给他发信息。
|
||||
|
||||
<p align="center">
|
||||
<img width="145px" src="https://iris-go.com/images/icon.svg?v=10" />
|
||||
<img width="145px" src="https://iris-go.com/images/icon.svg?v=a" />
|
||||
</p>
|
||||
|
||||
在这个版本中,有许多内部优化改进,但只有两个重大变更和新增一个叫做 **hero** 的特性。
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Iris Web Framework <a href="README_ZH.md"> <img width="20px" src="https://iris-go.com/images/flag-china.svg?v=10" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg?v=10" /></a> <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg?v=10" /></a>
|
||||
|
||||
<img align="right" width="169px" src="https://iris-go.com/images/icon.svg?v=10" title="logo created by @merry.dii" />
|
||||
<img align="right" width="169px" src="https://iris-go.com/images/icon.svg?v=a" title="logo created by @merry.dii" />
|
||||
|
||||
[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris)<!-- [![release](https://img.shields.io/github/release/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/releases)--> [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris)<!--[![github closed issues](https://img.shields.io/github/issues-closed-raw/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aissue+is%3Aclosed)--> [![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris) [![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](_examples/) [![release](https://img.shields.io/badge/release%20-v10.0-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/releases)
|
||||
|
||||
|
@ -14,7 +14,7 @@ Learn what [others say about Iris](#support) and [star](https://github.com/katar
|
|||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! [Become a backer](https://opencollective.com/iris#backer)
|
||||
Thank you to all our backers! 🙏 [Become a backer](https://opencollective.com/iris#backer)
|
||||
|
||||
<a href="https://opencollective.com/iris#backers" target="_blank"><img src="https://opencollective.com/iris/backers.svg?width=890"></a>
|
||||
|
||||
|
@ -106,7 +106,7 @@ _Updated at: [Tuesday, 21 November 2017](_benchmarks/README_UNIX.md)_
|
|||
|
||||
## Support
|
||||
|
||||
- [HISTORY](HISTORY.md#mo-01-jenuary-2018--v1000) file is your best friend, it contains information about the latest features and changes
|
||||
- [HISTORY](HISTORY.md#mo-15-jenuary-2018--v1001) file is your best friend, it contains information about the latest features and changes
|
||||
- Did you happen to find a bug? Post it at [github issues](https://github.com/kataras/iris/issues)
|
||||
- Do you have any questions or need to speak with someone experienced to solve a problem at real-time? Join us to the [community chat](https://chat.iris-go.com)
|
||||
- Complete our form-based user experience report by clicking [here](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link)
|
||||
|
@ -199,7 +199,7 @@ Iris, unlike others, is 100% compatible with the standards and that's why the ma
|
|||
|
||||
### Articles
|
||||
|
||||
* [A Todo MVC Application using Iris and Vue.js](https://dev.to/kataras/a-todo-mvc-application-using-iris-and-vuejs-1hn9)
|
||||
* [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064)
|
||||
* [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](bit.ly/2lmKaAZ)
|
||||
* [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b)
|
||||
* [Iris Go Framework + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c)
|
||||
|
|
22
README_GR.md
22
README_GR.md
|
@ -1,6 +1,6 @@
|
|||
# Iris Web Framework <a href="README.md"> <img width="20px" src="https://iris-go.com/images/flag-unitedkingdom.svg?v=10" /></a> <a href="README_ZH.md"> <img width="20px" src="https://iris-go.com/images/flag-china.svg?v=10" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg?v=10" /></a>
|
||||
|
||||
<img align="right" width="169px" src="https://iris-go.com/images/icon.svg?v=10" title="logo created by @merry.dii" />
|
||||
<img align="right" width="169px" src="https://iris-go.com/images/icon.svg?v=a" title="logo created by @merry.dii" />
|
||||
|
||||
[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris)<!-- [![release](https://img.shields.io/github/release/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/releases)--> [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris)<!--[![github closed issues](https://img.shields.io/github/issues-closed-raw/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aissue+is%3Aclosed)--> [![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris) [![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](_examples/) [![release](https://img.shields.io/badge/release%20-v10.0-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/releases)
|
||||
|
||||
|
@ -10,11 +10,11 @@
|
|||
|
||||
Επιτέλους, ένα πραγματικά ισάξιο (και με το παραπάνω) expressjs web framework για τη γλώσσα προγραμματισμού Go.
|
||||
|
||||
Μάθετε τι [λένε οι άλλοι για το Iris](#support) και [δώστε ένα αστέρι](https://github.com/kataras/iris/stargazers) στο github repository για να μένετε [πάντα ενημερωμένοι](https://facebook.com/iris.framework).
|
||||
Μάθετε τι [λένε οι άλλοι για το Iris](#%CE%A5%CF%80%CE%BF%CF%83%CF%84%CE%AE%CF%81%CE%B9%CE%BE%CE%B7) και [δώστε ένα αστέρι](https://github.com/kataras/iris/stargazers) στο github repository για να μένετε [πάντα ενημερωμένοι](https://facebook.com/iris.framework).
|
||||
|
||||
## Yποστηρικτές
|
||||
|
||||
Eυχαριστούμε όλους τους υποστηρικτές μας! [Γίνετε ένας από αυτούς](https://opencollective.com/iris#backer)
|
||||
Eυχαριστούμε όλους τους υποστηρικτές μας! 🙏 [Γίνετε ένας από αυτούς](https://opencollective.com/iris#backer)
|
||||
|
||||
<a href="https://opencollective.com/iris#backers" target="_blank"><img src="https://opencollective.com/iris/backers.svg?width=890"></a>
|
||||
|
||||
|
@ -47,10 +47,10 @@ func main() {
|
|||
// Method: GET
|
||||
// Resource: http://localhost:8080/user/42
|
||||
//
|
||||
// Χρειάζεται να δηλώσετε ένα regex expression;
|
||||
// Θέλετε να χρησημοποιήσετε regex expressions;
|
||||
// Εύκολο,
|
||||
// απλά δηλώστε τον τύπο της παραμέτρου εως 'string'
|
||||
// το οποίο δέχετε κάθε τιμή και κάντε χρήση
|
||||
// απλά δηλώστε τον τύπο της παραμέτρου ως 'string'
|
||||
// ο οποίος δέχετε κάθε τιμή και κάντε χρήση
|
||||
// της `regexp` macro function, για παράδειγμα:
|
||||
// app.Get("/user/{id:string regexp(^[0-9]+$)}")
|
||||
app.Get("/user/{id:long}", func(ctx iris.Context) {
|
||||
|
@ -108,8 +108,8 @@ _Η τελευταία ενημέρωση έγινε την [Τρίτη, 21 Νο
|
|||
|
||||
## Υποστήριξη
|
||||
|
||||
- To [HISTORY](HISTORY.md#mo-01-jenuary-2018--v1000) αρχείο είναι ο καλύτερος σας φίλος, περιέχει πληροφορίες σχετικά με τις τελευταίες λειτουργίες(features) και αλλαγές
|
||||
- Μήπως τυχαίνει να βρήκατε κανα bug; Δημοσιεύστε το στα [github issues](https://github.com/kataras/iris/issues)
|
||||
- To [HISTORY](HISTORY_GR.md#mo-15-jenuary-2018--v1001) αρχείο είναι ο καλύτερος σας φίλος, περιέχει πληροφορίες σχετικά με τις τελευταίες λειτουργίες(features) και αλλαγές
|
||||
- Μήπως τυχαίνει να βρήκατε κάποιο bug; Δημοσιεύστε το στα [github issues](https://github.com/kataras/iris/issues)
|
||||
- Έχετε οποιεσδήποτε ερωτήσεις ή πρέπει να μιλήσετε με κάποιον έμπειρο για την επίλυση ενός προβλήματος σε πραγματικό χρόνο; Ελάτε μαζί μας στην [συνομιλία κοινότητας](https://chat.iris-go.com)
|
||||
- Συμπληρώστε την αναφορά εμπειρίας χρήστη κάνοντας κλικ [εδώ](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link)
|
||||
- Σας αρέσει το Iris; Τιτιβίστε κάτι για αυτό! Άνθρωποι από ολόκληρο τον πλανήτη έχουνε μιλήσει για αυτό ακριβώς:
|
||||
|
@ -161,11 +161,11 @@ _Η τελευταία ενημέρωση έγινε την [Τρίτη, 21 Νο
|
|||
|
||||
## Μάθηση
|
||||
|
||||
Πρώτα απ 'όλα, ο πιο σωστός τρόπος για να ξεκινήσετε με ένα web framework είναι να μάθετε τα βασικά της γλώσσας προγραμματισμού και των τυπικών της δυνατοτήτων `http`, αν η εφαρμογή σας είναι ένα πολύ απλό προσωπικό έργο χωρίς απαιτήσεις επιδόσεων και συντηρησιμότητας, ίσως θα θέλετε να προχωρήστε μόνο με τα τυπικά πακέτα, αν οχι ακολουθήστε τις εξης οδηγίες:
|
||||
Πρώτα απ 'όλα, ο πιο σωστός τρόπος για να ξεκινήσετε με ένα web framework είναι να μάθετε τα βασικά της γλώσσας προγραμματισμού και των τυπικών της δυνατοτήτων `http`, αν η εφαρμογή σας είναι ένα πολύ απλό προσωπικό έργο χωρίς απαιτήσεις επιδόσεων και συντηρησιμότητας, ίσως να θέλετε να προχωρήσετε μόνο με τα τυπικά πακέτα, εαν οχι τότε ακολουθήστε τις παρακάτω οδηγίες:
|
||||
|
||||
- Πλοηγηθείτε μέσω των **100+1** **[παραδειγμάτων](_examples)** και μερικές [απλές εφαρμογές για αρχάριους](#iris-starter-kits) που δημιουργήσαμε για εσάς
|
||||
- Διαβάστε τα [godocs](https://godoc.org/github.com/kataras/iris) για οποιαδήποτε λεπτομέρεια
|
||||
- Ετοιμάστε ένα φλιτζάνι καφέ ή τσάι, ό, τι σας ευχαριστεί περισσότερο και διαβάστε κάποια [άρθρα](#articles) που βρήκαμε για εσάς
|
||||
- Ετοιμάστε ένα φλιτζάνι καφέ ή τσάι, ό,τι σας ευχαριστεί περισσότερο και διαβάστε κάποια [άρθρα](#articles) που βρήκαμε για εσάς
|
||||
|
||||
### Iris starter kits
|
||||
|
||||
|
@ -201,7 +201,7 @@ _Η τελευταία ενημέρωση έγινε την [Τρίτη, 21 Νο
|
|||
|
||||
### Articles
|
||||
|
||||
* [A Todo MVC Application using Iris and Vue.js](https://dev.to/kataras/a-todo-mvc-application-using-iris-and-vuejs-1hn9)
|
||||
* [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064)
|
||||
* [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](bit.ly/2lmKaAZ)
|
||||
* [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b)
|
||||
* [Iris Go Framework + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Веб-фреймворк Iris <a href="README.md"> <img width="20px" src="https://iris-go.com/images/flag-unitedkingdom.svg?v=10" /></a> <a href="README_ZH.md"><img width="20px" src="https://iris-go.com/images/flag-china.svg?v=10" /></a> <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg?v=10" /></a>
|
||||
|
||||
<img align="right" width="169px" src="https://iris-go.com/images/icon.svg?v=10" title="logo created by @merry.dii" />
|
||||
<img align="right" width="169px" src="https://iris-go.com/images/icon.svg?v=a" title="logo created by @merry.dii" />
|
||||
|
||||
[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris)<!-- [![release](https://img.shields.io/github/release/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/releases)--> [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris)<!--[![github closed issues](https://img.shields.io/github/issues-closed-raw/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aissue+is%3Aclosed)--> [![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris) [![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](_examples/) [![release](https://img.shields.io/badge/release%20-v10.0-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/releases)
|
||||
|
||||
|
@ -14,7 +14,7 @@ Iris предоставляет красиво выразительную и у
|
|||
|
||||
## Сторонники
|
||||
|
||||
Спасибо всем, кто поддерживал нас! [Поддержать нас](https://opencollective.com/iris#backer)
|
||||
Спасибо всем, кто поддерживал нас! 🙏 [Поддержать нас](https://opencollective.com/iris#backer)
|
||||
|
||||
<a href="https://opencollective.com/iris#backers" target="_blank"><img src="https://opencollective.com/iris/backers.svg?width=890"></a>
|
||||
|
||||
|
@ -106,7 +106,7 @@ _Обновлено: [Вторник, 21 ноября 2017 г.](_benchmarks/READ
|
|||
|
||||
## Поддержка
|
||||
|
||||
- Файл [HISTORY](HISTORY.md#mo-01-jenuary-2018--v1000) - ваш лучший друг, он содержит информацию о последних особенностях и всех изменениях
|
||||
- Файл [HISTORY](HISTORY.md#mo-15-jenuary-2018--v1001) - ваш лучший друг, он содержит информацию о последних особенностях и всех изменениях
|
||||
- Вы случайно обнаружили ошибку? Опубликуйте ее на [Github вопросы](https://github.com/kataras/iris/issues)
|
||||
- У Вас есть какие-либо вопросы или Вам нужно поговорить с кем-то, кто бы смог решить Вашу проблему в режиме реального времени? Присоединяйтесь к нам в [чате сообщества](https://chat.iris-go.com)
|
||||
- Заполните наш отчет о пользовательском опыте на основе формы, нажав [здесь](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link)
|
||||
|
@ -199,7 +199,7 @@ Iris, в отличие от других, на 100% совместим со с
|
|||
|
||||
### Статьи
|
||||
|
||||
* [Приложение Todo MVC с использованием Iris и Vue.js](https://dev.to/kataras/a-todo-mvc-application-using-iris-and-vuejs-1hn9)
|
||||
* [Приложение Todo MVC с использованием Iris и Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064)
|
||||
* [Стартовый проект Hasura с готовностью применять веб-приложение Golang hello-world с IRIS](bit.ly/2lmKaAZ)
|
||||
* [Топ-6 веб-фреймворков для Go на 2017 год
|
||||
](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Iris Web Framework <a href="README.md"> <img width="20px" src="https://iris-go.com/images/flag-unitedkingdom.svg?v=10" /></a> <a href="README_RU.md"><img width="20px" src="https://iris-go.com/images/flag-russia.svg?v=10" /></a> <a href="README_GR.md"><img width="20px" src="https://iris-go.com/images/flag-greece.svg?v=10" /></a>
|
||||
|
||||
<img align="right" width="169px" src="https://iris-go.com/images/icon.svg?v=10" title="logo created by @merry.dii" />
|
||||
<img align="right" width="169px" src="https://iris-go.com/images/icon.svg?v=a" title="logo created by @merry.dii" />
|
||||
|
||||
[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris)<!-- [![release](https://img.shields.io/github/release/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/releases)--> [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris)<!--[![github closed issues](https://img.shields.io/github/issues-closed-raw/kataras/iris.svg?style=flat-square)](https://github.com/kataras/iris/issues?q=is%3Aissue+is%3Aclosed)--> [![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris) [![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](_examples/) [![release](https://img.shields.io/badge/release%20-v10.0-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/releases)
|
||||
|
||||
|
@ -14,7 +14,7 @@ Iris 功能强大、使用简单,它将会是你下一个网站、API 服务
|
|||
|
||||
## 支持者
|
||||
|
||||
感谢所有的支持者! [支持我们](https://opencollective.com/iris#backer)
|
||||
感谢所有的支持者! 🙏 [支持我们](https://opencollective.com/iris#backer)
|
||||
|
||||
<a href="https://opencollective.com/iris#backers" target="_blank"><img src="https://opencollective.com/iris/backers.svg?width=890"></a>
|
||||
|
||||
|
@ -102,7 +102,7 @@ _更新于: [2017年11月21日星期二](_benchmarks/README_UNIX.md)_
|
|||
|
||||
## 支持
|
||||
|
||||
- [更新记录](HISTORY_ZH.md#mo-01-jenuary-2018--v1000) 是您最好的朋友,它包含有关最新功能和更改的信息
|
||||
- [更新记录](HISTORY_ZH.md#mo-15-jenuary-2018--v1001) 是您最好的朋友,它包含有关最新功能和更改的信息
|
||||
- 你碰巧找到了一个错误? 请提交 [github issues](https://github.com/kataras/iris/issues)
|
||||
- 您是否有任何疑问或需要与有经验的人士交谈以实时解决问题? [加入我们的聊天](https://chat.iris-go.com)
|
||||
- [点击这里完成我们基于表单的用户体验报告](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link)
|
||||
|
@ -192,7 +192,7 @@ Iris 拥有大量的中间件 [[1]](middleware/)[[2]](https://github.com/iris-co
|
|||
|
||||
### 相关文章(英文)
|
||||
|
||||
* [A Todo MVC Application using Iris and Vue.js](https://dev.to/kataras/a-todo-mvc-application-using-iris-and-vuejs-1hn9)
|
||||
* [A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064)
|
||||
* [A Hasura starter project with a ready to deploy Golang hello-world web app with IRIS](bit.ly/2lmKaAZ)
|
||||
* [Top 6 web frameworks for Go as of 2017](https://blog.usejournal.com/top-6-web-frameworks-for-go-as-of-2017-23270e059c4b)
|
||||
* [Iris Go Framework + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
10.0.0:https://github.com/kataras/iris/blob/master/HISTORY.md#mo-01-jenuary-2018--v1000
|
||||
10.0.1:https://github.com/kataras/iris/blob/master/HISTORY.md#mo-15-jenuary-2018--v1001
|
|
@ -11,7 +11,7 @@ It doesn't always contain the "best ways" but it does cover each important featu
|
|||
- [Hello world!](hello-world/main.go)
|
||||
- [Glimpse](overview/main.go)
|
||||
- [Tutorial: Online Visitors](tutorial/online-visitors/main.go)
|
||||
- [Tutorial: A Todo MVC Application using Iris and Vue.js](https://dev.to/kataras/a-todo-mvc-application-using-iris-and-vuejs-1hn9)
|
||||
- [Tutorial: A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064)
|
||||
- [Tutorial: URL Shortener using BoltDB](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7)
|
||||
- [Tutorial: How to turn your Android Device into a fully featured Web Server (**MUST**)](https://twitter.com/ThePracticalDev/status/892022594031017988)
|
||||
- [POC: Convert the medium-sized project "Parrot" from native to Iris](https://github.com/iris-contrib/parrot)
|
||||
|
|
|
@ -119,6 +119,12 @@ func newApp() *iris.Application {
|
|||
ctx.Write(b)
|
||||
})
|
||||
|
||||
app.HandleMany("POST PUT", "/postvalue", func(ctx iris.Context) {
|
||||
name := ctx.PostValueDefault("name", "iris")
|
||||
headervale := ctx.GetHeader("headername")
|
||||
ctx.Writef("Hello %s | %s", name, headervale)
|
||||
})
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
|
@ -152,11 +158,13 @@ func main() {
|
|||
http://mysubdomain.localhost:8080/
|
||||
|
||||
// PUT
|
||||
http://localhost:8080/postvalue
|
||||
http://localhost:8080/games/42/players/93
|
||||
http://localhost:8080/games/42/clans/clan/93
|
||||
|
||||
// POST
|
||||
http://localhost:8080/
|
||||
http://localhost:8080/postvalue
|
||||
http://localhost:8080/games/42/clans
|
||||
http://localhost:8080/games/42/players
|
||||
http://localhost:8080/games/42/clans/93/leave
|
||||
|
|
|
@ -129,4 +129,13 @@ func TestRouting(t *testing.T) {
|
|||
// test with larger body sent and wait for the custom response
|
||||
largerBSent := make([]byte, maxBodySize+1, maxBodySize+1)
|
||||
e.POST("/").WithBytes(largerBSent).Expect().Status(httptest.StatusBadRequest).Body().Equal("http: request body too large")
|
||||
|
||||
// test the post value (both post and put) and headers.
|
||||
e.PUT("/postvalue").WithFormField("name", "test_put").
|
||||
WithHeader("headername", "headervalue_put").Expect().
|
||||
Status(httptest.StatusOK).Body().Equal("Hello test_put | headervalue_put")
|
||||
|
||||
e.POST("/postvalue").WithFormField("name", "test_post").
|
||||
WithHeader("headername", "headervalue_post").Expect().
|
||||
Status(httptest.StatusOK).Body().Equal("Hello test_post | headervalue_post")
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
)
|
||||
import "github.com/kataras/iris"
|
||||
|
||||
func main() {
|
||||
app := iris.New()
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
const (
|
||||
// Version is the string representation of the current local Iris Web Framework version.
|
||||
Version = "10.0.0"
|
||||
Version = "10.0.1"
|
||||
)
|
||||
|
||||
// CheckForUpdates checks for any available updates
|
||||
|
|
|
@ -20,9 +20,8 @@ type AmberEngine struct {
|
|||
namesFn func() []string // for embedded, in combination with directory & extension
|
||||
reload bool
|
||||
//
|
||||
rmu sync.RWMutex // locks for funcs
|
||||
rmu sync.RWMutex // locks for `ExecuteWiter` when `reload` is true.
|
||||
funcs map[string]interface{}
|
||||
mu sync.Mutex // locks for template files load
|
||||
templateCache map[string]*template.Template
|
||||
}
|
||||
|
||||
|
@ -57,6 +56,10 @@ func (s *AmberEngine) Binary(assetFn func(name string) ([]byte, error), namesFn
|
|||
// Reload if setted to true the templates are reloading on each render,
|
||||
// use it when you're in development and you're boring of restarting
|
||||
// the whole app when you edit a template file.
|
||||
//
|
||||
// Note that if `true` is passed then only one `View -> ExecuteWriter` will be render each time,
|
||||
// no concurrent access across clients, use it only on development status.
|
||||
// It's good to be used side by side with the https://github.com/kataras/rizla reloader for go source files.
|
||||
func (s *AmberEngine) Reload(developmentMode bool) *AmberEngine {
|
||||
s.reload = developmentMode
|
||||
return s
|
||||
|
@ -116,8 +119,6 @@ func (s *AmberEngine) loadDirectory() error {
|
|||
|
||||
templates, err := amber.CompileDir(dir, opt, amber.DefaultOptions) // this returns the map with stripped extension, we want extension so we copy the map
|
||||
if err == nil {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.templateCache = make(map[string]*template.Template)
|
||||
for k, v := range templates {
|
||||
name := filepath.ToSlash(k + opt.Ext)
|
||||
|
@ -155,9 +156,6 @@ func (s *AmberEngine) loadAssets() error {
|
|||
}
|
||||
amber.FuncMap = funcs //set the funcs
|
||||
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
names := namesFn()
|
||||
|
||||
for _, path := range names {
|
||||
|
@ -192,21 +190,22 @@ func (s *AmberEngine) loadAssets() error {
|
|||
}
|
||||
|
||||
func (s *AmberEngine) fromCache(relativeName string) *template.Template {
|
||||
s.mu.Lock()
|
||||
tmpl, ok := s.templateCache[relativeName]
|
||||
if ok {
|
||||
s.mu.Unlock()
|
||||
return tmpl
|
||||
}
|
||||
s.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
// ExecuteWriter executes a template and writes its result to the w writer.
|
||||
// layout here is useless.
|
||||
func (s *AmberEngine) ExecuteWriter(w io.Writer, filename string, layout string, bindingData interface{}) error {
|
||||
// reload the templates if reload configuration field is true
|
||||
// re-parse the templates if reload is enabled.
|
||||
if s.reload {
|
||||
// locks to fix #872, it's the simplest solution and the most correct,
|
||||
// to execute writers with "wait list", one at a time.
|
||||
s.rmu.Lock()
|
||||
defer s.rmu.Unlock()
|
||||
if err := s.Load(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ type DjangoEngine struct {
|
|||
namesFn func() []string // for embedded, in combination with directory & extension
|
||||
reload bool
|
||||
//
|
||||
rmu sync.RWMutex // locks for filters and globals
|
||||
rmu sync.RWMutex // locks for filters, globals and `ExecuteWiter` when `reload` is true.
|
||||
// filters for pongo2, map[name of the filter] the filter function . The filters are auto register
|
||||
filters map[string]FilterFunction
|
||||
// globals share context fields between templates. https://github.com/flosch/pongo2/issues/35
|
||||
|
@ -147,6 +147,10 @@ func (s *DjangoEngine) Binary(assetFn func(name string) ([]byte, error), namesFn
|
|||
// Reload if setted to true the templates are reloading on each render,
|
||||
// use it when you're in development and you're boring of restarting
|
||||
// the whole app when you edit a template file.
|
||||
//
|
||||
// Note that if `true` is passed then only one `View -> ExecuteWriter` will be render each time,
|
||||
// no concurrent access across clients, use it only on development status.
|
||||
// It's good to be used side by side with the https://github.com/kataras/rizla reloader for go source files.
|
||||
func (s *DjangoEngine) Reload(developmentMode bool) *DjangoEngine {
|
||||
s.reload = developmentMode
|
||||
return s
|
||||
|
@ -373,8 +377,12 @@ func (s *DjangoEngine) fromCache(relativeName string) *pongo2.Template {
|
|||
// ExecuteWriter executes a templates and write its results to the w writer
|
||||
// layout here is useless.
|
||||
func (s *DjangoEngine) ExecuteWriter(w io.Writer, filename string, layout string, bindingData interface{}) error {
|
||||
// reload the templates if reload configuration field is true
|
||||
// re-parse the templates if reload is enabled.
|
||||
if s.reload {
|
||||
// locks to fix #872, it's the simplest solution and the most correct,
|
||||
// to execute writers with "wait list", one at a time.
|
||||
s.rmu.Lock()
|
||||
defer s.rmu.Unlock()
|
||||
if err := s.Load(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -22,9 +22,8 @@ type HandlebarsEngine struct {
|
|||
reload bool // if true, each time the ExecuteWriter is called the templates will be reloaded.
|
||||
// parser configuration
|
||||
layout string
|
||||
rmu sync.RWMutex // locks for helpers
|
||||
rmu sync.RWMutex // locks for helpers and `ExecuteWiter` when `reload` is true.
|
||||
helpers map[string]interface{}
|
||||
mu sync.Mutex // locks for template files load
|
||||
templateCache map[string]*raymond.Template
|
||||
}
|
||||
|
||||
|
@ -66,6 +65,10 @@ func (s *HandlebarsEngine) Binary(assetFn func(name string) ([]byte, error), nam
|
|||
// Reload if setted to true the templates are reloading on each render,
|
||||
// use it when you're in development and you're boring of restarting
|
||||
// the whole app when you edit a template file.
|
||||
//
|
||||
// Note that if `true` is passed then only one `View -> ExecuteWriter` will be render each time,
|
||||
// no concurrent access across clients, use it only on development status.
|
||||
// It's good to be used side by side with the https://github.com/kataras/rizla reloader for go source files.
|
||||
func (s *HandlebarsEngine) Reload(developmentMode bool) *HandlebarsEngine {
|
||||
s.reload = developmentMode
|
||||
return s
|
||||
|
@ -123,8 +126,7 @@ func (s *HandlebarsEngine) loadDirectory() error {
|
|||
|
||||
// the render works like {{ render "myfile.html" theContext.PartialContext}}
|
||||
// instead of the html/template engine which works like {{ render "myfile.html"}} and accepts the parent binding, with handlebars we can't do that because of lack of runtime helpers (dublicate error)
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
var templateErr error
|
||||
filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
|
||||
if info == nil || info.IsDir() {
|
||||
|
@ -181,9 +183,6 @@ func (s *HandlebarsEngine) loadAssets() error {
|
|||
}
|
||||
var templateErr error
|
||||
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
names := namesFn()
|
||||
for _, path := range names {
|
||||
if !strings.HasPrefix(path, virtualDirectory) {
|
||||
|
@ -219,14 +218,11 @@ func (s *HandlebarsEngine) loadAssets() error {
|
|||
}
|
||||
|
||||
func (s *HandlebarsEngine) fromCache(relativeName string) *raymond.Template {
|
||||
s.mu.Lock()
|
||||
tmpl, ok := s.templateCache[relativeName]
|
||||
if ok {
|
||||
s.mu.Unlock()
|
||||
return tmpl
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
s.mu.Unlock()
|
||||
return nil
|
||||
return tmpl
|
||||
}
|
||||
|
||||
func (s *HandlebarsEngine) executeTemplateBuf(name string, binding interface{}) (string, error) {
|
||||
|
@ -238,8 +234,12 @@ func (s *HandlebarsEngine) executeTemplateBuf(name string, binding interface{})
|
|||
|
||||
// ExecuteWriter executes a template and writes its result to the w writer.
|
||||
func (s *HandlebarsEngine) ExecuteWriter(w io.Writer, filename string, layout string, bindingData interface{}) error {
|
||||
// reload the templates if reload configuration field is true
|
||||
// re-parse the templates if reload is enabled.
|
||||
if s.reload {
|
||||
// locks to fix #872, it's the simplest solution and the most correct,
|
||||
// to execute writers with "wait list", one at a time.
|
||||
s.rmu.Lock()
|
||||
defer s.rmu.Unlock()
|
||||
if err := s.Load(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
36
view/html.go
36
view/html.go
|
@ -10,6 +10,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type (
|
||||
|
@ -20,7 +21,7 @@ type (
|
|||
extension string
|
||||
assetFn func(name string) ([]byte, error) // for embedded, in combination with directory & extension
|
||||
namesFn func() []string // for embedded, in combination with directory & extension
|
||||
reload bool // if true, each time the ExecuteWriter is called the templates will be reloaded.
|
||||
reload bool // if true, each time the ExecuteWriter is called the templates will be reloaded, each ExecuteWriter waits to be finished before writing to a new one.
|
||||
// parser configuration
|
||||
options []string // text options
|
||||
left string
|
||||
|
@ -32,7 +33,6 @@ type (
|
|||
|
||||
//
|
||||
middleware func(name string, contents string) (string, error)
|
||||
mu sync.Mutex // locks for template files loader
|
||||
Templates *template.Template
|
||||
//
|
||||
}
|
||||
|
@ -94,6 +94,10 @@ func (s *HTMLEngine) Binary(assetFn func(name string) ([]byte, error), namesFn f
|
|||
// Reload if setted to true the templates are reloading on each render,
|
||||
// use it when you're in development and you're boring of restarting
|
||||
// the whole app when you edit a template file.
|
||||
//
|
||||
// Note that if `true` is passed then only one `View -> ExecuteWriter` will be render each time,
|
||||
// no concurrent access across clients, use it only on development status.
|
||||
// It's good to be used side by side with the https://github.com/kataras/rizla reloader for go source files.
|
||||
func (s *HTMLEngine) Reload(developmentMode bool) *HTMLEngine {
|
||||
s.reload = developmentMode
|
||||
return s
|
||||
|
@ -118,9 +122,9 @@ func (s *HTMLEngine) Reload(developmentMode bool) *HTMLEngine {
|
|||
// Execution stops immediately with an error.
|
||||
//
|
||||
func (s *HTMLEngine) Option(opt ...string) *HTMLEngine {
|
||||
s.mu.Lock()
|
||||
s.rmu.Lock()
|
||||
s.options = append(s.options, opt...)
|
||||
s.mu.Unlock()
|
||||
s.rmu.Unlock()
|
||||
return s
|
||||
}
|
||||
|
||||
|
@ -180,6 +184,15 @@ func (s *HTMLEngine) AddFunc(funcName string, funcBody interface{}) {
|
|||
//
|
||||
// Returns an error if something bad happens, user is responsible to catch it.
|
||||
func (s *HTMLEngine) Load() error {
|
||||
// No need to make this with a complicated and "pro" way, just add lockers to the `ExecuteWriter`.
|
||||
// if `Reload(true)` and add a note for non conc access on dev mode.
|
||||
// atomic.StoreUint32(&s.isLoading, 1)
|
||||
// s.rmu.Lock()
|
||||
// defer func() {
|
||||
// s.rmu.Unlock()
|
||||
// atomic.StoreUint32(&s.isLoading, 0)
|
||||
// }()
|
||||
|
||||
if s.assetFn != nil && s.namesFn != nil {
|
||||
// NOT NECESSARY "fix" of https://github.com/kataras/iris/issues/784,
|
||||
// IT'S BAD CODE WRITTEN WE KEEP HERE ONLY FOR A REMINDER
|
||||
|
@ -256,10 +269,10 @@ func (s *HTMLEngine) loadDirectory() error {
|
|||
templateErr = err
|
||||
return err
|
||||
}
|
||||
s.mu.Lock()
|
||||
//s.mu.Lock()
|
||||
// Add our funcmaps.
|
||||
_, err = tmpl.Funcs(emptyFuncs).Funcs(s.funcs).Parse(contents)
|
||||
s.mu.Unlock()
|
||||
//s.mu.Unlock()
|
||||
if err != nil {
|
||||
templateErr = err
|
||||
return err
|
||||
|
@ -406,11 +419,10 @@ func (s *HTMLEngine) layoutFuncsFor(name string, binding interface{}) {
|
|||
return template.HTML(buf.String()), err
|
||||
},
|
||||
}
|
||||
s.rmu.RLock()
|
||||
|
||||
for k, v := range s.layoutFuncs {
|
||||
funcs[k] = v
|
||||
}
|
||||
s.rmu.RUnlock()
|
||||
if tpl := s.Templates.Lookup(name); tpl != nil {
|
||||
tpl.Funcs(funcs)
|
||||
}
|
||||
|
@ -429,10 +441,16 @@ func (s *HTMLEngine) runtimeFuncsFor(name string, binding interface{}) {
|
|||
}
|
||||
}
|
||||
|
||||
var zero = time.Time{}
|
||||
|
||||
// ExecuteWriter executes a template and writes its result to the w writer.
|
||||
func (s *HTMLEngine) ExecuteWriter(w io.Writer, name string, layout string, bindingData interface{}) error {
|
||||
// reload the templates if reload configuration field is true
|
||||
// re-parse the templates if reload is enabled.
|
||||
if s.reload {
|
||||
// locks to fix #872, it's the simplest solution and the most correct,
|
||||
// to execute writers with "wait list", one at a time.
|
||||
s.rmu.Lock()
|
||||
defer s.rmu.Unlock()
|
||||
if err := s.Load(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user