View base-layer-dock
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 alpine:3.7 | |
RUN apk update && \ | |
apk add --no-cache xorriso git xz curl tar iptables cpio bash && \ | |
rm -rf /var/cache/apk/* | |
RUN apk add -U --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing aufs-util | |
RUN addgroup -g 2999 docker |
View chan-mania.go
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" | |
"sync" | |
) | |
type Receiver struct{ | |
doneCh chan bool | |
wg sync.WaitGroup |
View close-chanel.go
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
// Closer holds the two things we need to close a goroutine and wait for it to finish: a chan | |
// to tell the goroutine to shut down, and a WaitGroup with which to wait for it to finish shutting | |
// down. | |
type Closer struct { | |
closed chan struct{} | |
waiting sync.WaitGroup | |
} | |
// NewCloser constructs a new Closer, with an initial count on the WaitGroup. | |
func NewCloser(initial int) *Closer { |
View utd.py
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
#Import the necessary methods from tweepy library | |
from tweepy.streaming import StreamListener | |
from tweepy import OAuthHandler | |
from tweepy import Stream | |
access_token="ENTER YOUR ACCESS TOKEN" | |
access_token_secret="ENTER YOUR ACCESS TOKEN SECRET" | |
consumer_key="ENTER YOUR API KEY" | |
consumer_secret="ENTER YOUR API SECRET" |
View redis-conn.go
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" | |
"github.com/go-redis/redis" | |
) | |
func main() { | |
client := redis.NewClient(&redis.Options{ |
View service-b.go
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 ( | |
"github.com/arriqaaq/boomerang" | |
lucio "github.com/arriqaaq/server" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
"log" | |
"net/http" | |
"os" | |
"time" |
View service-a.go
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/arriqaaq/boomerang" | |
lucio "github.com/arriqaaq/server" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
"log" | |
"net/http" | |
"os" |
View sweeper.go
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 evictor interface { | |
Run(*shard) | |
Stop() | |
} | |
func newSweeper(interval time.Duration) evictor { | |
return &sweeper{ | |
interval: interval, | |
stopC: make(chan bool), | |
} |
View scrooge.go
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 service struct { | |
storage db.DB | |
logger log.Logger | |
db *sql.DB | |
cache *zizou.Cache | |
} | |
func (s *service) GetEcpm(data getEcpmRequest) (float64, error) { | |
key := NewKey(data.GetCountryId(), data.GetPartner(), data.GetGameId()) | |
icVal, found := s.cache.Get(key.Id()) |
View scrooge.go
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 service struct { | |
storage db.DB | |
logger log.Logger | |
db *sql.DB | |
cache *zizou.Cache | |
} | |
func (s *service) GetEcpm(data getEcpmRequest) (float64, error) { | |
key := NewKey(data.GetCountryId(), data.GetPartner(), data.GetGameId()) | |
icVal, found := s.cache.Get(key.Id()) |