Loading examples from the github examples folder...

If this page is not loading correctly on your PC due to low-power of the CPU please visit the Github Examples instead.


APIdoc

Yaag

File: apidoc/yaag/main.go
 

            
            
            

            

            
            

Authentication

↪ click here to read the introduction section

Basicauth

File: authentication/basicauth/main.go

            File: authentication/basicauth/main_test.go
            
            

            

Oauth2

File: authentication/oauth2/main.go

            File: authentication/oauth2/templates/index.html
            
            

            File: authentication/oauth2/templates/user.html
            
            
 

            
            
            

            

            
            

Cache

Client Side

File: cache/client-side/main.go

            

Simple

File: cache/simple/main.go
 

            
            
            

            

            
            

Configuration

↪ click here to read the introduction section

From Configuration Structure

File: configuration/from-configuration-structure/main.go

            

From Toml File

File: configuration/from-toml-file/configs/iris.tml

            File: configuration/from-toml-file/main.go
            
            

            

From Yaml File

File: configuration/from-yaml-file/configs/iris.yml

            File: configuration/from-yaml-file/main.go
            
            

            File: configuration/from-yaml-file/shared-configuration/main.go
            
            

            

Functional

File: configuration/functional/main.go
 

            
            
            

            

            
            

Convert Handlers

Negroni Like

File: convert-handlers/negroni-like/main.go

            

NetHTTP

File: convert-handlers/nethttp/main.go

            

Real Usecase Raven

File: convert-handlers/real-usecase-raven/wrapping-the-router/main.go

            File: convert-handlers/real-usecase-raven/writing-middleware/main.go
            
            
 

            
            
            

            

            
            

Cookies

Basic

File: cookies/basic/main.go

            File: cookies/basic/main_test.go
            
            

            

Securecookie

File: cookies/securecookie/main.go

            File: cookies/securecookie/main_test.go
            
            
 

            
            
            

            

            
            

Experimental Handlers

↪ click here to read the introduction section

Casbin

File: experimental-handlers/casbin/middleware/casbinmodel.conf

            File: experimental-handlers/casbin/middleware/casbinpolicy.csv
            
            

            File: experimental-handlers/casbin/middleware/main.go
            
            

            File: experimental-handlers/casbin/middleware/main_test.go
            
            

            File: experimental-handlers/casbin/wrapper/casbinmodel.conf
            
            

            File: experimental-handlers/casbin/wrapper/casbinpolicy.csv
            
            

            File: experimental-handlers/casbin/wrapper/main.go
            
            

            File: experimental-handlers/casbin/wrapper/main_test.go
            
            

            

Cloudwatch

File: experimental-handlers/cloudwatch/simple/main.go

            

Cors

File: experimental-handlers/cors/simple/main.go

            

Csrf

File: experimental-handlers/csrf/main.go

            File: experimental-handlers/csrf/views/user/signup.html
            
            

            

JWT

File: experimental-handlers/jwt/main.go

            

Newrelic

File: experimental-handlers/newrelic/simple/main.go

            

Prometheus

File: experimental-handlers/prometheus/simple/main.go

            

Secure

File: experimental-handlers/secure/simple/main.go

            

Tollboothic

File: experimental-handlers/tollboothic/limit-handler/main.go
 

            
            
            

            

            
            

File Server

Basic

File: file-server/basic/assets/css/main.css

            File: file-server/basic/assets/index.html
            
            

            File: file-server/basic/main.go
            
            

            

Embedding Files Into App

File: file-server/embedding-files-into-app/main.go

            File: file-server/embedding-files-into-app/main_test.go
            
            

            

Embedding Gziped Files Into App

File: file-server/embedding-gziped-files-into-app/main.go

            File: file-server/embedding-gziped-files-into-app/main_test.go
            
            

            

Favicon

File: file-server/favicon/main.go

            

Send Files

File: file-server/send-files/main.go

            

Single Page Application

File: file-server/single-page-application/basic/main.go

            File: file-server/single-page-application/basic/main_test.go
            
            

            File: file-server/single-page-application/basic/public/app.js
            
            

            File: file-server/single-page-application/basic/public/css/main.css
            
            

            File: file-server/single-page-application/basic/public/index.html
            
            

            File: file-server/single-page-application/embedded-single-page-application/main.go
            
            

            File: file-server/single-page-application/embedded-single-page-application/main_test.go
            
            

            File: file-server/single-page-application/embedded-single-page-application/public/app.js
            
            

            File: file-server/single-page-application/embedded-single-page-application/public/css/main.css
            
            

            File: file-server/single-page-application/embedded-single-page-application/public/index.html
            
            

            File: file-server/single-page-application/embedded-single-page-application-with-other-routes/main.go
            
            

            File: file-server/single-page-application/embedded-single-page-application-with-other-routes/public/app.js
            
            

            File: file-server/single-page-application/embedded-single-page-application-with-other-routes/public/css/main.css
            
            

            File: file-server/single-page-application/embedded-single-page-application-with-other-routes/public/index.html
            
            
 

            
            
            

            

            
            

Hero

Basic

File: hero/basic/main.go

            

Overview

File: hero/overview/datamodels/movie.go

            File: hero/overview/datasource/movies.go
            
            

            File: hero/overview/main.go
            
            

            File: hero/overview/repositories/movie_repository.go
            
            

            File: hero/overview/services/movie_service.go
            
            

            File: hero/overview/web/middleware/basicauth.go
            
            

            File: hero/overview/web/routes/hello.go
            
            

            File: hero/overview/web/routes/movies.go
            
            

            File: hero/overview/web/views/hello/index.html
            
            

            File: hero/overview/web/views/hello/name.html
            
            
 

            
            
            

            

            
            

HTTP Listening

↪ click here to read the introduction section

Custom HTTPserver

File: http-listening/custom-httpserver/easy-way/main.go

            File: http-listening/custom-httpserver/multi/main.go
            
            

            File: http-listening/custom-httpserver/std-way/main.go
            
            

            

Custom Listener

File: http-listening/custom-listener/main.go

            File: http-listening/custom-listener/unix-reuseport/main.go
            
            

            File: http-listening/custom-listener/unix-reuseport/main_windows.go
            
            

            

Graceful Shutdown

File: http-listening/graceful-shutdown/custom-notifier/main.go

            File: http-listening/graceful-shutdown/default-notifier/main.go
            
            

            

Iris Configurator And Host Configurator

File: http-listening/iris-configurator-and-host-configurator/counter/configurator.go

            File: http-listening/iris-configurator-and-host-configurator/main.go
            
            

            

Listen Addr

File: http-listening/listen-addr/main.go

            File: http-listening/listen-addr/omit-server-errors/main.go
            
            

            File: http-listening/listen-addr/omit-server-errors/main_test.go
            
            

            

Listen Letsencrypt

File: http-listening/listen-letsencrypt/main.go

            

Listen Tls

File: http-listening/listen-tls/main.go

            File: http-listening/listen-tls/mycert.cert
            
            

            File: http-listening/listen-tls/mykey.key
            
            

            

Listen Unix

File: http-listening/listen-unix/main.go

            

Notify On Shutdown

File: http-listening/notify-on-shutdown/main.go
 

            
            
            

            

            
            

HTTP Request

↪ click here to read the introduction section

Read Custom Per Type

File: http_request/read-custom-per-type/main.go

            File: http_request/read-custom-per-type/main_test.go
            
            

            

Read Custom Via Unmarshaler

File: http_request/read-custom-via-unmarshaler/main.go

            File: http_request/read-custom-via-unmarshaler/main_test.go
            
            

            

Read Form

File: http_request/read-form/main.go

            File: http_request/read-form/templates/form.html
            
            

            

Read Json

File: http_request/read-json/main.go

            

Read Xml

File: http_request/read-xml/main.go

            File: http_request/read-xml/main_test.go
            
            

            

Request Logger

File: http_request/request-logger/main.go

            File: http_request/request-logger/request-logger-file/main.go
            
            

            

Upload File

File: http_request/upload-file/main.go

            File: http_request/upload-file/templates/upload_form.html
            
            

            

Upload Files

File: http_request/upload-files/main.go

            File: http_request/upload-files/templates/upload_form.html
            
            
 

            
            
            

            

            
            

HTTP Responsewriter

↪ click here to read the introduction section

Herotemplate

File: http_responsewriter/herotemplate/app.go

            File: http_responsewriter/herotemplate/template/index.html
            
            

            File: http_responsewriter/herotemplate/template/index.html.go
            
            

            File: http_responsewriter/herotemplate/template/user.html
            
            

            File: http_responsewriter/herotemplate/template/user.html.go
            
            

            File: http_responsewriter/herotemplate/template/userlist.html
            
            

            File: http_responsewriter/herotemplate/template/userlist.html.go
            
            

            File: http_responsewriter/herotemplate/template/userlistwriter.html
            
            

            File: http_responsewriter/herotemplate/template/userlistwriter.html.go
            
            

            

Quicktemplate

File: http_responsewriter/quicktemplate/controllers/execute_template.go

            File: http_responsewriter/quicktemplate/controllers/hello.go
            
            

            File: http_responsewriter/quicktemplate/controllers/index.go
            
            

            File: http_responsewriter/quicktemplate/main.go
            
            

            File: http_responsewriter/quicktemplate/main_test.go
            
            

            File: http_responsewriter/quicktemplate/templates/base.qtpl
            
            

            File: http_responsewriter/quicktemplate/templates/hello.qtpl
            
            

            File: http_responsewriter/quicktemplate/templates/index.qtpl
            
            

            

Sse Third Party

File: http_responsewriter/sse-third-party/main.go

            

Stream Writer

File: http_responsewriter/stream-writer/main.go

            

Transactions

File: http_responsewriter/transactions/main.go

            

Write Gzip

File: http_responsewriter/write-gzip/main.go

            

Write Rest

File: http_responsewriter/write-rest/main.go
 

            
            
            

            

            
            

Miscellaneous

File Logger

File: miscellaneous/file-logger/main.go

            

I18n

File: miscellaneous/i18n/locales/locale_el-GR.ini

            File: miscellaneous/i18n/locales/locale_en-US.ini
            
            

            File: miscellaneous/i18n/locales/locale_multi_first_el-GR.ini
            
            

            File: miscellaneous/i18n/locales/locale_multi_first_en-US.ini
            
            

            File: miscellaneous/i18n/locales/locale_multi_second_el-GR.ini
            
            

            File: miscellaneous/i18n/locales/locale_multi_second_en-US.ini
            
            

            File: miscellaneous/i18n/locales/locale_zh-CN.ini
            
            

            File: miscellaneous/i18n/main.go
            
            

            File: miscellaneous/i18n/main_test.go
            
            

            

Pprof

File: miscellaneous/pprof/main.go

            

Recaptcha

File: miscellaneous/recaptcha/custom_form/main.go

            File: miscellaneous/recaptcha/main.go
            
            

            

Recover

File: miscellaneous/recover/main.go
 

            
            
            

            

            
            

MVC

↪ click here to read the introduction section

Basic

File: mvc/basic/main.go

            

Hello World

File: mvc/hello-world/main.go

            File: mvc/hello-world/main_test.go
            
            

            

Login


File: mvc/login/datamodels/user.go

            File: mvc/login/datasource/users.go
            
            

            File: mvc/login/main.go
            
            

            File: mvc/login/repositories/user_repository.go
            
            

            File: mvc/login/services/user_service.go
            
            

            File: mvc/login/web/controllers/user_controller.go
            
            

            File: mvc/login/web/controllers/users_controller.go
            
            

            File: mvc/login/web/middleware/basicauth.go
            
            

            File: mvc/login/web/public/css/site.css
            
            

            File: mvc/login/web/views/shared/error.html
            
            

            File: mvc/login/web/views/shared/layout.html
            
            

            File: mvc/login/web/views/user/login.html
            
            

            File: mvc/login/web/views/user/me.html
            
            

            File: mvc/login/web/views/user/register.html
            
            

            

Middleware

File: mvc/middleware/main.go

            File: mvc/middleware/per-method/main.go
            
            

            File: mvc/middleware/without-ctx-next/main.go
            
            

            

Overview


File: mvc/overview/datamodels/movie.go

            File: mvc/overview/datasource/movies.go
            
            

            File: mvc/overview/main.go
            
            

            File: mvc/overview/repositories/movie_repository.go
            
            

            File: mvc/overview/services/movie_service.go
            
            

            File: mvc/overview/web/controllers/hello_controller.go
            
            

            File: mvc/overview/web/controllers/movie_controller.go
            
            

            File: mvc/overview/web/middleware/basicauth.go
            
            

            File: mvc/overview/web/views/hello/index.html
            
            

            File: mvc/overview/web/views/hello/name.html
            
            

            

Session Controller

File: mvc/session-controller/main.go

            File: mvc/session-controller/main_test.go
            
            

            

Singleton

File: mvc/singleton/main.go

            

Websocket

File: mvc/websocket/main.go

            File: mvc/websocket/views/index.html
            
            
 

            
            
            

            

            
            

ORM

Xorm

File: orm/xorm/main.go
 

            
            
            

            

            
            

Overview

Views

File: overview/views/user/create_verification.html

            File: overview/views/user/profile.html
            
            
 

            
            
            

            

            
            

Routing

↪ click here to read the introduction section

Basic

File: routing/basic/main.go

            

Custom Context

File: routing/custom-context/method-overriding/main.go

            File: routing/custom-context/method-overriding/view/hi.html
            
            

            File: routing/custom-context/new-implementation/main.go
            
            

            File: routing/custom-context/new-implementation/main_test.go
            
            

            

Custom Wrapper

File: routing/custom-wrapper/main.go

            File: routing/custom-wrapper/main_test.go
            
            

            File: routing/custom-wrapper/public/app.js
            
            

            File: routing/custom-wrapper/public/css/main.css
            
            

            File: routing/custom-wrapper/public/index.html
            
            

            

Dynamic Path

File: routing/dynamic-path/main.go

            File: routing/dynamic-path/root-wildcard/main.go
            
            

            

HTTP Errors

File: routing/http-errors/main.go

            

Overview

File: routing/overview/main.go

            

Reverse

File: routing/reverse/main.go

            

Route State

File: routing/route-state/main.go

            

Writing A Middleware

File: routing/writing-a-middleware/globally/main.go

            File: routing/writing-a-middleware/per-route/main.go
            
            
 

            
            
            

            

            
            

Sessions

↪ click here to read the introduction section

Database

File: sessions/database/badger/main.go

            File: sessions/database/boltdb/main.go
            
            

            File: sessions/database/redis/main.go
            
            

            

Flash Messages

File: sessions/flash-messages/main.go

            

Overview

File: sessions/overview/main.go

            

Securecookie

File: sessions/securecookie/main.go

            File: sessions/securecookie/main_test.go
            
            

            

Standalone

File: sessions/standalone/main.go
 

            
            
            

            

            
            

Structuring

Bootstrap


File: structuring/bootstrap/bootstrap/bootstrapper.go

            File: structuring/bootstrap/main.go
            
            

            File: structuring/bootstrap/main_test.go
            
            

            File: structuring/bootstrap/middleware/identity/identity.go
            
            

            File: structuring/bootstrap/routes/follower.go
            
            

            File: structuring/bootstrap/routes/following.go
            
            

            File: structuring/bootstrap/routes/index.go
            
            

            File: structuring/bootstrap/routes/like.go
            
            

            File: structuring/bootstrap/routes/routes.go
            
            

            File: structuring/bootstrap/views/index.html
            
            

            File: structuring/bootstrap/views/shared/error.html
            
            

            File: structuring/bootstrap/views/shared/layout.html
            
            

            

Login Mvc Single Responsibility Package


File: structuring/login-mvc-single-responsibility-package/main.go

            File: structuring/login-mvc-single-responsibility-package/public/css/site.css
            
            

            File: structuring/login-mvc-single-responsibility-package/user/auth.go
            
            

            File: structuring/login-mvc-single-responsibility-package/user/controller.go
            
            

            File: structuring/login-mvc-single-responsibility-package/user/datasource.go
            
            

            File: structuring/login-mvc-single-responsibility-package/user/model.go
            
            

            File: structuring/login-mvc-single-responsibility-package/views/shared/error.html
            
            

            File: structuring/login-mvc-single-responsibility-package/views/shared/layout.html
            
            

            File: structuring/login-mvc-single-responsibility-package/views/user/login.html
            
            

            File: structuring/login-mvc-single-responsibility-package/views/user/me.html
            
            

            File: structuring/login-mvc-single-responsibility-package/views/user/notfound.html
            
            

            File: structuring/login-mvc-single-responsibility-package/views/user/register.html
            
            
 

            
            
            

            

            
            

Subdomains

Multi

File: subdomains/multi/hosts

            File: subdomains/multi/main.go
            
            

            

Redirect

File: subdomains/redirect/hosts

            File: subdomains/redirect/main.go
            
            

            File: subdomains/redirect/main_test.go
            
            

            

Single

File: subdomains/single/hosts

            File: subdomains/single/main.go
            
            

            

Wildcard

File: subdomains/wildcard/hosts

            File: subdomains/wildcard/main.go
            
            

            

WWW

File: subdomains/www/hosts

            File: subdomains/www/main.go
            
            

            File: subdomains/www/main_test.go
            
            
 

            
            
            

            

            
            

Testing

HTTPtest

File: testing/httptest/main.go

            File: testing/httptest/main_test.go
            
            
 

            
            
            

            

            
            

Tutorial

Caddy

File: tutorial/caddy/Caddyfile

            File: tutorial/caddy/server1/main.go
            
            

            File: tutorial/caddy/server1/views/index.html
            
            

            File: tutorial/caddy/server1/views/shared/layout.html
            
            

            File: tutorial/caddy/server2/main.go
            
            

            

DropzoneJS


File: tutorial/dropzonejs/no_files.png
File: tutorial/dropzonejs/src/main.go

            File: tutorial/dropzonejs/src/public/css/dropzone.css
            
            

            File: tutorial/dropzonejs/src/views/upload.html
            
            

            File: tutorial/dropzonejs/with_files.png
            

How to build a file upload form using DropzoneJS and Gowritten by https://twitter.com/@kataras

How to display existing files on server using DropzoneJS and Gowritten by https://twitter.com/@kataras

Online Visitors

File: tutorial/online-visitors/main.go

            File: tutorial/online-visitors/static/assets/js/visitors.js
            
            

            File: tutorial/online-visitors/templates/index.html
            
            

            File: tutorial/online-visitors/templates/other.html
            
            

            

Url Shortener

File: tutorial/url-shortener/factory.go

            File: tutorial/url-shortener/main.go
            
            

            File: tutorial/url-shortener/main_test.go
            
            

            File: tutorial/url-shortener/resources/css/style.css
            
            

            File: tutorial/url-shortener/store.go
            
            

            File: tutorial/url-shortener/templates/index.html
            
            

            

Vuejs Todo Mvc

File: tutorial/vuejs-todo-mvc/screen.png
File: tutorial/vuejs-todo-mvc/src/todo/item.go

            File: tutorial/vuejs-todo-mvc/src/todo/service.go
            
            

            File: tutorial/vuejs-todo-mvc/src/web/controllers/todo_controller.go
            
            

            File: tutorial/vuejs-todo-mvc/src/web/main.go
            
            

            File: tutorial/vuejs-todo-mvc/src/web/public/css/index
            
            

            File: tutorial/vuejs-todo-mvc/src/web/public/index.html
            
            

            File: tutorial/vuejs-todo-mvc/src/web/public/js/app.js
            
            

            File: tutorial/vuejs-todo-mvc/src/web/public/js/lib/vue
            
            
 

            
            
            

            

            
            

View

Context View Data

File: view/context-view-data/main.go

            File: view/context-view-data/templates/index.html
            
            

            File: view/context-view-data/templates/layouts/layout.html
            
            

            

Embedding Templates Into App

File: view/embedding-templates-into-app/main.go

            File: view/embedding-templates-into-app/templates/layouts/layout.html
            
            

            File: view/embedding-templates-into-app/templates/layouts/mylayout.html
            
            

            File: view/embedding-templates-into-app/templates/page1.html
            
            

            File: view/embedding-templates-into-app/templates/partials/page1_partial1.html
            
            

            

Overview

File: view/overview/main.go

            File: view/overview/templates/hi.html
            
            

            

Template Html 0

File: view/template_html_0/main.go

            File: view/template_html_0/templates/hi.html
            
            

            

Template Html 1

File: view/template_html_1/main.go

            File: view/template_html_1/templates/layout.html
            
            

            File: view/template_html_1/templates/mypage.html
            
            

            

Template Html 2

File: view/template_html_2/main.go

            File: view/template_html_2/templates/layouts/layout.html
            
            

            File: view/template_html_2/templates/layouts/mylayout.html
            
            

            File: view/template_html_2/templates/page1.html
            
            

            File: view/template_html_2/templates/partials/page1_partial1.html
            
            

            

Template Html 3

File: view/template_html_3/main.go

            File: view/template_html_3/templates/page.html
            
            

            

Template Html 4

File: view/template_html_4/hosts

            File: view/template_html_4/main.go
            
            

            File: view/template_html_4/templates/page.html
            
            

            

Template Pug 0

File: view/template_pug_0/main.go

            File: view/template_pug_0/templates/index.pug
            
            

            

Template Pug 1

File: view/template_pug_1/main.go

            File: view/template_pug_1/templates/index.pug
            
            

            

Template Pug 2

File: view/template_pug_2/main.go

            File: view/template_pug_2/templates/footer.pug
            
            

            File: view/template_pug_2/templates/header.pug
            
            

            File: view/template_pug_2/templates/index.pug
            
            

            

Template Pug 3

File: view/template_pug_3/main.go

            File: view/template_pug_3/templates/index.pug
            
            

            File: view/template_pug_3/templates/layout.pug
            
            

            

Write To

File: view/write-to/main.go

            File: view/write-to/views/email/simple.html
            
            

            File: view/write-to/views/shared/email.html
            
            
 

            
            
            

            

            
            

Websocket

↪ click here to read the introduction section

Chat

File: websocket/chat/main.go

            File: websocket/chat/websockets.html
            
            

            

Connectionlist

File: websocket/connectionlist/main.go

            File: websocket/connectionlist/static/js/chat.js
            
            

            File: websocket/connectionlist/templates/client.html
            
            

            

Custom Go Client

File: websocket/custom-go-client/main.go

            

Native Messages

File: websocket/native-messages/main.go

            File: websocket/native-messages/static/js/chat.js
            
            

            File: websocket/native-messages/templates/client.html
            
            

            

Secure

File: websocket/secure/main.go

            File: websocket/secure/static/js/chat.js
            
            

            File: websocket/secure/templates/client.html
            
            

            

Third Party Socketio

File: websocket/third-party-socketio/main.go

            File: websocket/third-party-socketio/public/index.html