From fbb3bb89f09bbd6e5e1bc140dd2596a3bd6a4b7f Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Wed, 28 Mar 2018 11:45:05 +0800 Subject: [PATCH 1/9] Update README.md Former-commit-id: ea1325f29246fa90219344434f5bc7e9317e62db --- _examples/README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/_examples/README.md b/_examples/README.md index 9b7a3b53..a69c5996 100644 --- a/_examples/README.md +++ b/_examples/README.md @@ -1,30 +1,30 @@ -# Examples +# 示例 -Please do learn how [net/http](https://golang.org/pkg/net/http/) std package works, first. +请先学习如何使用 [net/http](https://golang.org/pkg/net/http/) -This folder provides easy to understand code snippets on how to get started with [iris](https://github.com/kataras/iris) micro web framework. +这里包含大部分 [iris](https://github.com/kataras/iris) 网络微框架的简单使用示例 -It doesn't always contain the "best ways" but it does cover each important feature that will make you so excited to GO with iris! +这些示例不一定是最优解,但涵盖了 Iris 的大部分重要功能。 -### Overview +### 概览 - [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://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) +- [基础](overview/main.go) +- [教程: 在线人数](tutorial/online-visitors/main.go) +- [教程: A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) +- [教程: 结合 BoltDB 生成短网址](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7) +- [教程: 用安卓设备搭建服务器 (**MUST**)](https://twitter.com/ThePracticalDev/status/892022594031017988) - [POC: Convert the medium-sized project "Parrot" from native to Iris](https://github.com/iris-contrib/parrot) - [POC: Isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/kataras/iris-starter-kit) -- [Tutorial: DropzoneJS Uploader](tutorial/dropzonejs) -- [Tutorial: Caddy](tutorial/caddy) -- [Tutorial:Iris Go Framework + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c) +- [教程: DropzoneJS 上传](tutorial/dropzonejs) +- [教程: Caddy 服务器使用](tutorial/caddy) +- [教程: Iris + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c) -### Structuring +### 目录结构 -Nothing stops you from using your favorite folder structure. Iris is a low level web framework, it has got MVC first-class support but it doesn't limit your folder structure, this is your choice. +Iris 是个底层框架, 对 MVC 模式有很好的支持,但不限制文件夹结构,你可以随意组织你的代码。 -Structuring depends on your own needs. We can't tell you how to design your own application for sure but you're free to take a closer look to the examples below; you may find something useful that you can borrow for your app; +如何组织代码取决于你的需求. 我们无法告诉你如何设计程序,但你可以仔细查看下面的示例,也许有些片段可以直接放到你的程序里。 - [Bootstrapper](structuring/bootstrap) - [MVC with Repository and Service layer Overview](structuring/mvc-plus-repository-and-service-layers) From a79496de6d8ee5b681a965c1f7b227bd1874fd8d Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Wed, 28 Mar 2018 12:21:17 +0800 Subject: [PATCH 2/9] Create README_ZH.md Former-commit-id: 35656f423a935b9fe4c0f639bdcac591b98c4667 --- _examples/README_ZH.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 _examples/README_ZH.md diff --git a/_examples/README_ZH.md b/_examples/README_ZH.md new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/_examples/README_ZH.md @@ -0,0 +1 @@ + From 58c9de3ab7d5a369c2fd938a8a068045e355f8cc Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Wed, 28 Mar 2018 12:22:29 +0800 Subject: [PATCH 3/9] Update README_ZH.md Former-commit-id: 61d8df659e22d518de09d4a35cdf93277b5bc3d6 --- _examples/README_ZH.md | 435 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 435 insertions(+) diff --git a/_examples/README_ZH.md b/_examples/README_ZH.md index 8b137891..b07dc0f4 100644 --- a/_examples/README_ZH.md +++ b/_examples/README_ZH.md @@ -1 +1,436 @@ +# 示例 + +请先学习如何使用 [net/http](https://golang.org/pkg/net/http/) + +这里包含大部分 [iris](https://github.com/kataras/iris) 网络微框架的简单使用示例 + +这些示例不一定是最优解,但涵盖了 Iris 的大部分重要功能。 + +### 概览 + +- [Hello world!](hello-world/main.go) +- [基础](overview/main.go) +- [教程: 在线人数](tutorial/online-visitors/main.go) +- [教程: A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) +- [教程: 结合 BoltDB 生成短网址](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7) +- [教程: 用安卓设备搭建服务器 (**MUST**)](https://twitter.com/ThePracticalDev/status/892022594031017988) +- [POC: Convert the medium-sized project "Parrot" from native to Iris](https://github.com/iris-contrib/parrot) +- [POC: Isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/kataras/iris-starter-kit) +- [教程: DropzoneJS 上传](tutorial/dropzonejs) +- [教程: Caddy 服务器使用](tutorial/caddy) +- [教程: Iris + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c) + +### 目录结构 + +Iris 是个底层框架, 对 MVC 模式有很好的支持,但不限制文件夹结构,你可以随意组织你的代码。 + +如何组织代码取决于你的需求. 我们无法告诉你如何设计程序,但你可以仔细查看下面的示例,也许有些片段可以直接放到你的程序里。 + +- [Bootstrapper](structuring/bootstrap) +- [MVC with Repository and Service layer Overview](structuring/mvc-plus-repository-and-service-layers) +- [Login (MVC with Single Responsibility package)](structuring/login-mvc-single-responsibility-package) +- [Login (MVC with Datamodels, Datasource, Repository and Service layer)](structuring/login-mvc) + +### HTTP Listening + +- [Common, with address](http-listening/listen-addr/main.go) + * [omit server errors](http-listening/listen-addr/omit-server-errors/main.go) +- [UNIX socket file](http-listening/listen-unix/main.go) +- [TLS](http-listening/listen-tls/main.go) +- [Letsencrypt (Automatic Certifications)](http-listening/listen-letsencrypt/main.go) +- [Notify on shutdown](http-listening/notify-on-shutdown/main.go) +- Custom TCP Listener + * [common net.Listener](http-listening/custom-listener/main.go) + * [SO_REUSEPORT for unix systems](http-listening/custom-listener/unix-reuseport/main.go) +- Custom HTTP Server + * [easy way](http-listening/custom-httpserver/easy-way/main.go) + * [std way](http-listening/custom-httpserver/std-way/main.go) + * [multi server instances](http-listening/custom-httpserver/multi/main.go) +- Graceful Shutdown + * [using the `RegisterOnInterrupt`](http-listening/graceful-shutdown/default-notifier/main.go) + * [using a custom notifier](http-listening/graceful-shutdown/custom-notifier/main.go) + +### Configuration + +- [Functional](configuration/functional/main.go) +- [From Configuration Struct](configuration/from-configuration-structure/main.go) +- [Import from YAML file](configuration/from-yaml-file/main.go) + * [Share Configuration between multiple instances](configuration/from-yaml-file/shared-configuration/main.go) +- [Import from TOML file](configuration/from-toml-file/main.go) + +### Routing, Grouping, Dynamic Path Parameters, "Macros" and Custom Context + +* `app.Get("{userid:int min(1)}", myHandler)` +* `app.Post("{asset:path}", myHandler)` +* `app.Put("{custom:string regexp([a-z]+)}", myHandler)` + +Note: unlike other routers you'd seen, iris' router can handle things like these: +```go +// Matches all GET requests prefixed with "/assets/" +app.Get("/assets/{asset:path}", assetsWildcardHandler) + +// Matches only GET "/" +app.Get("/", indexHandler) +// Matches only GET "/about" +app.Get("/about", aboutHandler) + +// Matches all GET requests prefixed with "/profile/" +// and followed by a single path part +app.Get("/profile/{username:string}", userHandler) +// Matches only GET "/profile/me" because +// it does not conflict with /profile/{username:string} +// or the root wildcard {root:path} +app.Get("/profile/me", userHandler) + +// Matches all GET requests prefixed with /users/ +// and followed by a number which should be equal or bigger than 1 +app.Get("/user/{userid:int min(1)}", getUserHandler) +// Matches all requests DELETE prefixed with /users/ +// and following by a number which should be equal or bigger than 1 +app.Delete("/user/{userid:int min(1)}", deleteUserHandler) + +// Matches all GET requests except "/", "/about", anything starts with "/assets/" etc... +// because it does not conflict with the rest of the routes. +app.Get("{root:path}", rootWildcardHandler) +``` + +Navigate through examples for a better understanding. + +- [Overview](routing/overview/main.go) +- [Basic](routing/basic/main.go) +- [Controllers](mvc) +- [Custom HTTP Errors](routing/http-errors/main.go) +- [Dynamic Path](routing/dynamic-path/main.go) + * [root level wildcard path](routing/dynamic-path/root-wildcard/main.go) +- [Reverse routing](routing/reverse/main.go) +- [Custom wrapper](routing/custom-wrapper/main.go) +- Custom Context + * [method overriding](routing/custom-context/method-overriding/main.go) + * [new implementation](routing/custom-context/new-implementation/main.go) +- [Route State](routing/route-state/main.go) +- [Writing a middleware](routing/writing-a-middleware) + * [per-route](routing/writing-a-middleware/per-route/main.go) + * [globally](routing/writing-a-middleware/globally/main.go) + +### hero + +- [Basic](hero/basic/main.go) +- [Overview](hero/overview) + +### MVC + +![](mvc/web_mvc_diagram.png) + +Iris has **first-class support for the MVC (Model View Controller) pattern**, you'll not find +these stuff anywhere else in the Go world. + +Iris web framework supports Request data, Models, Persistence Data and Binding +with the fastest possible execution. + +**Characteristics** + +All HTTP Methods are supported, for example if want to serve `GET` +then the controller should have a function named `Get()`, +you can define more than one method function to serve in the same Controller. + +Serve custom controller's struct's methods as handlers with custom paths(even with regex parametermized path) via the `BeforeActivation` custom event callback, per-controller. Example: + +```go +import ( + "github.com/kataras/iris" + "github.com/kataras/iris/mvc" +) + +func main() { + app := iris.New() + mvc.Configure(app.Party("/root"), myMVC) + app.Run(iris.Addr(":8080")) +} + +func myMVC(app *mvc.Application) { + // app.Register(...) + // app.Router.Use/UseGlobal/Done(...) + app.Handle(new(MyController)) +} + +type MyController struct {} + +func (m *MyController) BeforeActivation(b mvc.BeforeActivation) { + // b.Dependencies().Add/Remove + // b.Router().Use/UseGlobal/Done // and any standard API call you already know + + // 1-> Method + // 2-> Path + // 3-> The controller's function name to be parsed as handler + // 4-> Any handlers that should run before the MyCustomHandler + b.Handle("GET", "/something/{id:long}", "MyCustomHandler", anyMiddleware...) +} + +// GET: http://localhost:8080/root +func (m *MyController) Get() string { return "Hey" } + +// GET: http://localhost:8080/root/something/{id:long} +func (m *MyController) MyCustomHandler(id int64) string { return "MyCustomHandler says Hey" } +``` + +Persistence data inside your Controller struct (share data between requests) +by defining services to the Dependencies or have a `Singleton` controller scope. + +Share the dependencies between controllers or register them on a parent MVC Application, and ability +to modify dependencies per-controller on the `BeforeActivation` optional event callback inside a Controller, +i.e `func(c *MyController) BeforeActivation(b mvc.BeforeActivation) { b.Dependencies().Add/Remove(...) }`. + +Access to the `Context` as a controller's field(no manual binding is neede) i.e `Ctx iris.Context` or via a method's input argument, i.e `func(ctx iris.Context, otherArguments...)`. + +Models inside your Controller struct (set-ed at the Method function and rendered by the View). +You can return models from a controller's method or set a field in the request lifecycle +and return that field to another method, in the same request lifecycle. + +Flow as you used to, mvc application has its own `Router` which is a type of `iris/router.Party`, the standard iris api. +`Controllers` can be registered to any `Party`, including Subdomains, the Party's begin and done handlers work as expected. + +Optional `BeginRequest(ctx)` function to perform any initialization before the method execution, +useful to call middlewares or when many methods use the same collection of data. + +Optional `EndRequest(ctx)` function to perform any finalization after any method executed. + +Inheritance, recursively, see for example our `mvc.SessionController`, it has the `Session *sessions.Session` and `Manager *sessions.Sessions` as embedded fields +which are filled by its `BeginRequest`, [here](https://github.com/kataras/iris/blob/master/mvc/session_controller.go). +This is just an example, you could use the `sessions.Session` which returned from the manager's `Start` as a dynamic dependency to the MVC Application, i.e +`mvcApp.Register(sessions.New(sessions.Config{Cookie: "iris_session_id"}).Start)`. + +Access to the dynamic path parameters via the controller's methods' input arguments, no binding is needed. +When you use the Iris' default syntax to parse handlers from a controller, you need to suffix the methods +with the `By` word, uppercase is a new sub path. Example: + +If `mvc.New(app.Party("/user")).Handle(new(user.Controller))` + +- `func(*Controller) Get()` - `GET:/user`. +- `func(*Controller) Post()` - `POST:/user`. +- `func(*Controller) GetLogin()` - `GET:/user/login` +- `func(*Controller) PostLogin()` - `POST:/user/login` +- `func(*Controller) GetProfileFollowers()` - `GET:/user/profile/followers` +- `func(*Controller) PostProfileFollowers()` - `POST:/user/profile/followers` +- `func(*Controller) GetBy(id int64)` - `GET:/user/{param:long}` +- `func(*Controller) PostBy(id int64)` - `POST:/user/{param:long}` + +If `mvc.New(app.Party("/profile")).Handle(new(profile.Controller))` + +- `func(*Controller) GetBy(username string)` - `GET:/profile/{param:string}` + +If `mvc.New(app.Party("/assets")).Handle(new(file.Controller))` + +- `func(*Controller) GetByWildard(path string)` - `GET:/assets/{param:path}` + + Supported types for method functions receivers: int, int64, bool and string. + +Response via output arguments, optionally, i.e + +```go +func(c *ExampleController) Get() string | + (string, string) | + (string, int) | + int | + (int, string) | + (string, error) | + error | + (int, error) | + (any, bool) | + (customStruct, error) | + customStruct | + (customStruct, int) | + (customStruct, string) | + mvc.Result or (mvc.Result, error) +``` + +where [mvc.Result](https://github.com/kataras/iris/blob/master/mvc/func_result.go) is an interface which contains only that function: `Dispatch(ctx iris.Context)`. + +## Using Iris MVC for code reuse + +By creating components that are independent of one another, developers are able to reuse components quickly and easily in other applications. The same (or similar) view for one application can be refactored for another application with different data because the view is simply handling how the data is being displayed to the user. + +If you're new to back-end web development read about the MVC architectural pattern first, a good start is that [wikipedia article](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller). + +Follow the examples below, + +- [Hello world](mvc/hello-world/main.go) **UPDATED** +- [Session Controller](mvc/session-controller/main.go) **UPDATED** +- [Overview - Plus Repository and Service layers](mvc/overview) **UPDATED** +- [Login showcase - Plus Repository and Service layers](mvc/login) **UPDATED** +- [Singleton](mvc/singleton) **NEW** +- [Websocket Controller](mvc/websocket) **NEW** +- [Register Middleware](mvc/middleware) **NEW** +- [Vue.js Todo MVC](tutorial/vuejs-todo-mvc) **NEW** + +### Subdomains + +- [Single](subdomains/single/main.go) +- [Multi](subdomains/multi/main.go) +- [Wildcard](subdomains/wildcard/main.go) +- [WWW](subdomains/www/main.go) +- [Redirect fast](subdomains/redirect/main.go) + +### Convert `http.Handler/HandlerFunc` + +- [From func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)](convert-handlers/negroni-like/main.go) +- [From http.Handler or http.HandlerFunc](convert-handlers/nethttp/main.go) +- [From func(http.HandlerFunc) http.HandlerFunc](convert-handlers/real-usecase-raven/writing-middleware/main.go) + +### View + +| Engine | Declaration | +| -----------|-------------| +| template/html | `iris.HTML(...)` | +| django | `iris.Django(...)` | +| handlebars | `iris.Handlebars(...)` | +| amber | `iris.Amber(...)` | +| pug(jade) | `iris.Pug(...)` | + +- [Overview](view/overview/main.go) +- [Hi](view/template_html_0/main.go) +- [A simple Layout](view/template_html_1/main.go) +- [Layouts: `yield` and `render` tmpl funcs](view/template_html_2/main.go) +- [The `urlpath` tmpl func](view/template_html_3/main.go) +- [The `url` tmpl func](view/template_html_4/main.go) +- [Inject Data Between Handlers](view/context-view-data/main.go) +- [Embedding Templates Into App Executable File](view/embedding-templates-into-app/main.go) +- [Write to a custom `io.Writer`](view/write-to) + +You can serve [quicktemplate](https://github.com/valyala/quicktemplate) and [hero templates](https://github.com/shiyanhui/hero/hero) files too, simply by using the `context#ResponseWriter`, take a look at the [http_responsewriter/quicktemplate](http_responsewriter/quicktemplate) and [http_responsewriter/herotemplate](http_responsewriter/herotemplate) examples. + +### Authentication + +- [Basic Authentication](authentication/basicauth/main.go) +- [OAUth2](authentication/oauth2/main.go) +- [JWT](experimental-handlers/jwt/main.go) +- [Sessions](#sessions) + +### File Server + +- [Favicon](file-server/favicon/main.go) +- [Basic](file-server/basic/main.go) +- [Embedding Files Into App Executable File](file-server/embedding-files-into-app/main.go) +- [Embedding Gziped Files Into App Executable File](file-server/embedding-gziped-files-into-app/main.go) **NEW** +- [Send/Force-Download Files](file-server/send-files/main.go) +- Single Page Applications + * [single Page Application](file-server/single-page-application/basic/main.go) + * [embedded Single Page Application](file-server/single-page-application/embedded-single-page-application/main.go) + * [embedded Single Page Application with other routes](file-server/single-page-application/embedded-single-page-application-with-other-routes/main.go) + +### How to Read from `context.Request() *http.Request` + +- [Read JSON](http_request/read-json/main.go) +- [Read XML](http_request/read-xml/main.go) +- [Read Form](http_request/read-form/main.go) +- [Read Custom per type](http_request/read-custom-per-type/main.go) +- [Read Custom via Unmarshaler](http_request/read-custom-via-unmarshaler/main.go) +- [Upload/Read File](http_request/upload-file/main.go) +- [Upload multiple files with an easy way](http_request/upload-files/main.go) + +> The `context.Request()` returns the same *http.Request you already know, these examples show some places where the Context uses this object. Besides that you can use it as you did before iris. + +### How to Write to `context.ResponseWriter() http.ResponseWriter` + +- [Write `valyala/quicktemplate` templates](http_responsewriter/quicktemplate) +- [Write `shiyanhui/hero` templates](http_responsewriter/herotemplate) +- [Text, Markdown, HTML, JSON, JSONP, XML, Binary](http_responsewriter/write-rest/main.go) +- [Write Gzip](http_responsewriter/write-gzip/main.go) +- [Stream Writer](http_responsewriter/stream-writer/main.go) +- [Transactions](http_responsewriter/transactions/main.go) + +> The `context/context#ResponseWriter()` returns an enchament version of a http.ResponseWriter, these examples show some places where the Context uses this object. Besides that you can use it as you did before iris. + +### ORM + +- [Using xorm(Mysql, MyMysql, Postgres, Tidb, **SQLite**, MsSql, MsSql, Oracle)](orm/xorm/main.go) + +### Miscellaneous + +- [Request Logger](http_request/request-logger/main.go) + * [log requests to a file](http_request/request-logger/request-logger-file/main.go) +- [Localization and Internationalization](miscellaneous/i18n/main.go) +- [Recovery](miscellaneous/recover/main.go) +- [Profiling (pprof)](miscellaneous/pprof/main.go) +- [Internal Application File Logger](miscellaneous/file-logger/main.go) +- [Google reCAPTCHA](miscellaneous/recaptcha/main.go) + +### Experimental Handlers + +- [Casbin wrapper](experimental-handlers/casbin/wrapper/main.go) +- [Casbin middleware](experimental-handlers/casbin/middleware/main.go) +- [Cloudwatch](experimental-handlers/cloudwatch/simple/main.go) +- [CORS](experimental-handlers/cors/simple/main.go) +- [JWT](experimental-handlers/jwt/main.go) +- [Newrelic](experimental-handlers/newrelic/simple/main.go) +- [Prometheus](experimental-handlers/prometheus/simple/main.go) +- [Secure](experimental-handlers/secure/simple/main.go) +- [Tollboothic](experimental-handlers/tollboothic/limit-handler/main.go) +- [Cross-Site Request Forgery Protection](experimental-handlers/csrf/main.go) + +#### More + +https://github.com/kataras/iris/tree/master/middleware#third-party-handlers + +### Automated API Documentation + +- [yaag](apidoc/yaag/main.go) + +### Testing + +The `httptest` package is your way for end-to-end HTTP testing, it uses the httpexpect library created by our friend, [gavv](https://github.com/gavv). + +[Example](testing/httptest/main_test.go) + +### Caching + +iris cache library lives on its own [package](https://github.com/kataras/iris/tree/master/cache). + +- [Simple](cache/simple/main.go) +- [Client-Side (304)](cache/client-side/main.go) - part of the iris context core + +> You're free to use your own favourite caching package if you'd like so. + +### Sessions + +iris session manager lives on its own [package](https://github.com/kataras/iris/tree/master/sessions). + +- [Overview](sessions/overview/main.go) +- [Standalone](sessions/standalone/main.go) +- [Secure Cookie](sessions/securecookie/main.go) +- [Flash Messages](sessions/flash-messages/main.go) +- [Databases](sessions/database) + * [File](sessions/database/file/main.go) + * [BoltDB](sessions/database/boltdb/main.go) + * [Badger](sessions/database/badger/main.go) + * [LevelDB](sessions/database/leveldb/main.go) + * [Redis](sessions/database/redis/main.go) + +> You're free to use your own favourite sessions package if you'd like so. + +### Websockets + +iris websocket library lives on its own [package](https://github.com/kataras/iris/tree/master/websocket). + +The package is designed to work with raw websockets although its API is similar to the famous [socket.io](https://socket.io). I have read an article recently and I felt very contented about my decision to design a **fast** websocket-**only** package for Iris and not a backwards socket.io-like package. You can read that article by following this link: https://medium.com/@ivanderbyl/why-you-don-t-need-socket-io-6848f1c871cd. + +- [Chat](websocket/chat/main.go) +- [Native Messages](websocket/native-messages/main.go) +- [Connection List](websocket/connectionlist/main.go) +- [TLS Enabled](websocket/secure/main.go) +- [Custom Raw Go Client](websocket/custom-go-client/main.go) +- [Third-Party socket.io](websocket/third-party-socketio/main.go) + +> You're free to use your own favourite websockets package if you'd like so. + +### Typescript Automation Tools + +typescript automation tools have their own repository: [https://github.com/kataras/iris/tree/master/typescript](https://github.com/kataras/iris/tree/master/typescript) **it contains examples** + +> I'd like to tell you that you can use your favourite but I don't think you will find such a thing anywhere else. + +### Hey, You + +Developers should read the [godocs](https://godoc.org/github.com/kataras/iris) and https://docs.iris-go.com for a better understanding. + +Psst, I almost forgot; do not forget to [star or watch](https://github.com/kataras/iris/stargazers) the project in order to stay updated with the latest tech trends, it never takes more than a second! From 2b0280b64670d66eac4447a6d6bbac36d92f7ab0 Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Wed, 28 Mar 2018 12:23:06 +0800 Subject: [PATCH 4/9] Update README.md Former-commit-id: 86b6b483349c30211234626b91723a8f35d6a12f --- _examples/README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/_examples/README.md b/_examples/README.md index a69c5996..9b7a3b53 100644 --- a/_examples/README.md +++ b/_examples/README.md @@ -1,30 +1,30 @@ -# 示例 +# Examples -请先学习如何使用 [net/http](https://golang.org/pkg/net/http/) +Please do learn how [net/http](https://golang.org/pkg/net/http/) std package works, first. -这里包含大部分 [iris](https://github.com/kataras/iris) 网络微框架的简单使用示例 +This folder provides easy to understand code snippets on how to get started with [iris](https://github.com/kataras/iris) micro web framework. -这些示例不一定是最优解,但涵盖了 Iris 的大部分重要功能。 +It doesn't always contain the "best ways" but it does cover each important feature that will make you so excited to GO with iris! -### 概览 +### Overview - [Hello world!](hello-world/main.go) -- [基础](overview/main.go) -- [教程: 在线人数](tutorial/online-visitors/main.go) -- [教程: A Todo MVC Application using Iris and Vue.js](https://hackernoon.com/a-todo-mvc-application-using-iris-and-vue-js-5019ff870064) -- [教程: 结合 BoltDB 生成短网址](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7) -- [教程: 用安卓设备搭建服务器 (**MUST**)](https://twitter.com/ThePracticalDev/status/892022594031017988) +- [Glimpse](overview/main.go) +- [Tutorial: Online Visitors](tutorial/online-visitors/main.go) +- [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) - [POC: Isomorphic react/hot reloadable/redux/css-modules starter kit](https://github.com/kataras/iris-starter-kit) -- [教程: DropzoneJS 上传](tutorial/dropzonejs) -- [教程: Caddy 服务器使用](tutorial/caddy) -- [教程: Iris + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c) +- [Tutorial: DropzoneJS Uploader](tutorial/dropzonejs) +- [Tutorial: Caddy](tutorial/caddy) +- [Tutorial:Iris Go Framework + MongoDB](https://medium.com/go-language/iris-go-framework-mongodb-552e349eab9c) -### 目录结构 +### Structuring -Iris 是个底层框架, 对 MVC 模式有很好的支持,但不限制文件夹结构,你可以随意组织你的代码。 +Nothing stops you from using your favorite folder structure. Iris is a low level web framework, it has got MVC first-class support but it doesn't limit your folder structure, this is your choice. -如何组织代码取决于你的需求. 我们无法告诉你如何设计程序,但你可以仔细查看下面的示例,也许有些片段可以直接放到你的程序里。 +Structuring depends on your own needs. We can't tell you how to design your own application for sure but you're free to take a closer look to the examples below; you may find something useful that you can borrow for your app; - [Bootstrapper](structuring/bootstrap) - [MVC with Repository and Service layer Overview](structuring/mvc-plus-repository-and-service-layers) From 37b5875ab0b4720224bd9385e6b8b3ae6c0b3150 Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Thu, 29 Mar 2018 03:31:49 +0800 Subject: [PATCH 5/9] Update README_ZH.md Former-commit-id: 981f0266b25e92cb38d767288db3bed112d70399 --- _examples/README_ZH.md | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/_examples/README_ZH.md b/_examples/README_ZH.md index b07dc0f4..dcd43d97 100644 --- a/_examples/README_ZH.md +++ b/_examples/README_ZH.md @@ -27,37 +27,37 @@ Iris 是个底层框架, 对 MVC 模式有很好的支持,但不限制文件 如何组织代码取决于你的需求. 我们无法告诉你如何设计程序,但你可以仔细查看下面的示例,也许有些片段可以直接放到你的程序里。 -- [Bootstrapper](structuring/bootstrap) -- [MVC with Repository and Service layer Overview](structuring/mvc-plus-repository-and-service-layers) -- [Login (MVC with Single Responsibility package)](structuring/login-mvc-single-responsibility-package) -- [Login (MVC with Datamodels, Datasource, Repository and Service layer)](structuring/login-mvc) +- [引导模式架构](structuring/bootstrap) +- [MVC 存储层与服务层](structuring/mvc-plus-repository-and-service-layers) +- [登录演示 (MVC 使用独立包组织)](structuring/login-mvc-single-responsibility-package) +- [登录演示 (MVC 数据模型, 数据源, 存储 和 服务层)](structuring/login-mvc) -### HTTP Listening +### HTTP 监听 -- [Common, with address](http-listening/listen-addr/main.go) - * [omit server errors](http-listening/listen-addr/omit-server-errors/main.go) +- [基础用法](http-listening/listen-addr/main.go) +    * [忽略错误信息](http-listening/listen-addr/omit-server-errors/main.go) - [UNIX socket file](http-listening/listen-unix/main.go) - [TLS](http-listening/listen-tls/main.go) -- [Letsencrypt (Automatic Certifications)](http-listening/listen-letsencrypt/main.go) -- [Notify on shutdown](http-listening/notify-on-shutdown/main.go) -- Custom TCP Listener - * [common net.Listener](http-listening/custom-listener/main.go) +- [Letsencrypt (自动认证)](http-listening/listen-letsencrypt/main.go) +- [进程关闭通知](http-listening/notify-on-shutdown/main.go) +- 自定义 TCP 监听器 +    * [通用 net.Listener](http-listening/custom-listener/main.go) * [SO_REUSEPORT for unix systems](http-listening/custom-listener/unix-reuseport/main.go) -- Custom HTTP Server - * [easy way](http-listening/custom-httpserver/easy-way/main.go) +- 自定义 HTTP 服务 +    * [easy way](http-listening/custom-httpserver/easy-way/main.go) * [std way](http-listening/custom-httpserver/std-way/main.go) - * [multi server instances](http-listening/custom-httpserver/multi/main.go) -- Graceful Shutdown - * [using the `RegisterOnInterrupt`](http-listening/graceful-shutdown/default-notifier/main.go) - * [using a custom notifier](http-listening/graceful-shutdown/custom-notifier/main.go) +    * [多个服务示例](http-listening/custom-httpserver/multi/main.go) +- 优雅关闭 +    * [使用 `RegisterOnInterrupt`](http-listening/graceful-shutdown/default-notifier/main.go) +    * [自定义通知](http-listening/graceful-shutdown/custom-notifier/main.go) -### Configuration +### 配置 -- [Functional](configuration/functional/main.go) -- [From Configuration Struct](configuration/from-configuration-structure/main.go) -- [Import from YAML file](configuration/from-yaml-file/main.go) - * [Share Configuration between multiple instances](configuration/from-yaml-file/shared-configuration/main.go) -- [Import from TOML file](configuration/from-toml-file/main.go) +- [基本配置方式](configuration/functional/main.go) +- [Struct 方式配置](configuration/from-configuration-structure/main.go) +- [导入 YAML 配置文件](configuration/from-yaml-file/main.go) +    * [多实例共享配置](configuration/from-yaml-file/shared-configuration/main.go) +- [导入 TOML 配置文件](configuration/from-toml-file/main.go) ### Routing, Grouping, Dynamic Path Parameters, "Macros" and Custom Context @@ -113,10 +113,10 @@ Navigate through examples for a better understanding. * [per-route](routing/writing-a-middleware/per-route/main.go) * [globally](routing/writing-a-middleware/globally/main.go) -### hero +### hero (输出的一种高效包装模式) -- [Basic](hero/basic/main.go) -- [Overview](hero/overview) +- [基础](hero/basic/main.go) +- [概览](hero/overview) ### MVC From 61406dcbaee3779838907d302788f0b7c95b10c1 Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Thu, 29 Mar 2018 23:24:30 +0800 Subject: [PATCH 6/9] Update README_ZH.md Former-commit-id: b2392ff60de3fbf5d167cd2f16051ee6dd382948 --- _examples/README_ZH.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/_examples/README_ZH.md b/_examples/README_ZH.md index dcd43d97..17fb64a3 100644 --- a/_examples/README_ZH.md +++ b/_examples/README_ZH.md @@ -59,28 +59,28 @@ Iris 是个底层框架, 对 MVC 模式有很好的支持,但不限制文件    * [多实例共享配置](configuration/from-yaml-file/shared-configuration/main.go) - [导入 TOML 配置文件](configuration/from-toml-file/main.go) -### Routing, Grouping, Dynamic Path Parameters, "Macros" and Custom Context +### 路由、路由分组、路径动态参数、路由参数处理宏 、 自定义上下文 * `app.Get("{userid:int min(1)}", myHandler)` * `app.Post("{asset:path}", myHandler)` * `app.Put("{custom:string regexp([a-z]+)}", myHandler)` -Note: unlike other routers you'd seen, iris' router can handle things like these: +提示: 不同于其他路由处理, iris 路由可以处理以下各种情况: ```go -// Matches all GET requests prefixed with "/assets/" +// 匹配静态前缀 "/assets/" 的各种请求 app.Get("/assets/{asset:path}", assetsWildcardHandler) -// Matches only GET "/" +// 只匹配 GET "/" app.Get("/", indexHandler) -// Matches only GET "/about" +// 只匹配 GET "/about" app.Get("/about", aboutHandler) -// Matches all GET requests prefixed with "/profile/" -// and followed by a single path part +// 匹配前缀为 "/profile/" 的所有 GET 请求 +// 接着是其余部分的匹配 app.Get("/profile/{username:string}", userHandler) -// Matches only GET "/profile/me" because -// it does not conflict with /profile/{username:string} -// or the root wildcard {root:path} +// 只匹配 "/profile/me" GET 请求, +// 这和 /profile/{username:string} +// 或跟通配符 {root:path} 不冲突 app.Get("/profile/me", userHandler) // Matches all GET requests prefixed with /users/ From 515fd82873320e7585db96d61c9982b7b24aa8e3 Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Fri, 30 Mar 2018 00:15:58 +0800 Subject: [PATCH 7/9] Update README_ZH.md Former-commit-id: a0c4b2d627621bbd060bd861debcafa21c223710 --- _examples/README_ZH.md | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/_examples/README_ZH.md b/_examples/README_ZH.md index 17fb64a3..23f6f55a 100644 --- a/_examples/README_ZH.md +++ b/_examples/README_ZH.md @@ -118,7 +118,7 @@ Navigate through examples for a better understanding. - [基础](hero/basic/main.go) - [概览](hero/overview) -### MVC +### MVC 模式 ![](mvc/web_mvc_diagram.png) @@ -246,7 +246,7 @@ func(c *ExampleController) Get() string | where [mvc.Result](https://github.com/kataras/iris/blob/master/mvc/func_result.go) is an interface which contains only that function: `Dispatch(ctx iris.Context)`. -## Using Iris MVC for code reuse +## Iris MVC 模式代码复用 By creating components that are independent of one another, developers are able to reuse components quickly and easily in other applications. The same (or similar) view for one application can be refactored for another application with different data because the view is simply handling how the data is being displayed to the user. @@ -263,13 +263,13 @@ Follow the examples below, - [Register Middleware](mvc/middleware) **NEW** - [Vue.js Todo MVC](tutorial/vuejs-todo-mvc) **NEW** -### Subdomains +### 子域名 -- [Single](subdomains/single/main.go) -- [Multi](subdomains/multi/main.go) -- [Wildcard](subdomains/wildcard/main.go) +- [单域名](subdomains/single/main.go) +- [多域名](subdomains/multi/main.go) +- [通配符](subdomains/wildcard/main.go) - [WWW](subdomains/www/main.go) -- [Redirect fast](subdomains/redirect/main.go) +- [快速跳转](subdomains/redirect/main.go) ### Convert `http.Handler/HandlerFunc` @@ -277,9 +277,9 @@ Follow the examples below, - [From http.Handler or http.HandlerFunc](convert-handlers/nethttp/main.go) - [From func(http.HandlerFunc) http.HandlerFunc](convert-handlers/real-usecase-raven/writing-middleware/main.go) -### View +### 视图 -| Engine | Declaration | +| 模板引擎 | 调用声明 | | -----------|-------------| | template/html | `iris.HTML(...)` | | django | `iris.Django(...)` | @@ -299,14 +299,14 @@ Follow the examples below, You can serve [quicktemplate](https://github.com/valyala/quicktemplate) and [hero templates](https://github.com/shiyanhui/hero/hero) files too, simply by using the `context#ResponseWriter`, take a look at the [http_responsewriter/quicktemplate](http_responsewriter/quicktemplate) and [http_responsewriter/herotemplate](http_responsewriter/herotemplate) examples. -### Authentication +### 认证 - [Basic Authentication](authentication/basicauth/main.go) - [OAUth2](authentication/oauth2/main.go) - [JWT](experimental-handlers/jwt/main.go) - [Sessions](#sessions) -### File Server +### 文件服务器 - [Favicon](file-server/favicon/main.go) - [Basic](file-server/basic/main.go) @@ -421,16 +421,14 @@ The package is designed to work with raw websockets although its API is similar - [Custom Raw Go Client](websocket/custom-go-client/main.go) - [Third-Party socket.io](websocket/third-party-socketio/main.go) -> You're free to use your own favourite websockets package if you'd like so. +> 如果你愿意,你可以自由使用你自己喜欢的websockets包。 -### Typescript Automation Tools +### Typescript 自动化工具 -typescript automation tools have their own repository: [https://github.com/kataras/iris/tree/master/typescript](https://github.com/kataras/iris/tree/master/typescript) **it contains examples** +Typescript 自动化工具独立库: [https://github.com/kataras/iris/tree/master/typescript](https://github.com/kataras/iris/tree/master/typescript) **包含相关示例** -> I'd like to tell you that you can use your favourite but I don't think you will find such a thing anywhere else. +### 老兄 -### Hey, You +进一步学习可通过 [godocs](https://godoc.org/github.com/kataras/iris) 和 https://docs.iris-go.com -Developers should read the [godocs](https://godoc.org/github.com/kataras/iris) and https://docs.iris-go.com for a better understanding. - -Psst, I almost forgot; do not forget to [star or watch](https://github.com/kataras/iris/stargazers) the project in order to stay updated with the latest tech trends, it never takes more than a second! +不要忘记点赞 [star or watch](https://github.com/kataras/iris/stargazers) 这个项目会一直跟进最新趋势。 From b7bf311058e3be68c49c23fd69f465cb453022a1 Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Fri, 30 Mar 2018 19:18:18 +0800 Subject: [PATCH 8/9] Update README_ZH.md Former-commit-id: 41af389366ad45114473df779111a8f698e5cfda --- _examples/README_ZH.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/_examples/README_ZH.md b/_examples/README_ZH.md index 23f6f55a..3cd74238 100644 --- a/_examples/README_ZH.md +++ b/_examples/README_ZH.md @@ -368,32 +368,32 @@ You can serve [quicktemplate](https://github.com/valyala/quicktemplate) and [her - [Tollboothic](experimental-handlers/tollboothic/limit-handler/main.go) - [Cross-Site Request Forgery Protection](experimental-handlers/csrf/main.go) -#### More +#### 更多 https://github.com/kataras/iris/tree/master/middleware#third-party-handlers -### Automated API Documentation +### 自动 API 文档 - [yaag](apidoc/yaag/main.go) -### Testing +### 测试 The `httptest` package is your way for end-to-end HTTP testing, it uses the httpexpect library created by our friend, [gavv](https://github.com/gavv). [Example](testing/httptest/main_test.go) -### Caching +### 缓存 -iris cache library lives on its own [package](https://github.com/kataras/iris/tree/master/cache). +Iris 独立缓存包 [package](https://github.com/kataras/iris/tree/master/cache). -- [Simple](cache/simple/main.go) -- [Client-Side (304)](cache/client-side/main.go) - part of the iris context core +- [简单示例](cache/simple/main.go) +- [客户端 (304)](cache/client-side/main.go) - context 方法 -> You're free to use your own favourite caching package if you'd like so. +> 可以随意使用自定义的缓存包。 ### Sessions -iris session manager lives on its own [package](https://github.com/kataras/iris/tree/master/sessions). +Iris session 管理独立包 [package](https://github.com/kataras/iris/tree/master/sessions). - [Overview](sessions/overview/main.go) - [Standalone](sessions/standalone/main.go) @@ -406,7 +406,7 @@ iris session manager lives on its own [package](https://github.com/kataras/iris/ * [LevelDB](sessions/database/leveldb/main.go) * [Redis](sessions/database/redis/main.go) -> You're free to use your own favourite sessions package if you'd like so. +> 可以随意使用自定义的 Session 管理包。 ### Websockets @@ -427,7 +427,7 @@ The package is designed to work with raw websockets although its API is similar Typescript 自动化工具独立库: [https://github.com/kataras/iris/tree/master/typescript](https://github.com/kataras/iris/tree/master/typescript) **包含相关示例** -### 老兄 +### 大兄弟 进一步学习可通过 [godocs](https://godoc.org/github.com/kataras/iris) 和 https://docs.iris-go.com From 4a3e97a9bdeb48ef1859cf531de085cc5b865fcb Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Sat, 31 Mar 2018 14:20:29 +0800 Subject: [PATCH 9/9] Update README_ZH.md Former-commit-id: 8865a9b486dc56821f3505b25cc8764d641c21bf --- _examples/README_ZH.md | 60 ++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/_examples/README_ZH.md b/_examples/README_ZH.md index 3cd74238..f9400bcf 100644 --- a/_examples/README_ZH.md +++ b/_examples/README_ZH.md @@ -83,35 +83,35 @@ app.Get("/profile/{username:string}", userHandler) // 或跟通配符 {root:path} 不冲突 app.Get("/profile/me", userHandler) -// Matches all GET requests prefixed with /users/ -// and followed by a number which should be equal or bigger than 1 +// 匹配所有前缀为 /users/ 的 GET 请求 +// 参数为数字,且 >= 1 app.Get("/user/{userid:int min(1)}", getUserHandler) -// Matches all requests DELETE prefixed with /users/ -// and following by a number which should be equal or bigger than 1 +// 匹配所有前缀为 /users/ 的 DELETE 请求 +// 参数为数字,且 >= 1 app.Delete("/user/{userid:int min(1)}", deleteUserHandler) -// Matches all GET requests except "/", "/about", anything starts with "/assets/" etc... -// because it does not conflict with the rest of the routes. +// 匹配所有 GET 请求,除了 "/", "/about", 或其他以 "/assets/" 开头 +// 因为它不会与其他路线冲突。 app.Get("{root:path}", rootWildcardHandler) ``` -Navigate through examples for a better understanding. +可以浏览以下示例,以便更好理解 -- [Overview](routing/overview/main.go) -- [Basic](routing/basic/main.go) -- [Controllers](mvc) -- [Custom HTTP Errors](routing/http-errors/main.go) -- [Dynamic Path](routing/dynamic-path/main.go) - * [root level wildcard path](routing/dynamic-path/root-wildcard/main.go) -- [Reverse routing](routing/reverse/main.go) -- [Custom wrapper](routing/custom-wrapper/main.go) -- Custom Context - * [method overriding](routing/custom-context/method-overriding/main.go) - * [new implementation](routing/custom-context/new-implementation/main.go) -- [Route State](routing/route-state/main.go) -- [Writing a middleware](routing/writing-a-middleware) - * [per-route](routing/writing-a-middleware/per-route/main.go) - * [globally](routing/writing-a-middleware/globally/main.go) +- [概览](routing/overview/main.go) +- [基本使用](routing/basic/main.go) +- [控制器](mvc) +- [自定义 HTTP 错误](routing/http-errors/main.go) +- [动态路径](routing/dynamic-path/main.go) + * [根级通配符路径](routing/dynamic-path/root-wildcard/main.go) +- [反向路由](routing/reverse/main.go) +- [自定义包装](routing/custom-wrapper/main.go) +- 自定义上下文 +    * [方法重写](routing/custom-context/method-overriding/main.go) +    * [新实现方式](routing/custom-context/new-implementation/main.go) +- [路由状态](routing/route-state/main.go) +- [中间件定义](routing/writing-a-middleware) +    * [路由前](routing/writing-a-middleware/per-route/main.go) +    * [全局](routing/writing-a-middleware/globally/main.go) ### hero (输出的一种高效包装模式) @@ -122,13 +122,11 @@ Navigate through examples for a better understanding. ![](mvc/web_mvc_diagram.png) -Iris has **first-class support for the MVC (Model View Controller) pattern**, you'll not find -these stuff anywhere else in the Go world. +Iris **对 MVC (Model View Controller) 有一流的支持**, 在 Go 社区里是独一无二的。 -Iris web framework supports Request data, Models, Persistence Data and Binding -with the fastest possible execution. +Iris 支持快速的请求数据,模型,持久性数据和绑定。 -**Characteristics** +**特点** All HTTP Methods are supported, for example if want to serve `GET` then the controller should have a function named `Get()`, @@ -252,7 +250,7 @@ By creating components that are independent of one another, developers are able If you're new to back-end web development read about the MVC architectural pattern first, a good start is that [wikipedia article](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller). -Follow the examples below, +参考下面的示例 - [Hello world](mvc/hello-world/main.go) **UPDATED** - [Session Controller](mvc/session-controller/main.go) **UPDATED** @@ -271,7 +269,7 @@ Follow the examples below, - [WWW](subdomains/www/main.go) - [快速跳转](subdomains/redirect/main.go) -### Convert `http.Handler/HandlerFunc` +### 改造 `http.Handler/HandlerFunc` - [From func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)](convert-handlers/negroni-like/main.go) - [From http.Handler or http.HandlerFunc](convert-handlers/nethttp/main.go) @@ -345,7 +343,7 @@ You can serve [quicktemplate](https://github.com/valyala/quicktemplate) and [her - [Using xorm(Mysql, MyMysql, Postgres, Tidb, **SQLite**, MsSql, MsSql, Oracle)](orm/xorm/main.go) -### Miscellaneous +### 其他 - [Request Logger](http_request/request-logger/main.go) * [log requests to a file](http_request/request-logger/request-logger-file/main.go) @@ -355,7 +353,7 @@ You can serve [quicktemplate](https://github.com/valyala/quicktemplate) and [her - [Internal Application File Logger](miscellaneous/file-logger/main.go) - [Google reCAPTCHA](miscellaneous/recaptcha/main.go) -### Experimental Handlers +### 试验性质处理器 - [Casbin wrapper](experimental-handlers/casbin/wrapper/main.go) - [Casbin middleware](experimental-handlers/casbin/middleware/main.go)