chore: mv {examples ⮕ _examples}

Avoid pulling in any external example dependencies, when using go get.
Go tools ignore folders with names which start with `_`.
This commit is contained in:
Suhas Karanth 2017-10-13 19:06:27 +05:30
parent dfb68ce085
commit c21039a284
40 changed files with 17 additions and 17 deletions

View File

@ -272,7 +272,7 @@ id: 1234; page: 1; name: manu; message: this_is_great
#### Single file #### Single file
References issue [#774](https://github.com/gin-gonic/gin/issues/774) and detail [example code](examples/upload-file/single). References issue [#774](https://github.com/gin-gonic/gin/issues/774) and detail [example code](_examples/upload-file/single).
```go ```go
func main() { func main() {
@ -303,7 +303,7 @@ curl -X POST http://localhost:8080/upload \
#### Multiple files #### Multiple files
See the detail [example code](examples/upload-file/multiple). See the detail [example code](_examples/upload-file/multiple).
```go ```go
func main() { func main() {
@ -527,9 +527,9 @@ $ curl -v -X POST \
### Custom Validators ### Custom Validators
It is also possible to register custom validators. See the [example code](examples/custom-validation/server.go). It is also possible to register custom validators. See the [example code](_examples/custom-validation/server.go).
[embedmd]:# (examples/custom-validation/server.go go) [embedmd]:# (_examples/custom-validation/server.go go)
```go ```go
package main package main
@ -925,7 +925,7 @@ You may use custom delims
#### Custom Template Funcs #### Custom Template Funcs
See the detail [example code](examples/template). See the detail [example code](_examples/template).
main.go main.go
@ -1133,7 +1133,7 @@ func main() {
example for 1-line LetsEncrypt HTTPS servers. example for 1-line LetsEncrypt HTTPS servers.
[embedmd]:# (examples/auto-tls/example1.go go) [embedmd]:# (_examples/auto-tls/example1.go go)
```go ```go
package main package main
@ -1158,7 +1158,7 @@ func main() {
example for custom autocert manager. example for custom autocert manager.
[embedmd]:# (examples/auto-tls/example2.go go) [embedmd]:# (_examples/auto-tls/example2.go go)
```go ```go
package main package main
@ -1192,7 +1192,7 @@ func main() {
See the [question](https://github.com/gin-gonic/gin/issues/346) and try the folling example: See the [question](https://github.com/gin-gonic/gin/issues/346) and try the folling example:
[embedmd]:# (examples/multiple-service/main.go go) [embedmd]:# (_examples/multiple-service/main.go go)
```go ```go
package main package main
@ -1290,9 +1290,9 @@ An alternative to endless:
* [graceful](https://github.com/tylerb/graceful): Graceful is a Go package enabling graceful shutdown of an http.Handler server. * [graceful](https://github.com/tylerb/graceful): Graceful is a Go package enabling graceful shutdown of an http.Handler server.
* [grace](https://github.com/facebookgo/grace): Graceful restart & zero downtime deploy for Go servers. * [grace](https://github.com/facebookgo/grace): Graceful restart & zero downtime deploy for Go servers.
If you are using Go 1.8, you may not need to use this library! Consider using http.Server's built-in [Shutdown()](https://golang.org/pkg/net/http/#Server.Shutdown) method for graceful shutdowns. See the full [graceful-shutdown](./examples/graceful-shutdown) example with gin. If you are using Go 1.8, you may not need to use this library! Consider using http.Server's built-in [Shutdown()](https://golang.org/pkg/net/http/#Server.Shutdown) method for graceful shutdowns. See the full [graceful-shutdown](_examples/graceful-shutdown) example with gin.
[embedmd]:# (examples/graceful-shutdown/graceful-shutdown/server.go go) [embedmd]:# (_examples/graceful-shutdown/graceful-shutdown/server.go go)
```go ```go
// +build go1.8 // +build go1.8

View File

@ -3,5 +3,5 @@
1. Download, install and setup Go in your computer. (That includes setting your `$GOPATH`.) 1. Download, install and setup Go in your computer. (That includes setting your `$GOPATH`.)
2. Download SDK for your platform from here: `https://developers.google.com/appengine/downloads?hl=es#Google_App_Engine_SDK_for_Go` 2. Download SDK for your platform from here: `https://developers.google.com/appengine/downloads?hl=es#Google_App_Engine_SDK_for_Go`
3. Download Gin source code using: `$ go get github.com/gin-gonic/gin` 3. Download Gin source code using: `$ go get github.com/gin-gonic/gin`
4. Navigate to examples folder: `$ cd $GOPATH/src/github.com/gin-gonic/gin/examples/` 4. Navigate to examples folder: `$ cd $GOPATH/src/github.com/gin-gonic/gin/_examples/`
5. Run it: `$ goapp serve app-engine/` 5. Run it: `$ goapp serve app-engine/`

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -7,7 +7,7 @@
<title>Server-Sent Events. Room "{{.roomid}}"</title> <title>Server-Sent Events. Room "{{.roomid}}"</title>
<!-- jQuery --> <!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script> <script src="http://malsup.github.com/jquery.form.js"></script>
<!-- EPOCH --> <!-- EPOCH -->
<script src="http://d3js.org/d3.v3.min.js"></script> <script src="http://d3js.org/d3.v3.min.js"></script>
<script src="/static/epoch.min.js"></script> <script src="/static/epoch.min.js"></script>
@ -23,7 +23,7 @@
<link href="/static/prismjs.min.css" rel="stylesheet" /> <link href="/static/prismjs.min.css" rel="stylesheet" />
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
StartRealtime({{.roomid}}, {{.timestamp}}); StartRealtime({{.roomid}}, {{.timestamp}});
}); });
</script> </script>
@ -49,7 +49,7 @@
<li><a href="http://www.w3.org/TR/2009/WD-eventsource-20091029/">W3 Standard</a></li> <li><a href="http://www.w3.org/TR/2009/WD-eventsource-20091029/">W3 Standard</a></li>
<li><a href="http://caniuse.com/#feat=eventsource">Browser Support</a></li> <li><a href="http://caniuse.com/#feat=eventsource">Browser Support</a></li>
<li><a href="http://gin-gonic.github.io/gin/">Gin Framework</a></li> <li><a href="http://gin-gonic.github.io/gin/">Gin Framework</a></li>
<li><a href="https://github.com/gin-gonic/gin/tree/develop/examples/realtime-advanced">Github</a></li> <li><a href="https://github.com/gin-gonic/gin/tree/develop/_examples/realtime-advanced">Github</a></li>
</ul> </ul>
</div><!-- /.nav-collapse --> </div><!-- /.nav-collapse -->
</div><!-- /.container --> </div><!-- /.container -->
@ -59,7 +59,7 @@
<div class="container"> <div class="container">
<h1>Server-Sent Events in Go</h1> <h1>Server-Sent Events in Go</h1>
<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> <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>
<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> <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>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<div id="chat-scroll" style="overflow-y:scroll; overflow-x:scroll; height:290px"> <div id="chat-scroll" style="overflow-y:scroll; overflow-x:scroll; height:290px">
@ -134,7 +134,7 @@
<div class="row"> <div class="row">
<h2>MIT Open Sourced</h2> <h2>MIT Open Sourced</h2>
<ul> <ul>
<li><a href="https://github.com/gin-gonic/gin/tree/develop/examples/realtime-advanced">This demo website (JS and Go)</a></li> <li><a href="https://github.com/gin-gonic/gin/tree/develop/_examples/realtime-advanced">This demo website (JS and Go)</a></li>
<li><a href="https://github.com/manucorporat/sse">The SSE implementation in Go</a></li> <li><a href="https://github.com/manucorporat/sse">The SSE implementation in Go</a></li>
<li><a href="https://github.com/gin-gonic/gin">The Web Framework (Gin)</a></li> <li><a href="https://github.com/gin-gonic/gin">The Web Framework (Gin)</a></li>
</ul> </ul>