- -
- -At this version we have many internal improvements but just two major changes and one big feature, called **hero**. - -> The new version adds 75 plus new commits, the PR is located [here](https://github.com/kataras/iris/pull/849) read the internal changes if you are developing a web framework based on Iris. Why 9 was skipped? Because. - -## Hero - -The new package [hero](hero) contains features for binding any object or function that `handlers` may use, these are called dependencies. Hero funcs can also return any type of values, these values will be dispatched to the client. - -> You may saw binding before but you didn't have code editor's support, with Iris you get truly safe binding thanks to the new `hero` package. It's also fast, near to raw handlers performance because Iris calculates everything before server ran! - -Below you will see some screenshots we prepared for you in order to be easier to understand: - -### 1. Path Parameters - Built'n Dependencies - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-1-monokai.png) - -### 2. Services - Static Dependencies - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-2-monokai.png) - -### 3. Per-Request - Dynamic Dependencies - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-3-monokai.png) - -`hero funcs` are very easy to understand and when you start using them **you never go back**. - -Examples: - -- [Basic](_examples/hero/basic/main.go) -- [Overview](_examples/hero/overview) - -## MVC - -You have to understand the `hero` package in order to use the `mvc`, because `mvc` uses the `hero` internally for the controller's methods you use as routes, the same rules applied to those controller's methods of yours as well. - -With this version you can register **any controller's methods as routes manually**, you can **get a route based on a method name and change its `Name` (useful for reverse routing inside templates)**, you can use any **dependencies** registered from `hero.Register` or `mvc.New(iris.Party).Register` per mvc application or per-controller, **you can still use `BeginRequest` and `EndRequest`**, you can catch **`BeforeActivation(b mvc.BeforeActivation)` to add dependencies per controller and `AfterActivation(a mvc.AfterActivation)` to make any post-validations**, **singleton controllers when no dynamic dependencies are used**, **Websocket controller, as simple as a `websocket.Connection` dependency** and more... - -Examples: - -**If you used MVC before then read very carefully: MVC CONTAINS SOME BREAKING CHANGES BUT YOU CAN DO A LOT MORE AND EVEN FASTER THAN BEFORE** - -**PLEASE READ THE EXAMPLES CAREFULLY, WE'VE MADE THEM FOR YOU** - -Old examples are here as well. Compare the two different versions of each example to understand what you win if you upgrade now. - -| NEW | OLD | -| -----------|-------------| -| [Hello world](_examples/mvc/hello-world/main.go) | [OLD Hello world](https://github.com/kataras/iris/blob/v8/_examples/mvc/hello-world/main.go) | -| [Session Controller](_examples/mvc/session-controller/main.go) | [OLD Session Controller](https://github.com/kataras/iris/blob/v8/_examples/mvc/session-controller/main.go) | -| [Overview - Plus Repository and Service layers](_examples/mvc/overview) | [OLD 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) | [OLD Login showcase - Plus Repository and Service layers](https://github.com/kataras/iris/tree/v8/_examples/mvc/login) | -| [Singleton](_examples/mvc/singleton) | **NEW** | -| [Websocket Controller](_examples/mvc/websocket) | **NEW** | -| [Vue.js Todo MVC](_examples/tutorial/vuejs-todo-mvc) | **NEW** | - -## context#PostMaxMemory - -Remove the old static variable `context.DefaultMaxMemory` and replace it with the 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 -``` - -If you used that old static field you will have to change that single line. - -Usage: - -```go -import "github.com/kataras/iris" - -func main() { - app := iris.New() - // [...] - - app.Run(iris.Addr(":8080"), iris.WithPostMaxMemory(10 << 20)) -} -``` - -## context#UploadFormFiles - -New method to upload multiple files, should be used for common upload actions, it's just a helper function. - -```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) -``` - -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. -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 -func(ctx iris.Context) { - ctx.ViewData("", myItem{Name: "iris" }) - ctx.View("item.html") -} -``` - -Same as: - -```go -func(ctx iris.Context) { - ctx.View("item.html", myItem{Name: "iris" }) -} -``` - -```html -Item's name: {{.Name}} -``` - -## context#YAML +### Should I upgrade my Iris? -Add a new `context#YAML` function, it renders a yaml from a structured value. +Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready. -```go -// YAML marshals the "v" using the yaml marshaler and renders its result to the client. -func YAML(v interface{}) (int, error) -``` +**How to upgrade**: Open your command-line and execute this command: `go get github.com/kataras/iris@v11.2.0`. -## Session#GetString +# Tu, 23 July 2019 | v11.2.0 -`sessions/session#GetString` can now return a filled value even if the stored value is a type of integer, just like the memstore, the context's temp store, the context's path parameters and the context's url parameters. \ No newline at end of file +Read about the new release at: https://dev.to/kataras/iris-version-11-2-released-22bc diff --git a/HISTORY_GR.md b/HISTORY_GR.md deleted file mode 100644 index 34f6a5f2c..000000000 --- a/HISTORY_GR.md +++ /dev/null @@ -1,343 +0,0 @@ -# Ιστορικό - -### Ψάχνετε για δωρεάν υποστήριξη σε πραγματικό χρόνο; - - 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 να το κάνει αυτό για σας. - -# Fr, 11 January 2019 | v11.1.1 - -Πατήστε [εδώ](https://github.com/kataras/iris/blob/master/HISTORY.md#fr-11-january-2019--v1111) για να διαβάσετε στα αγγλικά. - -# Su, 18 November 2018 | v11.1.0 - -Πατήστε [εδώ](https://github.com/kataras/iris/blob/master/HISTORY.md#su-18-november-2018--v1110) για να διαβάσετε στα αγγλικά για το νέο "versioning" feature. - -# Fr, 09 November 2018 | v11.0.4 - -Πατήστε [εδώ](https://github.com/kataras/iris/blob/master/HISTORY.md#fr-09-november-2018--v1104) για να διαβάσετε στα αγγλικά τις αλλαγές που φέρνει το τελευταίο patch για την έκδοση 11. - -# Tu, 30 October 2018 | v11.0.2 - -Πατήστε [εδώ](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-30-october-2018--v1102) για να διαβάσετε στα αγγλικά μια σημαντική διόρθωση για τα x32 machines που φέρνει το τελευταίο patch για την έκδοση 11. - -# Su, 28 October 2018 | v11.0.1 - -Πατήστε [εδώ](https://github.com/kataras/iris/blob/master/HISTORY.md#su-28-october-2018--v1101) για να διαβάσετε στα αγγλικά τις αλλαγές και το νέο feature που φέρνει το τελευταίο patch για την έκδοση 11. - -# Su, 21 October 2018 | v11.0.0 - -Πατήστε [εδώ](https://github.com/kataras/iris/blob/master/HISTORY.md#su-21-october-2018--v1100) για να διαβάσετε στα αγγλικά τις αλλαγές και τα νέα features που φέρνει νεότερη έκδοση του Iris, version 11. - -# Sat, 11 August 2018 | v10.7.0 - -Είμαι στην, πραγματικά, ευχάριστη θέση να σας ανακοινώσω το πρώτο στάδιο της σταθερής κυκλοφορίας της έκδοσης **10.7** του Iris Web Framework. - -Η έκδοση 10.7.0 είναι μέρος των [επίσημων διανομών μας](https://github.com/kataras/iris/releases). - -Αυτή η έκδοση δεν περιέχει αλλαγές που μπορούν να αλλάξουν ριζικά τα υπάρχοντα προγράμματα που χτίστηκαν με βάση παλιότερες εκδόσεις του Iris. Οι προγραμματιστές μπορούν να αναβαθμίσουν με απόλυτη ασφάλεια. - -Διαβάστε παρακάτω τις αλλαγές και τις βελτιώσεις στον εσωτερικό άβυσσο του Iris. Επιπλέον έχουμε ακόμα περισσότερα παραδείγματα για αρχάριους στην κοινότητα μας. - -## Νέα παραδείγματα - -- [Iris + WebAssemply = 💓](_examples/webassembly/basic/main.go) **προυποθέτει την έκδοση go11.beta και αφεξ** -- [Server-Sent Events](_examples/http_responsewriter/sse/main.go) -- [Struct Validation on context.ReadJSON](_examples/http_request/read-json-struct-validation/main.go) -- [Extract referrer from "referer" header or URL query parameter](_examples/http_request/extract-referer/main.go) -- [Hero Sessions](_examples/hero/sessions) -- [Yet another dependency injection example with hero](_examples/hero/smart-contract/main.go) -- [Writing an API for the Apache Kafka](_examples/tutorial/api-for-apache-kafka) - -> Επίσης, όλα τα "sessions" παραδείγματα έχουν προσαρμοστεί ώστε να περιέχουν την επιλογή `AllowReclaim: true` - -## kataras/iris/websocket - -- Αλλαγή του "connection list" από απλή λίστα σε `sync.Map`, έγινε με: [αυτό](https://github.com/kataras/iris/commit/5f16704f45bedd767527eadf411cf9bc0f8edaee) και [αυτό το commit](https://github.com/kataras/iris/commit/16b30e8eed1406c61abc01282120870bd9fa31d8) -- Προσθήκη του `iris-ws.js` αρχείου στο διάσημο CDN https://cdnjs.com με [αυτό το PR](https://github.com/kataras/iris/pull/1053) από τον [Dibyendu Das](https://github.com/dibyendu) - -## kataras/iris/core/router - -- Προσθήκη κάποιων `json` field tags και νέα functions όπως τα `ChangeMethod`, `SetStatusOffline` και `RestoreStatus` στη `Route` δομή, προσοχή, για να υσχίσουν αυτών των ειδών οι αλλαγές προυποθέτουν από εσας το κάλεσμα του `Router/Application.RefreshRouter()`. (δεν συνιστάται απόλυτα αλλά είναι χρήσιμο για ειδικά κατασκευασμένες ιστοσελίδες τρίτων που μπορεί να υπάρχουν εκει έξω για διαχείριση ενός Web Server που χτίστηκε με Iris) -- Προσθήκη του `GetRoutesReadOnly` function στην `APIBuilder` δομή - -## kataras/iris/context - -- Προσθήκη των `GetReferrer`, `GetContentTypeRequested` και `URLParamInt32Default` functions -- Εισαγωγή των `Trace`, `Tmpl` και `MainHandlerName` functions στη διεπαφή(interface) `RouteReadOnly` -- Προσθήκη του `OnConnectionClose` function, χρησημοποείται για να καλεί κάποιο function όταν η "underline tcp connection" διακοπεί, εξαιρετικά χρήσιμο για SSE ή και άλλες παρόμοιες υλοποιήσεις μέσα σε έναν Iris Handler -- και του `OnClose` function το οποίο είναι σαν να καλείτε τα `OnConnectionClose(myFunc)` και `defer myFunc()` στον ίδιο Iris Handler [*](https://github.com/kataras/iris/commit/6898c2f755a0e22aa42e3b1799e29c857777a6f9) - -Αυτή η έκδοση περιέχει επίσης κάποιες δευτερεύουσες γραμματικής και τυπογραφικού λάθους διορθώσεις και πιό ευανάγνωστα σχόλια για το [godoc](https://godoc.org/github.com/kataras/iris). - -## Βιομηχανία - -Βρίσκομαι στην ευχάριστη αυτή θέση να σας ανακοινώσω ότι το Iris έχει επιλεγεί ως το κύριο αναπτυξιακό kit(main development kit) για οκτώ μεσαίου ως μεγάλου μεγέθους εταιρείες και μια νέα πολύ ελπιδοφόρα startup με βάση την Ινδία. - -Θέλω να σας ευχαριστήσω όλους, **καθέ μία και έναν ξεχωριστά**, για την αδιάκοπη αυτή υποστήριξη και την εμπιστοσύνη που μου δείξατε όλα αυτά τα χρόνια, ειδικά φέτος, παρά τις φήμες και τις διάφορες δυσφήσεις που είχαμε υποστεί αδίκως από τον ανελέητο ανταγωνισμό. - -# Tu, 05 June 2018 | v10.6.6 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-05-june-2018--v1066) instead. - -# Mo, 21 May 2018 | v10.6.5 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#mo-21-may-2018--v1065) instead. - -# We, 09 May 2018 | v10.6.4 - -- [διόρθωση του bug #995](https://github.com/kataras/iris/commit/62457279f41a1f157869a19ef35fb5198694fddb) -- [διόρθωση του bug #996](https://github.com/kataras/iris/commit/a11bb5619ab6b007dce15da9984a78d88cd38956) - -# We, 02 May 2018 | v10.6.3 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#we-02-may-2018--v1063) instead. - -# Tu, 01 May 2018 | v10.6.2 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-01-may-2018--v1062) instead. - -# We, 25 April 2018 | v10.6.1 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#we-25-april-2018--v1061) instead. - -# Su, 22 April 2018 | v10.6.0 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#su-22-april-2018--v1060) instead. - -# Sa, 24 March 2018 | v10.5.0 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#sa-24-march-2018--v1050) instead. - -# We, 14 March 2018 | v10.4.0 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#we-14-march-2018--v1040) instead. - -# Sa, 10 March 2018 | v10.3.0 - -This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#sa-10-march-2018--v1030) instead. - -# Th, 15 February 2018 | v10.2.1 - -Διόρθωση το οποίο αφορά 404 not found errors στα αρχεία που σερβίρονται από τα `StaticEmbedded` και `StaticWeb` των υποτομεών(subdomains), όπως αναφέρθηκε πριν λίγο από τον [@speedwheel](https://github.com/speedwheel) μέσω [της σελίδας μας στο facebook](https://facebook.com/iris.framework). - -This history entry is not yet translated to Greek. Please read [the english version instead](https://github.com/kataras/iris/blob/master/HISTORY.md#th-15-february-2018--v1021). - -# Th, 08 February 2018 | v10.2.0 - -This history entry is not yet translated to Greek. Please read [the english version instead](https://github.com/kataras/iris/blob/master/HISTORY.md#th-08-february-2018--v1020). - -# Tu, 06 February 2018 | v10.1.0 - -This history entry is not yet translated to Greek. Please read [the english version instead](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-06-february-2018--v1010). - -# Tu, 16 January 2018 | v10.0.2 - -## Ασφάλεια | `iris.AutoTLS` - -**Όλοι οι servers πρέπει να αναβαθμιστούν σε αυτήν την έκδοση**, περιέχει διορθώσεις για το _tls-sni challenge_ το οποίο απενεργοποιήθηκε μερικές μέρες πριν από το letsencrypt.org το οποίο προκάλεσε σχεδόν όλα τα golang https-ενεργποιημένα servers να να μην είναι σε θέση να λειτουργήσουν, έτσι υποστήριξη για το _http-01 challenge_ προστέθηκε σαν αναπλήρωση. Πλέον ο διακομιστής δοκιμάζει όλες τις διαθέσιμες προκλήσεις(challenges) letsencrypt. - -Διαβάστε περισσότερα: - -- https://letsencrypt.status.io/pages/incident/55957a99e800baa4470002da/5a55777ed9a9c1024c00b241 -- https://github.com/golang/crypto/commit/13931e22f9e72ea58bb73048bc752b48c6d4d4ac - -# Mo, 15 January 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 -- αναβάθμιση του ενσωματωμένου πακέτου `golang/crypto` για να εφαρμοστεί η επιδιόρθωση για το [tls-sni challenge disabled](https://letsencrypt.status.io/pages/incident/55957a99e800baa4470002da/5a55777ed9a9c1024c00b241) https://github.com/golang/crypto/commit/13931e22f9e72ea58bb73048bc752b48c6d4d4ac (**σχετικό με το iris.AutoTLS**) - -## Νέοι Υποστηρικτές - -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 January 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/). - -- -
- -Σε αυτή την έκδοση έχουμε πολλές εσωτερικές βελτιώσεις αλλά μόνο δύο μεγάλες αλλαγές και ένα μεγάλο χαρακτηριστικό, που ονομάζεται **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. \ No newline at end of file diff --git a/HISTORY_ID.md b/HISTORY_ID.md deleted file mode 100644 index f69ea630b..000000000 --- a/HISTORY_ID.md +++ /dev/null @@ -1,424 +0,0 @@ -# Riwayat/Changelog - -### Butuh bantuan gratis secara langsung? - - https://github.com/kataras/iris/issues - https://chat.iris-go.com - -### Mencari versi sebelumnya? - - https://github.com/kataras/iris/releases - -### Apakah saya harus melakukan upgrade terhadap Iris saya? - -Developers tidak diwajibkan untuk melakukan upgrade apabila mereka tidak membutuhkannya. Anda bisa melakukan upgrade ketika anda sudah siap. - -> Iris menggunakan fitur [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo). Anda mendapatkan build yang benar - benar dapat direproduksi, karena metode ini menjaga terhadap penggantian nama dan penghapusan di upstream. - -**Cara Upgrade**: Bukan command-line anda dan eksekuis perintah ini: `go get -u github.com/kataras/iris` atau biarkan updater otomatis melakukannya untuk anda. - -# Fr, 11 January 2019 | v11.1.1 - -This history entry is not translated yet to the Indonesian language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#fr-11-january-2019--v1111) instead. - -# Su, 18 November 2018 | v11.1.0 - -This history entry is not translated yet to the Indonesian language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#su-18-november-2018--v1110) instead. - -# Fr, 09 November 2018 | v11.0.4 - -This history entry is not translated yet to the Indonesian language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#fr-09-november-2018--v1104) instead. - -# Tu, 30 October 2018 | v11.0.2 - -This history entry is not translated yet to the Indonesian language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-30-october-2018--v1102) instead. - -# Su, 28 October 2018 | v11.0.1 - -This history entry is not translated yet to the Indonesian language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#su-28-october-2018--v1101) instead. - -# Su, 21 October 2018 | v11.0.0 - -This history entry is not translated yet to the Indonesian language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#su-21-october-2018--v1100) instead. - -# Sat, 11 August 2018 | v10.7.0 - -This history entry is not translated yet to the Indonesian language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#sat-11-august-2018--v1070) instead. - -# Tu, 05 June 2018 | v10.6.6 - -This history entry is not translated yet to the Indonesian language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-05-june-2018--v1066) instead. - -# Mo, 21 May 2018 | v10.6.5 - -This history entry is not translated yet to the Bahasa Indonesia language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#mo-21-may-2018--v1065) instead. - -# We, 09 May 2018 | v10.6.4 - -- [fix issue 995](https://github.com/kataras/iris/commit/62457279f41a1f157869a19ef35fb5198694fddb) -- [fix issue 996](https://github.com/kataras/iris/commit/a11bb5619ab6b007dce15da9984a78d88cd38956) - -# We, 02 May 2018 | v10.6.3 - -**Every server should be upgraded to this version**, it contains an important, but easy, fix for the `websocket/Connection#Emit##To`. - -- Websocket: fix https://github.com/kataras/iris/issues/991 - -# Tu, 01 May 2018 | v10.6.2 - -- Websocket: added OnPong to Connection via PR: https://github.com/kataras/iris/pull/988 -- Websocket: `OnError` accepts a `func(error)` now instead of `func(string)`, as requested at: https://github.com/kataras/iris/issues/987 - -# We, 25 April 2018 | v10.6.1 - -- Re-implement the [BoltDB](https://github.com/coreos/bbolt) as built'n back-end storage for sessions(`sessiondb`) using the latest features: [/sessions/sessiondb/boltdb/database.go](sessions/sessiondb/boltdb/database.go), example can be found at [/_examples/sessions/database/boltdb/main.go](_examples/sessions/database/boltdb/main.go). -- Fix a minor issue on [Badger sessiondb example](_examples/sessions/database/badger/main.go). Its `sessions.Config { Expires }` field was `2 *time.Second`, it's `45 *time.Minute` now. -- Other minor improvements to the badger sessiondb. - -# Su, 22 April 2018 | v10.6.0 - -- Fix open redirect by @wozz via PR: https://github.com/kataras/iris/pull/972. -- Fix when destroy session can't remove cookie in subdomain by @Chengyumeng via PR: https://github.com/kataras/iris/pull/964. -- Add `OnDestroy(sid string)` on sessions for registering a listener when a session is destroyed with commit: https://github.com/kataras/iris/commit/d17d7fecbe4937476d00af7fda1c138c1ac6f34d. -- Finally, sessions are in full-sync with the registered database now. That required a lot of internal code changed but **zero code change requirements by your side**. We kept only `badger` and `redis` as the back-end built'n supported sessions storages, they are enough. Made with commit: https://github.com/kataras/iris/commit/f2c3a5f0cef62099fd4d77c5ccb14f654ddbfb5c relative to many issues that you've requested it. - -# Sa, 24 March 2018 | v10.5.0 - -### New - -Add new client cache (helpers) middlewares for even faster static file servers. Read more [there](https://github.com/kataras/iris/pull/935). - -### Breaking Change - -Change the `Value- -
- -At this version we have many internal improvements but just two major changes and one big feature, called **hero**. - -> The new version adds 75 plus new commits, the PR is located [here](https://github.com/kataras/iris/pull/849) read the internal changes if you are developing a web framework based on Iris. Why 9 was skipped? Because. - -## Hero - -The new package [hero](hero) contains features for binding any object or function that `handlers` may use, these are called dependencies. Hero funcs can also return any type of values, these values will be dispatched to the client. - -> You may saw binding before but you didn't have code editor's support, with Iris you get truly safe binding thanks to the new `hero` package. It's also fast, near to raw handlers performance because Iris calculates everything before server ran! - -Below you will see some screenshots we prepared for you in order to be easier to understand: - -### 1. Path Parameters - Built'n Dependencies - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-1-monokai.png) - -### 2. Services - Static Dependencies - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-2-monokai.png) - -### 3. Per-Request - Dynamic Dependencies - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-3-monokai.png) - -`hero funcs` are very easy to understand and when you start using them **you never go back**. - -Examples: - -- [Basic](_examples/hero/basic/main.go) -- [Overview](_examples/hero/overview) - -## MVC - -You have to understand the `hero` package in order to use the `mvc`, because `mvc` uses the `hero` internally for the controller's methods you use as routes, the same rules applied to those controller's methods of yours as well. - -With this version you can register **any controller's methods as routes manually**, you can **get a route based on a method name and change its `Name` (useful for reverse routing inside templates)**, you can use any **dependencies** registered from `hero.Register` or `mvc.New(iris.Party).Register` per mvc application or per-controller, **you can still use `BeginRequest` and `EndRequest`**, you can catch **`BeforeActivation(b mvc.BeforeActivation)` to add dependencies per controller and `AfterActivation(a mvc.AfterActivation)` to make any post-validations**, **singleton controllers when no dynamic dependencies are used**, **Websocket controller, as simple as a `websocket.Connection` dependency** and more... - -Examples: - -**If you used MVC before then read very carefully: MVC CONTAINS SOME BREAKING CHANGES BUT YOU CAN DO A LOT MORE AND EVEN FASTER THAN BEFORE** - -**PLEASE READ THE EXAMPLES CAREFULLY, WE'VE MADE THEM FOR YOU** - -Old examples are here as well. Compare the two different versions of each example to understand what you win if you upgrade now. - -| NEW | OLD | -| -----------|-------------| -| [Hello world](_examples/mvc/hello-world/main.go) | [OLD Hello world](https://github.com/kataras/iris/blob/v8/_examples/mvc/hello-world/main.go) | -| [Session Controller](_examples/mvc/session-controller/main.go) | [OLD Session Controller](https://github.com/kataras/iris/blob/v8/_examples/mvc/session-controller/main.go) | -| [Overview - Plus Repository and Service layers](_examples/mvc/overview) | [OLD 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) | [OLD Login showcase - Plus Repository and Service layers](https://github.com/kataras/iris/tree/v8/_examples/mvc/login) | -| [Singleton](_examples/mvc/singleton) | **NEW** | -| [Websocket Controller](_examples/mvc/websocket) | **NEW** | -| [Vue.js Todo MVC](_examples/tutorial/vuejs-todo-mvc) | **NEW** | - -## context#PostMaxMemory - -Remove the old static variable `context.DefaultMaxMemory` and replace it with the 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 -``` - -If you used that old static field you will have to change that single line. - -Usage: - -```go -import "github.com/kataras/iris" - -func main() { - app := iris.New() - // [...] - - app.Run(iris.Addr(":8080"), iris.WithPostMaxMemory(10 << 20)) -} -``` - -## context#UploadFormFiles - -New method to upload multiple files, should be used for common upload actions, it's just a helper function. - -```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) -``` - -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. -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 -func(ctx iris.Context) { - ctx.ViewData("", myItem{Name: "iris" }) - ctx.View("item.html") -} -``` - -Same as: - -```go -func(ctx iris.Context) { - ctx.View("item.html", myItem{Name: "iris" }) -} -``` - -```html -Item's name: {{.Name}} -``` - -## context#YAML - -Add a new `context#YAML` function, it renders a yaml from a structured 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` can now return a filled value even if the stored value is a type of integer, just like the memstore, the context's temp store, the context's path parameters and the context's url parameters. \ No newline at end of file diff --git a/HISTORY_ZH.md b/HISTORY_ZH.md deleted file mode 100644 index d66a4fccc..000000000 --- a/HISTORY_ZH.md +++ /dev/null @@ -1,412 +0,0 @@ -# 更新记录 - -### 想得到免费即时的支持? - - https://github.com/kataras/iris/issues - https://chat.iris-go.com - -### 获取历史版本? - - https://github.com/kataras/iris/releases - -### 我是否应该升级 Iris? - -如果没有必要,不会强制升级。如果你已经准备好了,可以随时升级。 - -> Iris 使用 Golang 的 [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) 特性, 避免依赖包的更改带来影响。 - -**如何升级**: 打开命令行执行以下命令: `go get -u github.com/kataras/iris` 或者等待自动更新。 - -# Fr, 11 January 2019 | v11.1.1 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#fr-11-january-2019--v1111) instead. - -# Su, 18 November 2018 | v11.1.0 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#su-18-november-2018--v1110) instead. - -# Fr, 09 November 2018 | v11.0.4 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#fr-09-november-2018--v1104) instead. - -# Tu, 30 October 2018 | v11.0.2 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-30-october-2018--v1102) instead. - -# Su, 28 October 2018 | v11.0.1 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#su-28-october-2018--v1101) instead. - -# Su, 21 October 2018 | v11.0.0 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#su-21-october-2018--v1100) instead. - -# Sat, 11 August 2018 | v10.7.0 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#sat-11-august-2018--v1070) instead. - -# Tu, 05 June 2018 | v10.6.6 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-05-june-2018--v1066) instead. - -# Mo, 21 May 2018 | v10.6.5 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#mo-21-may-2018--v1065) instead. - -# We, 09 May 2018 | v10.6.4 - -- [fix issue 995](https://github.com/kataras/iris/commit/62457279f41a1f157869a19ef35fb5198694fddb) -- [fix issue 996](https://github.com/kataras/iris/commit/a11bb5619ab6b007dce15da9984a78d88cd38956) - -# We, 02 May 2018 | v10.6.3 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#we-02-may-2018--v1063) instead. - -# Tu, 01 May 2018 | v10.6.2 - -This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-01-may-2018--v1062) instead. - -# 2018 4月25日 | v10.6.1 版本更新 - -- 用最新版 BoltDB 重新实现 session (`sessiondb`) 存储:[/sessions/sessiondb/boltdb/database.go](sessions/sessiondb/boltdb/database.go), 相关示例 [/_examples/sessions/database/boltdb/main.go](_examples/sessions/database/boltdb/main.go). -- 修正 一个小问题 on [Badger sessiondb example](_examples/sessions/database/badger/main.go). `sessions.Config { Expires }` 字段由 `2 *time.Second` 调整为 `45 *time.Minute` . -- badger sessiondb 其他小改进. - -# 2018 4月22日 | v10.6.0 版本更新 - -- 修正 重定向问题 由 @wozz 提交: https://github.com/kataras/iris/pull/972. -- 修正 无法销毁子域名 session 问题 由 @Chengyumeng 提交: https://github.com/kataras/iris/pull/964. -- 添加 `OnDestroy(sid string)` 当 session 销毁时注册监听器 相关细节: https://github.com/kataras/iris/commit/d17d7fecbe4937476d00af7fda1c138c1ac6f34d. -- sessions 现在与注册数据库完全同步。 这涉及到很多内部改动,但 **这不影响你当前项目代码**. 我们只保留了 `badger` 和 `redis` 作为底部支持。 相关细节: https://github.com/kataras/iris/commit/f2c3a5f0cef62099fd4d77c5ccb14f654ddbfb5c - -# 2018 3月 24日 | v10.5.0 版本更新 - -### 新增 - -新增 缓存中间件客户端,更快的静态文件服务器. 详情 [点击](https://github.com/kataras/iris/pull/935). - -### 破坏式更新 - -改变 `Value- -
- -在这个版本中,有许多内部优化改进,但只有两个重大变更和新增一个叫做 **hero** 的特性。 - -> 新版本有 75 + 的变更提交, 如果你需要升级 Iris 请仔细阅读本文档。 为什么版本 9 跳过了? 你猜... - -## Hero 特性 - -新增包 [hero](hero) 可以绑定处理任何依赖 `handlers` 的对象或函数。Hero funcs 可以返回任何类型的值,并发送给客户端。 - -> 之前的绑定没有编辑器的支持, 新包 `hero` 为 Iris 带来真正的安全绑定。 Iris 会在服务器运行之前计算所有内容,所以它执行速度高,接近于原生性能。 - -下面你会看到我们为你准备的一些截图,以便于理解: - -### 1. 路径参数 - 构建依赖 - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-1-monokai.png) - -### 2. 服务 - 静态依赖 - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-2-monokai.png) - -### 3. 请求之前 - 动态依赖 - -![](https://github.com/kataras/explore/raw/master/iris/hero/hero-3-monokai.png) - -`hero funcs` 非常容易理解,当你用过之后 **在也回不去了**. - -示例: - -- [基本用法](_examples/hero/basic/main.go) -- [使用概览](_examples/hero/overview) - -## MVC - -如果要使用 `mvc` ,必须先理解 `hero` 包,因为`mvc`在内部使用`hero`作为路由控制器的方法,同样的规则也适用于你的控制器的方法。 - -With this version you can register **any controller's methods as routes manually**, you can **get a route based on a method name and change its `Name` (useful for reverse routing inside templates)**, you can use any **dependencies** registered from `hero.Register` or `mvc.New(iris.Party).Register` per mvc application or per-controller, **you can still use `BeginRequest` and `EndRequest`**, you can catch **`BeforeActivation(b mvc.BeforeActivation)` to add dependencies per controller and `AfterActivation(a mvc.AfterActivation)` to make any post-validations**, **singleton controllers when no dynamic dependencies are used**, **Websocket controller, as simple as a `websocket.Connection` dependency** and more... - -示例: - -**如果你之前使用过 MVC ,请仔细阅读:MVC 包含一些破坏性的改进,但新的方式可以做更多,会让程序执行更快** - -**请阅读我们为你准备的示例** - -如果你现在需要升级,请对比新旧版本示例的不同,便于理解。 - -| NEW | OLD | -| -----------|-------------| -| [Hello world](_examples/mvc/hello-world/main.go) | [OLD Hello world](https://github.com/kataras/iris/blob/v8/_examples/mvc/hello-world/main.go) | -| [Session Controller](_examples/mvc/session-controller/main.go) | [OLD Session Controller](https://github.com/kataras/iris/blob/v8/_examples/mvc/session-controller/main.go) | -| [Overview - Plus Repository and Service layers](_examples/mvc/overview) | [OLD 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) | [OLD Login showcase - Plus Repository and Service layers](https://github.com/kataras/iris/tree/v8/_examples/mvc/login) | -| [Singleton](_examples/mvc/singleton) | **新增** | -| [Websocket Controller](_examples/mvc/websocket) | **新增** | -| [Vue.js Todo MVC](_examples/tutorial/vuejs-todo-mvc) | **新增** | - -## context#PostMaxMemory - -移除旧版本的常量 `context.DefaultMaxMemory` 替换为配置 `WithPostMaxMemory` 方法. - -```go -// WithPostMaxMemory 设置客户端向服务器 post 提交数据的最大值 -// 他不同于 request body 的值大小,如果有相关需求请使用 -// `context#SetMaxRequestBodySize` 或者 `iris#LimitRequestBodySize` -// -// 默认值为 32MB 或者 32 << 20 -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 - -新方法可以多文件上传, 应用于常见的上传操作, 它是一个非常有用的函数。 - -```go -// UploadFormFiles 将所有接收到的文件从客户端上传到系统物理位置 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) -``` - -这里是相关示例 [here](_examples/http_request/upload-files/main.go). - -## context#View - -这里有个小更新,增加可选的第二个参数,用来绑定模版变量。提示:这种绑定方式,会忽略其他变量的绑定。 -如果要忽略其他模版变量,之前是在 `ViewData` 上绑定一个空字符串,现在可以直接通过 View 方法添加。 - -```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 -html 模版中调用: {{.Name}} -``` - -## context#YAML - -新增 `context#YAML` 函数, 解析结构体到 yaml。 - -```go -//使用 yaml 包的 Marshal 的方法解析,并发送到客户端。 -func YAML(v interface{}) (int, error) -``` - -## Session#GetString - -`sessions/session#GetString` 可以获取 session 的变量值(可以是 integer 类型),就像内存缓存、Context 上下文储存的值。 diff --git a/LICENSE b/LICENSE index c9eada500..a56c9e1a1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017-2018 The Iris Authors. All rights reserved. +Copyright (c) 2017-2019 The Iris Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/NOTICE b/NOTICE new file mode 100644 index 000000000..cca000993 --- /dev/null +++ b/NOTICE @@ -0,0 +1,98 @@ +================================================================================ + + Third-Party Software for iris + +================================================================================ + +The following 3rd-party software components may be used by or distributed with iris. This document was automatically generated by FOSSA on 2019-7-22; any information relevant to third-party vendors listed below are collected using common, reasonable means. + +Revision ID: 607b5b7cef034da2692f99a4c9bafb31a999ccda + + +================================================================================ + + Direct Dependencies + +================================================================================ + +----------------- ----------------- ------------------------------------------ + Library Version Website +----------------- ----------------- ------------------------------------------ + amber cdade1c073850f4 https://github.com/eknkc/amber + ffc70a829e31235 + ea6892853b + blackfriday 48b3da6a6f3865c https://github.com/iris-contrib/ + 7eb1eba96d74cf0 blackfriday + a16f63faca + bluemonday 89802068f71166e https://github.com/microcosm-cc/ + 95c92040512bf2e bluemonday + 11767721ed + columnize 9e6335e58db3b4c https://github.com/ryanuber/columnize + fe3c3c5c881f51f + fbc1091b34 + formBinder fbd5963f41e18ae https://github.com/iris-contrib/ + 1f1423ba0462350 formBinder + 94b0721ea1 + go e369490fb7db5f2 https://github.com/golang/go + d42bb0e8ee19b48 + 378dee0ebf + go-version 192140e6f3e645d https://github.com/hashicorp/go-version + 971b134d4e35b51 + 91adb9dfd3 + go.uuid 36e9d2ebbde5e3f https://github.com/iris-contrib/go.uuid + 13ab2e25625fd45 + 3271d6522e + golog 03be101463868ed https://github.com/kataras/golog + c5a81f094fc68a5 + f6c1b5503a + goreferrer ec9c9a553398739 https://github.com/Shopify/goreferrer + f0dcf817e0ad5e0 + 1c4e7dcd08 + httpexpect ebe99fcebbcedf6 https://github.com/iris-contrib/ + e7916320cce24c3 httpexpect + e1832766ac + i18n 987a633949d087b https://github.com/iris-contrib/i18n + a52207b587792e8 + c67d65780b + jade 9ffefa50b5f3141 https://github.com/Joker/jade + 6ac643e9d9ad611 + 6f4688705f + json-iterator 08047c174c6c03e https://github.com/json-iterator/go + 8ec963a411bde1b + 6d1ee67b26 + neffos c6806f19261108f https://github.com/kataras/neffos + bc1281e21faa79d + 7193b36097 + pongo2 8914e1cf9164420 https://github.com/flosch/pongo2 + c91423cdefc7d97 + 8a76c38213 + raymond b565731e1464263 https://github.com/aymerick/raymond + de0bda75f2e45d9 + 7b54b60110 + structs 878a968ab225483 https://github.com/fatih/structs + 62a09bdb3322f98 + b00f470d46 + toml 3012a1dbe2e4bd1 https://github.com/BurntSushi/toml + 391d42b32f0577c + b7bbc7f005 + yaml.v2 51d6538a90f86fe https://gopkg.in/yaml.v2 + 93ac480b35f37b2 + be17fef232 + + + +================================================================================ + + Deep Dependencies + +================================================================================ + + badger e9447c910efd3c6 https://github.com/dgraph-io/badger + 7c5453ea1f65d2f + 355544dd82 + bbolt 2eb7227adea1d5c https://github.com/etcd-io/bbolt + f85f0bc2a82b705 + 9b13c2fa68 + radix 5e391a8aaf46354 https://github.com/mediocregopher/radix + 58e7d9f7296c125 + 01b06875c6 \ No newline at end of file diff --git a/README.md b/README.md index 1f657f9b1..8b1eaaeae 100644 --- a/README.md +++ b/README.md @@ -1,90 +1,22 @@ -# ⚡️ Stay tuned for updates: upcoming version 11.2.0 + -Click [here](https://github.com/kataras/iris/pull/1175) to watch the progress of the upcoming release and the new features that it brings into game. +# Iris -## NOTE for v11.1.x users +[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=for-the-badge)](https://travis-ci.org/kataras/iris) [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/kataras/iris) [![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=blue&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) [![release](https://img.shields.io/badge/release%20-v11.2-0077b3.svg?style=for-the-badge)](https://github.com/kataras/iris/releases) -New users, please do not use the obsolete version of `kataras/iris/websocket` package. As we've noticed from January, it will be fully replaced for the best in the upcoming release. +Iris is a fast, simple yet fully featured and very efficient web framework for Go. It provides a beautifully expressive and easy to use foundation for your next website or API. -New and old users, the next version of `kataras/iris/websocket` will contain Iris-specific helpers and features for the [neffos websocket framework](https://github.com/kataras/neffos). Make yourself a grace and begin to learn it as soon as possible, as it contains a lot of features that the old version couldn't handle, e.g. serve millions of active connections, adapters for gobwas/ws and gorilla/websocket protocol implementations, scaling-out using nats or redis, broadcasting to namespaces, rooms or individuals and more. +Learn what [others say about Iris](https://iris-go.com/testimonials/) and **star** this github repository. -# Iris Web Framework +> Version 11.2 released! [Spread the news](https://dev.to/kataras/iris-version-11-2-released-22bc). - - -[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkataras%2Firis.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkataras%2Firis?ref=badge_shield) [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris) [![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://chat.iris-go.com) [![view examples](https://img.shields.io/badge/routing%20by-example-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/tree/master/_examples/routing) [![release](https://img.shields.io/badge/release%20-v11.1-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/releases) - -Iris is a fast, simple yet fully featured and very efficient web framework for Go. Routing is powered by the [muxie](https://github.com/kataras/muxie#philosophy) project. - -Iris provides a beautifully expressive and easy to use foundation for your next website or API. - -Iris offers a complete and decent solution and support for all gophers around the globe. - -Learn what [others say about Iris](#support) and [star](https://github.com/kataras/iris/stargazers) this github repository to stay [up to date](https://facebook.com/iris.framework). - -## Ghost? No More! Support as first class citizen - -Have you bored of waiting weeks or months for someone to respond to your github issue? Yes, **me too**. If you choose Iris for your main backend development you will never be like a ghost again. - -Iris is one of the few public github repositories that offers real support to individuals and collectivities, including companies. Unbeatable **free support**[*](#support) for three years and still counting. Navigate to the issues to see by yourself. - -In these difficult and restless days **we stand beside you**. We **do not judge bad english writing**, no matter who you are, we will be here for you. - -Check below the features and the hard work that we putted to improve how the internet is built. If you really like it and appreciate it, give a star to this github **repository for the public.** - -## Benchmarks - -### Iris vs .NET Core vs Expressjs - -[![Iris vs .NET Core(C#) vs Node.js (Express)](_benchmarks/benchmarks_graph_22_october_2018_gray.png)](_benchmarks/README.md) - -_Updated at: [Monday, 22 October 2018](_benchmarks/README.md)_ - -### Third-party - -[![](_benchmarks/benchmarks_third_party_source_snapshot_go_23_october_2018.png)](https://github.com/iris-contrib/third-party-benchmarks#full-table) - -> Last updated at: 01 March of 2019. Click to the image to view all results. You can run this in your own hardware by following the [steps here](https://github.com/iris-contrib/third-party-benchmarks#usage). - -## Philosophy - -The Iris philosophy is to provide robust tooling for HTTP, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs. Keep note that, so far, iris is the fastest web framework ever created in terms of performance. - -Iris does not force you to use any specific ORM or template engine. With support for the most used template engines, you can quickly craft the perfect application. - -## Installation - -The only requirement is the [Go Programming Language](https://golang.org/dl/) - -```sh -$ go get -u github.com/kataras/iris -``` - -Iris takes advantage of the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature. You get truly reproducible builds, as this method guards against upstream renames and deletes. +## Learning Iris- +For a more detailed technical documentation you can head over to our [godocs](https://godoc.org/github.com/kataras/iris). And for executable code you can always visit the [_examples](_examples/) repository's subdirectory. -Gerasimos Maropoulos +### Do you like to read while traveling? - - | -