mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 18:22:23 +08:00
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:
parent
dfb68ce085
commit
c21039a284
20
README.md
20
README.md
@ -272,7 +272,7 @@ id: 1234; page: 1; name: manu; message: this_is_great
|
||||
|
||||
#### 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
|
||||
func main() {
|
||||
@ -303,7 +303,7 @@ curl -X POST http://localhost:8080/upload \
|
||||
|
||||
#### Multiple files
|
||||
|
||||
See the detail [example code](examples/upload-file/multiple).
|
||||
See the detail [example code](_examples/upload-file/multiple).
|
||||
|
||||
```go
|
||||
func main() {
|
||||
@ -527,9 +527,9 @@ $ curl -v -X POST \
|
||||
|
||||
### 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
|
||||
package main
|
||||
|
||||
@ -925,7 +925,7 @@ You may use custom delims
|
||||
|
||||
#### Custom Template Funcs
|
||||
|
||||
See the detail [example code](examples/template).
|
||||
See the detail [example code](_examples/template).
|
||||
|
||||
main.go
|
||||
|
||||
@ -1133,7 +1133,7 @@ func main() {
|
||||
|
||||
example for 1-line LetsEncrypt HTTPS servers.
|
||||
|
||||
[embedmd]:# (examples/auto-tls/example1.go go)
|
||||
[embedmd]:# (_examples/auto-tls/example1.go go)
|
||||
```go
|
||||
package main
|
||||
|
||||
@ -1158,7 +1158,7 @@ func main() {
|
||||
|
||||
example for custom autocert manager.
|
||||
|
||||
[embedmd]:# (examples/auto-tls/example2.go go)
|
||||
[embedmd]:# (_examples/auto-tls/example2.go go)
|
||||
```go
|
||||
package main
|
||||
|
||||
@ -1192,7 +1192,7 @@ func main() {
|
||||
|
||||
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
|
||||
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.
|
||||
* [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
|
||||
// +build go1.8
|
||||
|
||||
|
@ -3,5 +3,5 @@
|
||||
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`
|
||||
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/`
|
||||
5. Run it: `$ goapp serve app-engine/`
|
||||
4. Navigate to examples folder: `$ cd $GOPATH/src/github.com/gin-gonic/gin/_examples/`
|
||||
5. Run it: `$ goapp serve app-engine/`
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -7,7 +7,7 @@
|
||||
<title>Server-Sent Events. Room "{{.roomid}}"</title>
|
||||
<!-- jQuery -->
|
||||
<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 -->
|
||||
<script src="http://d3js.org/d3.v3.min.js"></script>
|
||||
<script src="/static/epoch.min.js"></script>
|
||||
@ -23,7 +23,7 @@
|
||||
<link href="/static/prismjs.min.css" rel="stylesheet" />
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
StartRealtime({{.roomid}}, {{.timestamp}});
|
||||
});
|
||||
</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://caniuse.com/#feat=eventsource">Browser Support</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>
|
||||
</div><!-- /.nav-collapse -->
|
||||
</div><!-- /.container -->
|
||||
@ -59,7 +59,7 @@
|
||||
<div class="container">
|
||||
<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>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="col-md-8">
|
||||
<div id="chat-scroll" style="overflow-y:scroll; overflow-x:scroll; height:290px">
|
||||
@ -134,7 +134,7 @@
|
||||
<div class="row">
|
||||
<h2>MIT Open Sourced</h2>
|
||||
<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/gin-gonic/gin">The Web Framework (Gin)</a></li>
|
||||
</ul>
|
Loading…
x
Reference in New Issue
Block a user