update docs

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2017-07-03 09:33:06 +08:00
parent e4a9f261f1
commit 02e1f6bf78
3 changed files with 82 additions and 33 deletions

42
.editorconfig Normal file
View File

@@ -0,0 +1,42 @@
# unifying the coding style for different editors and IDEs => editorconfig.org
; indicate this is the root of the project
root = true
###########################################################
; common
###########################################################
[*]
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
###########################################################
; make
###########################################################
[Makefile]
indent_style = tab
[makefile]
indent_style = tab
###########################################################
; markdown
###########################################################
[*.md]
trim_trailing_whitespace = false
###########################################################
; golang
###########################################################
[*.go]
indent_style = tab

45
doc.go
View File

@@ -1,25 +1,32 @@
// Support Let's Encrypt for a Go server application.
//
// example for 1-line LetsEncrypt HTTPS servers.
//
// package main
// Copyright 2017 Bo-Yi Wu. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
// import (
// "log"
/*
Support Let's Encrypt for a Go server application.
// "github.com/gin-gonic/autotls"
// "github.com/gin-gonic/gin"
// )
example for 1-line LetsEncrypt HTTPS servers.
// func main() {
// r := gin.Default()
package main
// // Ping handler
// r.GET("/ping", func(c *gin.Context) {
// c.String(200, "pong")
// })
import (
"log"
"github.com/gin-gonic/autotls"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
// Ping handler
r.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
log.Fatal(autotls.Run(r, "example1.com", "example2.com"))
}
*/
// log.Fatal(autotls.Run(r, "example1.com", "example2.com"))
// }
//
package autotls

View File

@@ -1,19 +1,19 @@
package main
package main
import (
"log"
import (
"log"
"github.com/gin-gonic/autotls"
"github.com/gin-gonic/gin"
)
"github.com/gin-gonic/autotls"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
func main() {
r := gin.Default()
// Ping handler
r.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
// Ping handler
r.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
log.Fatal(autotls.Run(r, "example1.com", "example2.com"))
}
log.Fatal(autotls.Run(r, "example1.com", "example2.com"))
}