Attention: Deprecation notice for Bintray, JCenter, GoCenter and ChartCenter. Learn More
To use GoCenter:
export GOPROXY=https://gocenter.io
github.com/iris-contrib/examples
This repository contains small and practical examples for the Iris Web Framework.
February 7th 2021
Last Modified
578
Stars
MIT
License
22
Downloads
ReadMe
Mod File
GoDocs
New
Security
Dependencies (0)
Used By (0)
Metrics
Versions
Examples
This repository provides easy to understand code snippets on how to get started with web development with the Go programming language using the Iris web framework.
To read the Iris documentation please navigate to the wiki pages instead.
Table of Contents
- Overview
- Hello world!
- Hello WebAssemply!
- Glimpse
- Tutorial: Online Visitors
- Tutorial: A Todo MVC Application using Iris and Vue.js
- Tutorial: URL Shortener using BoltDB
- Tutorial: How to turn your Android Device into a fully featured Web Server
- POC: Convert the medium-sized project “Parrot” from native to Iris
- POC: Isomorphic react/hot reloadable/redux/css-modules starter kit
- Tutorial: DropzoneJS Uploader
- Tutorial: Caddy
- Tutorial:Iris Go Framework + MongoDB
- Tutorial: API for Apache Kafka
- Structuring
- Bootstrapper
- MVC with Repository and Service layer Overview
- Login (MVC with Single Responsibility package)
- Login (MVC with Datamodels, Datasource, Repository and Service layer)
- HTTP Listening
- Common, with address
- UNIX socket file
- TLS
- Letsencrypt (Automatic Certifications)
- Notify on shutdown
- Custom TCP Listener
- Custom HTTP Server
- Graceful Shutdown
- Configuration
- Functional
- From Configuration Struct
- Import from YAML file
- Share Configuration between multiple instances
- Import from TOML file
- Routing
- Overview
- Basic
- Controllers
- Custom HTTP Errors
- Dynamic Path
- root level wildcard path
- Write your own custom parameter types
- Reverse routing
- Custom Router (high-level)
- Custom Wrapper UPDATED
- Custom Context
- method overriding
- new implementation
- Route State
- Writing a middleware
- per-route
- globally
- Versioning
- How it works
- Example
- Dependency Injection
- Basic
- Overview
- Sessions
- Yet another dependency injection example and good practises at general NEW
- MVC
- Hello world
- Regexp NEW
- Session Controller
- Overview - Plus Repository and Service layers
- Login showcase - Plus Repository and Service layers
- Singleton
- Websocket Controller UPDATED
- Register Middleware
- Vue.js Todo MVC
- Subdomains
- Single
- Multi
- Wildcard
- WWW
- Redirect fast
- Convert
http.Handler/HandlerFunc
- From func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- From http.Handler or http.HandlerFunc
- From func(http.HandlerFunc) http.HandlerFunc
- View
- Overview
- Hi
- A simple Layout
- Layouts:
yield
andrender
tmpl funcs - The
urlpath
tmpl func - The
url
tmpl func - Inject Data Between Handlers
- Embedding Templates Into App Executable File
- Write to a custom
io.Writer
- Greeting with Pug (Jade)`
- Pug (Jade) Actions`
- Pug (Jade) Includes`
- Pug (Jade) Extends`
- Jet NEW
- Jet Embedded NEW
- Authentication
- Basic Authentication
- OAUth2
- Request Auth(JWT)
- Sessions
- File Server
- Favicon
- Basic UPDATED
- Embedding Files Into App Executable File UPDATED
- Embedding Gziped Files Into App Executable File UPDATED
- Send/Force-Download Files
- Single Page Applications
- single Page Application UPDATED
- embedded Single Page Application UPDATED
- embedded Single Page Application with other routes UPDATED
- How to Read from
context.Request() *http.Request
- How to Write to
context.ResponseWriter() http.ResponseWriter
- ORM
- Desktop App
- Blink
- Lorca
- Webview
- Miscellaneous
- HTTP Method Override NEW
- Request Logger
- Localization and Internationalization
- Sitemap.xml
- Recovery
- Profiling (pprof)
- Internal Application File Logger
- Google reCAPTCHA
- Experimental Handlers
- Casbin wrapper
- Casbin middleware
- Cloudwatch
- CORS
- JWT
- Newrelic
- Prometheus
- Secure
- Tollboothic
- Cross-Site Request Forgery Protection
- Automated API Documentation
- yaag
- Testing
- Example
- Caching
- Simple
- Client-Side (304)
- Cookies
- Basic
- Encode/Decode (securecookie)
- Sessions
- Overview
- Middleware
- Secure Cookie
- Flash Messages
- Databases
- Badger
- BoltDB
- Redis
- Websockets
- Basic NEW
- Server
- Go Client
- Browser Client
- Browser NPM Client (browserify)
- Native Messages UPDATED
- TLS Enabled
- Basic NEW
Examples are tested using Windows 10, Ubuntu 16.10 with Microsoft’s Visual Studio Code and built using the Go 1.9.
Run
- Install the Go Programming Language, version 1.13 from here.
- Install Iris:
go get github.com/kataras/iris/v12@latest
- Download the examples and copy-paste them to your
$GOPATH/src/github.com/iris-contrib/examples
And run
$ cd $GOPATH/src/github.com/iris-contrib/examples/overview
$ go run main.go
Do not forget to star or watch the Iris project.
Any troubles with examples?
https://github.com/iris-contrib/examples/issues
Su, 04 June 2017
This repository is just a minor of the https://github.com/kataras/iris/master/_examples folder.