This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"time" | |
) | |
func Logger(inner http.Handler, name string) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"schema": "relational", | |
"database": "postgresql", | |
"connection": [ | |
{ | |
"connectionData": "stringForConnectionEtc", | |
"username": "theUser", | |
"password": "thePassword", | |
"otherConnectionParam": "TheOtherValue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datadiluvium: | |
build: | |
image: golang | |
dockerfile_path: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: sailing | |
service: datadiluvium | |
command: go clean | |
- name: sailing_tests | |
service: datadiluvium | |
command: go test . | |
- name: sailing_build | |
service: datadiluvium | |
command: go build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.7.4-alpine | |
ENV GOPATH /go | |
RUN mkdir /app && \ | |
apk add --update curl && \ | |
rm -rf /var/cache/apk/* | |
ADD . /app/ | |
WORKDIR /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Route struct { | |
Name string | |
Method string | |
Pattern string | |
HandlerFunc http.HandlerFunc | |
} | |
type Routes []Route | |
var routes = Routes{ | |
Route{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func HandleThis(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprint(w, "Welcome!\n") | |
} | |
func NewRouter() *mux.Router { | |
router := mux.NewRouter().StrictSlash(true) | |
for _, route := range routes { | |
var handler http.Handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" |