Fix typos (#1625)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Barnabus · committed by thinkerou · parent b524e29 · Browse files · 3 files·+9 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+9 added−9 removed
- other:+9 added−9 removed
Provenance
- Commit
f83cdb3- Tree
c8fdf6a- Author
Barnabus <jbampton@users.noreply.github.com>- Committer
thinkerou <thinkerou@gmail.com>- Parent
b524e29
3 files changed+9 added−9 removed
modified:docs/how-to-build-an-effective-middleware.md+2 added-2 removed
2 unmodified lines34567789910111213124 unmodified linesExpand all2 unmodified lines## Consitituent part
The middleware has two parts:
- part one is what is executed once, when you initalize your middleware. That's where you set up all the global objects, logicals etc. Everything that happens one per application lifetime. - part one is what is executed once, when you initialize your middleware. That's where you set up all the global objects, logicals etc. Everything that happens one per application lifetime.
- part two is what executes on every request. For example, a database middleware you simply inject your "global" database object into the context. Once it's inside the context, you can retrieve it from within other middlewares and your handler furnction. - part two is what executes on every request. For example, a database middleware you simply inject your "global" database object into the context. Once it's inside the context, you can retrieve it from within other middlewares and your handler function.
```gofunc funcName(params string) gin.HandlerFunc { // <---124 unmodified linesExpand allmodified:examples/realtime-advanced/resources/room_login.templ.html+2 added-2 removed
47 unmodified lines48 <li class="active"><a href="#">Demo</a></li>49 <li><a href="http://www.w3.org/TR/2009/WD-eventsource-20091029/">W3 Standard</a></li>50 <li><a href="http://caniuse.com/#feat=eventsource">Browser Support</a></li>51 <li><a href="http://gin-gonic.github.io/gin/">Gin Framework</a></li>52- <li><a href="https://github.com/gin-gonic/gin/tree/develop/examples/realtime-advanced">Github</a></li>52+ <li><a href="https://github.com/gin-gonic/gin/tree/develop/examples/realtime-advanced">GitHub</a></li>53 </ul>54 </div><!-- /.nav-collapse -->55 </div><!-- /.container -->56 </nav><!-- /.navbar -->1 unmodified line58 <div class="jumbotron">59 <div class="container">60 <h1>Server-Sent Events in Go</h1>61 <p>Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. It is not websockets. <a href="http://www.html5rocks.com/en/tutorials/eventsource/basics/">Learn more.</a></p>62- <p>The chat and the charts data is provided in realtime using the SSE implemention of <a href="https://github.com/gin-gonic/gin/blob/15b0c49da556d58a3d934b86e3aa552ff224026d/examples/realtime-chat/main.go#L23-L32">Gin Framework</a>.</p>62+ <p>The chat and the charts data is provided in realtime using the SSE implementation of <a href="https://github.com/gin-gonic/gin/blob/15b0c49da556d58a3d934b86e3aa552ff224026d/examples/realtime-chat/main.go#L23-L32">Gin Framework</a>.</p>63 <div class="row">64 <div class="col-md-8">65 <div id="chat-scroll" style="overflow-y:scroll; overflow-x:scroll; height:290px">66 <table id="table-style" class="table" data-show-header="false">142 unmodified linesmodified:ginS/gins.go+5 added-5 removed
45 unmodified lines46 func NoMethod(handlers ...gin.HandlerFunc) {47 engine().NoMethod(handlers...)48 }49 50-// Group creates a new router group. You should add all the routes that have common middlwares or the same path prefix.51-// For example, all the routes that use a common middlware for authorization could be grouped.50+// Group creates a new router group. You should add all the routes that have common middlewares or the same path prefix.51+// For example, all the routes that use a common middleware for authorization could be grouped.52 func Group(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup {53 return engine().Group(relativePath, handlers...)54 }55 70 unmodified lines126 }127 128 // Run : The router is attached to a http.Server and starts listening and serving HTTP requests.129 // It is a shortcut for http.ListenAndServe(addr, router)130-// Note: this method will block the calling goroutine undefinitelly unless an error happens.130+// Note: this method will block the calling goroutine indefinitely unless an error happens.131 func Run(addr ...string) (err error) {132 return engine().Run(addr...)133 }134 135 // RunTLS : The router is attached to a http.Server and starts listening and serving HTTPS requests.136 // It is a shortcut for http.ListenAndServeTLS(addr, certFile, keyFile, router)137-// Note: this method will block the calling goroutine undefinitelly unless an error happens.137+// Note: this method will block the calling goroutine indefinitely unless an error happens.138 func RunTLS(addr, certFile, keyFile string) (err error) {139 return engine().RunTLS(addr, certFile, keyFile)140 }141 142 // RunUnix : The router is attached to a http.Server and starts listening and serving HTTP requests143 // through the specified unix socket (ie. a file)144-// Note: this method will block the calling goroutine undefinitelly unless an error happens.144+// Note: this method will block the calling goroutine indefinitely unless an error happens.145 func RunUnix(file string) (err error) {146 return engine().RunUnix(file)147 }