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" | |
"strings" | |
"bytes" | |
"github.com/Pallinder/go-randomdata" | |
) | |
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
package main | |
import ( | |
"fmt" | |
"github.com/Pallinder/go-randomdata" | |
) | |
func main() { | |
// Print a random silly name | |
fmt.Println(randomdata.SillyName()) |
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
jHa1bVPQeck+3AsZJa9exEBcI9Pe40XvNSMsezaRr2c= |
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
""" | |
Map oplog to you custom interface. To, for example, have triggers in mongo. | |
see example in '__main__' below | |
https://gist.github.com/rescommunes/4e5035242b8e4b07ff3a | |
""" | |
import logging | |
from time import sleep | |
import pickle |
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" | |
"math/rand" | |
"time" | |
) | |
type State struct { | |
name string |
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" | |
"time" | |
"net/http" | |
"encoding/json" | |
"golang.org/x/oauth2" | |
"github.com/google/go-github/github" | |
) |
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" | |
"time" | |
"net/http" | |
"github.com/labstack/echo" | |
"github.com/labstack/echo/engine/fasthttp" | |
) |
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 main() { | |
a := NewAuthorizer() | |
h := WithAuth(a, http.HandlerFunc(Handle)) | |
http.ListenAndServe("/", h) | |
} | |
const TokenContextKey = "MyAppToken" | |
func WithAuth(a Authorizer, next http.Handler) http.Handler { | |
return 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
package main | |
import ( | |
"context" | |
"log" | |
"net/http" | |
"time" | |
"fmt" | |
) |
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
#!/bin/bash | |
# Caddy daemon | |
# chkconfig: 345 20 80 | |
# description: Caddy daemon | |
# processname: caddy | |
DAEMON_PATH="/usr/local/bin" | |
DAEMON='./caddy' | |
DAEMONOPTS="-conf=/etc/caddy/Caddyfile -log /var/log/caddy.log" |
OlderNewer