mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
New Community Board, have fun
Former-commit-id: 84bdd3893da5ad28e918e4dc32d2657d27b0ed32
This commit is contained in:
parent
5e4b63acb2
commit
fd6e49c57e
35
.github/CONTRIBUTING.md
vendored
35
.github/CONTRIBUTING.md
vendored
|
@ -1,34 +1 @@
|
||||||
## Code Of Conduct
|
Please navigate through https://github.com/iris-contrib/community-board first to read how you can contribute. You're awesome!
|
||||||
|
|
||||||
The community should respect and follow our new [Code of Conduct](https://github.com/kataras/iris/blob/master/CODE-OF-CONDUCT.md).
|
|
||||||
|
|
||||||
## Before Submitting an Issue
|
|
||||||
|
|
||||||
Navigate through [issues](https://github.com/kataras/issues) and check if it has been already filled by other person.
|
|
||||||
|
|
||||||
|
|
||||||
Before post a new issue, please do an upgrade:
|
|
||||||
|
|
||||||
- Delete `$GOPATH/src/github.com/kataras`
|
|
||||||
- Open shell and execute the command: `go get -u github.com/kataras/iris`
|
|
||||||
- Try to re-produce the issue
|
|
||||||
|
|
||||||
To be aware of the framework's changes and updates please **[star](https://github.com/kataras/iris/stargazers)** and **[watch](https://github.com/kataras/iris/watchers)** the repository.
|
|
||||||
|
|
||||||
Do not discuss things that they're not relative to the framework, keep Github issues useful for newcomers. A Github issue should exists to solve or report a problem.
|
|
||||||
|
|
||||||
> If you want to talk about something else that can't be inside Github issues please [chat](https://gitter.im/iris-go/Lobby) with us.
|
|
||||||
|
|
||||||
## Writing Good Bug Reports and Feature Requests
|
|
||||||
|
|
||||||
File a single issue per problem and feature request, do not file combo issues.
|
|
||||||
|
|
||||||
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix. Therefore:
|
|
||||||
|
|
||||||
* Provide reproducable steps, what the result of the steps was, and what you would have expected.
|
|
||||||
* Description of what you expect to happen
|
|
||||||
* Animated GIFs
|
|
||||||
* Code that demonstrates the issue
|
|
||||||
* Version of Iris
|
|
||||||
* Errors in the Terminal/Console
|
|
||||||
* When you have glide/godep installed, can you reproduce the issue when starting Iris' station without these?
|
|
25
.github/ISSUE_TEMPLATE.md
vendored
25
.github/ISSUE_TEMPLATE.md
vendored
|
@ -1,24 +1,5 @@
|
||||||
Please answer these questions before submitting your issue. Thanks!
|
**Do not create** issues or proposals neither request features **here**.
|
||||||
|
|
||||||
- [x] I have read the [_examples](https://github.com/kataras/iris/tree/master/_examples), [Contributing File](https://github.com/kataras/iris/blob/master/.github/CONTRIBUTING.md).
|
Navigate to the https://github.com/iris-contrib/community-board instead.
|
||||||
|
|
||||||
|
[FAQ](https://github.com/iris-contrib/community-board#community-board)
|
||||||
### What version of Go are you using, minimum 1.8 (`go version`)?
|
|
||||||
|
|
||||||
|
|
||||||
### What operating system and processor architecture are you using (`go env`)?
|
|
||||||
|
|
||||||
|
|
||||||
### What version of Iris are you using?
|
|
||||||
|
|
||||||
|
|
||||||
### What did you do?
|
|
||||||
|
|
||||||
If possible, provide a recipe for reproducing the error.
|
|
||||||
A complete runnable program is good.
|
|
||||||
|
|
||||||
|
|
||||||
### What did you expect to see?
|
|
||||||
|
|
||||||
|
|
||||||
### What did you see instead?
|
|
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -1,6 +1,7 @@
|
||||||
I'd love to see more contributions!
|
I'd love to see more contributions!
|
||||||
|
|
||||||
If you are interested in contributing to the Iris project, please read and understand the [Code of Conduct](https://github.com/kataras/iris/blob/master/CODE-OF-CONDUCT.md) before submitting your [PR](https://github.com/kataras/iris/pulls).
|
Please read [how to create a Proposal](https://github.com/iris-contrib/community-board#creating-a-proposal) first, PR may be rejected if it's not designed as it should.
|
||||||
|
|
||||||
|
If you are interested in contributing to the Iris project, please take a time to read and understand the [Code of Conduct](https://github.com/kataras/iris/blob/master/CODE-OF-CONDUCT.md) before submitting your [PR](https://github.com/kataras/iris/pulls), this is how we make Go great.
|
||||||
|
|
||||||
Don't forget to, first, open an [issue](https://github.com/kataras/iris) to discuss what changes you're willing to push.
|
Thanks!
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
||||||
# my own configuration for vs code, my lovely editor, if someone of you want this, contact with me
|
# my own configuration for vs code, my lovely editor, if someone of you want this, contact with me
|
||||||
.vscode
|
.vscode
|
||||||
# turn off these for now
|
# turn off these for now
|
||||||
.github
|
|
||||||
specs
|
specs
|
|
@ -24,7 +24,7 @@ This code of conduct applies to all repos and communities for kataras-managed op
|
||||||
|
|
||||||
## Reporting Code of Conduct Issues
|
## Reporting Code of Conduct Issues
|
||||||
|
|
||||||
We encourage all communities to resolve issues on their own whenever possible. This builds a broader and deeper understanding and ultimately a healthier interaction. In the event that an issue cannot be resolved locally, please feel free to report your concerns by contacting kataras@tutanota.com.
|
We encourage all communities to resolve issues on their own whenever possible. This builds a broader and deeper understanding and ultimately a healthier interaction. In the event that an issue cannot be resolved locally, please feel free to report your concerns by contacting kataras2006@hotmail.com or kataras@tutanota.com(secure mail).
|
||||||
|
|
||||||
In your report please include:
|
In your report please include:
|
||||||
|
|
||||||
|
|
16
HISTORY.md
16
HISTORY.md
|
@ -41,6 +41,8 @@ cover the internal changes, the difference is so big that anybody can see them w
|
||||||
|
|
||||||
## Changes from [v6](https://github.com/kataras/iris/tree/v6)
|
## Changes from [v6](https://github.com/kataras/iris/tree/v6)
|
||||||
|
|
||||||
|
The whole framework was re-written from zero but I tried to keep the most common public API that iris developers use.
|
||||||
|
|
||||||
Vendoring /w update
|
Vendoring /w update
|
||||||
|
|
||||||
The previous vendor action for v6 was done by-hand, now I'm using the [go dep](https://github.com/golang/dep) tool, I had to do
|
The previous vendor action for v6 was done by-hand, now I'm using the [go dep](https://github.com/golang/dep) tool, I had to do
|
||||||
|
@ -52,17 +54,20 @@ by go dep, but they had lines with the `typealias` feature, which is not ready b
|
||||||
- fix "cannot use internal package" at golang/x/net/ipv4 and ipv6 packages
|
- fix "cannot use internal package" at golang/x/net/ipv4 and ipv6 packages
|
||||||
- rename the interal folder to was-internal, everywhere and fix its references.
|
- rename the interal folder to was-internal, everywhere and fix its references.
|
||||||
- fix "main redeclared in this block"
|
- fix "main redeclared in this block"
|
||||||
- remove the examples folder from everywhere.
|
- remove all examples folders.
|
||||||
|
- remove main.go files on jsondiff lib, used by gavv/httpexpect, produces errors on `test -v ./...` while jd and jp folders are not used at all.
|
||||||
|
|
||||||
The go dep tool does what is says, as expected, don't be afraid of it now.
|
The go dep tool does what is says, as expected, don't be afraid of it now.
|
||||||
I am totally recommending this tool for package authors, even if it's in its alpha state.
|
I am totally recommending this tool for package authors, even if it's in its alpha state.
|
||||||
I remember when Iris was in its alpha state and it had 4k stars on its first weeks/or month and that helped me a lot to fix reported bugs by users and make the framework even better, so give love to go dep from today!
|
I remember when Iris was in its alpha state and it had 4k stars on its first weeks/or month and that helped me a lot to fix reported bugs by users and make the framework even better, so give love to go dep from today!
|
||||||
|
|
||||||
General
|
General
|
||||||
|
|
||||||
|
- Several enhancements for the typescript transpiler, view engine, websocket server and sessions manager
|
||||||
- All `Listen` methods replaced with a single `Run` method, see [here](https://github.com/kataras/iris/tree/master/_examples/beginner/listening)
|
- All `Listen` methods replaced with a single `Run` method, see [here](https://github.com/kataras/iris/tree/master/_examples/beginner/listening)
|
||||||
- Configuration, easier to modify the defaults, see [here](https://github.com/kataras/iris/tree/master/_examples/beginner/cofiguration)
|
- Configuration, easier to modify the defaults, see [here](https://github.com/kataras/iris/tree/master/_examples/beginner/cofiguration)
|
||||||
- `HandlerFunc` removed, just `Handler` of `func(context.Context)` where context.Context derives from `import "github.com/kataras/iris/context"` (on August this import path will be optional)
|
- `HandlerFunc` removed, just `Handler` of `func(context.Context)` where context.Context derives from `import "github.com/kataras/iris/context"` (on August this import path will be optional)
|
||||||
- Simplify API, i.e instead of all these, `Handle,HandleFunc,Use,UseFunc,Done,DoneFunc,UseGlobal,UseGlobalFunc` use `Handle,Use,Done,UseGlobal`.
|
- Simplify API, i.e: instead of `Handle,HandleFunc,Use,UseFunc,Done,DoneFunc,UseGlobal,UseGlobalFunc` use `Handle,Use,Done,UseGlobal`.
|
||||||
- Response time decreased even more (9-35%, depends on the application)
|
- Response time decreased even more (9-35%, depends on the application)
|
||||||
- The `Adaptors` idea replaced with a more structural design pattern, but you have to apply these changes:
|
- The `Adaptors` idea replaced with a more structural design pattern, but you have to apply these changes:
|
||||||
- `app.Adapt(view.HTML/Pug/Amber/Django/Handlebars...)` -> `app.AttachView(view.HTML/Pug/Amber/Django/Handlebars...)`
|
- `app.Adapt(view.HTML/Pug/Amber/Django/Handlebars...)` -> `app.AttachView(view.HTML/Pug/Amber/Django/Handlebars...)`
|
||||||
|
@ -80,7 +85,7 @@ Routing
|
||||||
- `{firstname:alphabetical}`,
|
- `{firstname:alphabetical}`,
|
||||||
- `{requestfile:file}` ,
|
- `{requestfile:file}` ,
|
||||||
- `{mylowercaseParam regexp([a-z]+)}`.
|
- `{mylowercaseParam regexp([a-z]+)}`.
|
||||||
- The previous syntax of `:param` and `*param` syntax still working as expected. Previous rules for paths confliction remain as they were.
|
- The previous syntax of `:param` and `*param` still working as expected. Previous rules for paths confliction remain as they were.
|
||||||
- Also, path parameter names should be only alphabetical now, numbers and symbols are not allowed (for your own good, I have seen a lot the last year...).
|
- Also, path parameter names should be only alphabetical now, numbers and symbols are not allowed (for your own good, I have seen a lot the last year...).
|
||||||
|
|
||||||
Click [here](https://github.com/kataras/iris/tree/master/_examples/beginner/routing) for details.
|
Click [here](https://github.com/kataras/iris/tree/master/_examples/beginner/routing) for details.
|
||||||
|
@ -91,12 +96,12 @@ Context
|
||||||
- in order to be able to use a custom context and/or catch lifetime like `BeginRequest` and `EndRequest` from context itself, see below
|
- in order to be able to use a custom context and/or catch lifetime like `BeginRequest` and `EndRequest` from context itself, see below
|
||||||
- `context.JSON, context.JSONP, context.XML, context.Markdown, context.HTML` work faster
|
- `context.JSON, context.JSONP, context.XML, context.Markdown, context.HTML` work faster
|
||||||
- `context.Render("filename.ext", bindingViewData{}, options) ` -> `context.View("filename.ext")`
|
- `context.Render("filename.ext", bindingViewData{}, options) ` -> `context.View("filename.ext")`
|
||||||
- `View` renders only templates, it will not try to search if you have a restful renderer adapted, because, now, you can do it via method overloading using a custom Context.
|
- `View` renders only templates, it will not try to search if you have a restful renderer adapted, because, now, you can do it via method overriding using a custom Context.
|
||||||
- Able to set `context.ViewData` and `context.ViewLayout` via middleware when executing a template.
|
- Able to set `context.ViewData` and `context.ViewLayout` via middleware when executing a template.
|
||||||
- `context.SetStatusCode(statusCode)` -> `context.StatusCode(statusCode)`
|
- `context.SetStatusCode(statusCode)` -> `context.StatusCode(statusCode)`
|
||||||
- which is equivalent with the old `EmitError` too:
|
- which is equivalent with the old `EmitError` too:
|
||||||
- if status code >=400 given can automatically fire a custom http error handler if response wasn't written already.
|
- if status code >=400 given can automatically fire a custom http error handler if response wasn't written already.
|
||||||
- `context.GetStatusCode` -> `context.GetStatusCode()`.
|
- `context.StatusCode()` -> `context.GetStatusCode()`
|
||||||
- `app.OnError` -> `app.OnErrorCode`
|
- `app.OnError` -> `app.OnErrorCode`
|
||||||
- Errors per party are removed by-default, you can just use one global error handler with logic like "if path starts with 'prefix' fire this error handler, else...".
|
- Errors per party are removed by-default, you can just use one global error handler with logic like "if path starts with 'prefix' fire this error handler, else...".
|
||||||
- Easy way to change Iris' default `Context` with a custom one, see [here](https://github.com/kataras/iris/tree/master/_examples/intermediate/custom-context)
|
- Easy way to change Iris' default `Context` with a custom one, see [here](https://github.com/kataras/iris/tree/master/_examples/intermediate/custom-context)
|
||||||
|
@ -109,7 +114,6 @@ with the status code that user gave with `context.StatusCode` or with `200 OK`,
|
||||||
- **the new API is even more easier to read, understand and use.**
|
- **the new API is even more easier to read, understand and use.**
|
||||||
|
|
||||||
Server
|
Server
|
||||||
- Several enhancements for the typescript transpiler, view engine, websocket server and sessions manager
|
|
||||||
- Able to set custom underline *http.Server(s) with new Host (aka Server Supervisor) feature
|
- Able to set custom underline *http.Server(s) with new Host (aka Server Supervisor) feature
|
||||||
- `Done` and `Err` channels to catch shutdown or any errors on custom hosts,
|
- `Done` and `Err` channels to catch shutdown or any errors on custom hosts,
|
||||||
- Schedule custom tasks(with cancelation) when server is running, see [here](https://github.com/kataras/iris/tree/master/_examples/intermediate/graceful-shutdown)
|
- Schedule custom tasks(with cancelation) when server is running, see [here](https://github.com/kataras/iris/tree/master/_examples/intermediate/graceful-shutdown)
|
||||||
|
|
|
@ -165,9 +165,9 @@ $ rizla main.go
|
||||||
|
|
||||||
I'm sorry for taking this personally but I really need to thanks each one of them because they stood up [♡](https://github.com/kataras/iris#support) for me when others trying to "bullying" my personality in order to deflame Iris.
|
I'm sorry for taking this personally but I really need to thanks each one of them because they stood up [♡](https://github.com/kataras/iris#support) for me when others trying to "bullying" my personality in order to deflame Iris.
|
||||||
|
|
||||||
All of us should read and repsect the official [golang](https://golang.org/conduct) and [iris](CODE-OF-CONDUCT.md) community **Code of Conduct**. This type of commitment and communication is the way of making Go great.
|
All of us should read and respect the official [golang](https://golang.org/conduct) and [iris](CODE-OF-CONDUCT.md) community **Code of Conduct**. This type of commitment and communication is the way of making Go great.
|
||||||
|
|
||||||
<!-- on each chance, i.e when iris posts were trending on sites like dzone and medium they spamming an awful full of lies and deflamation blog post. We all should read and repsect the official golang's and iris' Code of Conduct. -->
|
<!-- on each chance, i.e when iris posts were trending on sites like dzone and medium they spamming an awful full of lies and deflamation blog post. We all should read and respect the official golang's and iris' Code of Conduct. -->
|
||||||
|
|
||||||
[Juan Sebastián Suárez Valencia](https://github.com/Juanses) donated 20 EUR at September 11 of 2016
|
[Juan Sebastián Suárez Valencia](https://github.com/Juanses) donated 20 EUR at September 11 of 2016
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ Feature Overview
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
- Focus on high performance
|
- Focus on high performance
|
||||||
- Build RESTful APIs with our expressionist path syntax, i.e `{userid:int min(1)}`, `{asset:path}`, `{lowercase: regexp([a-z]+)}`
|
- Build RESTful APIs with our expressionist path syntax, i.e `{userid:int min(1)}`, `{asset:path}`, `{custom regexp([a-z]+)}`
|
||||||
- Automatically install and serve certificates from https://letsencrypt.org
|
- Automatically install and serve certificates from https://letsencrypt.org
|
||||||
- Robust routing and middleware ecosystem
|
- Robust routing and middleware ecosystem
|
||||||
- Request-Scoped Transactions
|
- Request-Scoped Transactions
|
||||||
|
|
|
@ -13,9 +13,9 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/boltdb/bolt"
|
"github.com/boltdb/bolt"
|
||||||
|
|
||||||
"github.com/kataras/iris"
|
"github.com/kataras/iris"
|
||||||
"github.com/kataras/iris/context"
|
"github.com/kataras/iris/context"
|
||||||
|
|
||||||
"github.com/kataras/iris/view"
|
"github.com/kataras/iris/view"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
// Create your own custom Context, put any fields you wanna need.
|
// Create your own custom Context, put any fields you wanna need.
|
||||||
type MyContext struct {
|
type MyContext struct {
|
||||||
// Optional Part 1: embed (optional but required if you don't want to override all context's methods)
|
// Optional Part 1: embed (optional but required if you don't want to override all context's methods)
|
||||||
context.Context // it's the internal/Context.go but you don't need to know it.
|
context.Context // it's the context/context.go#context struct but you don't need to know it.
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ context.Context = &MyContext{} // optionally: validate on compile-time if MyContext implements context.Context.
|
var _ context.Context = &MyContext{} // optionally: validate on compile-time if MyContext implements context.Context.
|
||||||
|
@ -60,14 +60,14 @@ func main() {
|
||||||
})
|
})
|
||||||
|
|
||||||
// register your route, as you normally do
|
// register your route, as you normally do
|
||||||
app.Handle("GET", "/", recordWhichContetsJustForProofOfConcept, func(ctx context.Context) {
|
app.Handle("GET", "/", recordWhichContextJustForProofOfConcept, func(ctx context.Context) {
|
||||||
// use the context's overridden HTML method.
|
// use the context's overridden HTML method.
|
||||||
ctx.HTML("<h1> Hello from my custom context's HTML! </h1>")
|
ctx.HTML("<h1> Hello from my custom context's HTML! </h1>")
|
||||||
})
|
})
|
||||||
|
|
||||||
// this will be executed by the MyContext.Context
|
// this will be executed by the MyContext.Context
|
||||||
// if MyContext is not directly define the View function by itself.
|
// if MyContext is not directly define the View function by itself.
|
||||||
app.Handle("GET", "/hi/{firstname:alphabetical}", recordWhichContetsJustForProofOfConcept, func(ctx context.Context) {
|
app.Handle("GET", "/hi/{firstname:alphabetical}", recordWhichContextJustForProofOfConcept, func(ctx context.Context) {
|
||||||
firstname := ctx.Values().GetString("firstname")
|
firstname := ctx.Values().GetString("firstname")
|
||||||
|
|
||||||
ctx.ViewData("firstname", firstname)
|
ctx.ViewData("firstname", firstname)
|
||||||
|
@ -80,7 +80,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// should always print "($PATH) Handler is executing from 'MyContext'"
|
// should always print "($PATH) Handler is executing from 'MyContext'"
|
||||||
func recordWhichContetsJustForProofOfConcept(ctx context.Context) {
|
func recordWhichContextJustForProofOfConcept(ctx context.Context) {
|
||||||
ctx.Application().Log("(%s) Handler is executing from: '%s'", ctx.Path(), reflect.TypeOf(ctx).Elem().Name())
|
ctx.Application().Log("(%s) Handler is executing from: '%s'", ctx.Path(), reflect.TypeOf(ctx).Elem().Name())
|
||||||
ctx.Next()
|
ctx.Next()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user