Skip to content

Commit

Permalink
+Shiva | Basic weaver project setup
Browse files Browse the repository at this point in the history
May the force be with you!
  • Loading branch information
rShetty committed Feb 1, 2019
1 parent ae57fc1 commit c6a3bd8
Show file tree
Hide file tree
Showing 60 changed files with 5,049 additions and 6 deletions.
77 changes: 71 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,77 @@
# Binaries for programs and plugins
*.exe
# Windows Ignores
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msix
*.msm
*.msp
*.lnk
*.rdb
# macOS Ignores
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Text Editor Ignores
*~
\#*\#
.\#*
*.swp
[._]*.un~
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
tags
TAGS
*.sublime-workspace
*.sublime-project

# IDE Ignores
/.idea
*.iml
.vscode/

# Go Ignores
.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Project Ignores
dev/
tmp/
temp/
out/
build/
vendor/
.vendor-new/

/**/application.yml
expt/

cmd/debug
api/*.*
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.PHONY: all
all: build fmt vet lint test

ALL_PACKAGES=$(shell go list ./... | grep -v "vendor")

APP_EXECUTABLE="out/weaver"
COMMIT_HASH=$(shell git rev-parse --verify head | cut -c-1-8)
BUILD_DATE=$(shell date +%Y-%m-%dT%H:%M:%S%z)

setup:
go get -u github.com/golang/lint/golint

compile:
mkdir -p out/
go build -o $(APP_EXECUTABLE) -ldflags "-X main.Build=$(BUILD_DATE) -X main.Commit=$(COMMIT_HASH) -s -w"

build: compile fmt vet lint

install:
go install ./...

fmt:
go fmt ./...

vet:
go vet ./...

lint:
@if [[ `golint $(All_PACKAGES) | { grep -vwE "exported (var|function|method|type|const) \S+ should have comment" || true; } | wc -l | tr -d ' '` -ne 0 ]]; then \
golint $(ALL_PACKAGES) | { grep -vwE "exported (var|function|method|type|const) \S+ should have comment" || true; }; \
exit 2; \
fi;

test: copy-config
go test ./...

test-cover-html:
@echo "mode: count" > coverage-all.out
$(foreach pkg, $(ALL_PACKAGES),\
go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out -o out/coverage.html

copy-config:
cp weaver.conf.yaml.sample weaver.conf.yaml

clean:
go clean && rm -rf ./vendor ./build ./weaver.conf.yaml

docker-up:
docker-compose up -d

start: docker-up compile
$(APP_EXECUTABLE) server

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Weaver

## Description
A Layer-7 Load Balancer with Dynamic Sharding Strategy

## Building

```
make
```
42 changes: 42 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: '2'

services:
dev_weaver_statsd:
image: gojektech/statsd:0.7.2
hostname: dev-weaver-statsd
ports:
- "18124:8124"
- "18125:8125"
- "18126:8126"
networks:
- weaver_net

dev_weaver_etcd:
image: quay.io/coreos/etcd:v2.3.8
hostname: dev-weaver-etcd
entrypoint: ["/etcd"]
command: [
"-name",
"etcd0",
"-advertise-client-urls",
"http://localhost:2379,http://localhost:4001",
"-listen-client-urls",
"http://0.0.0.0:2379,http://0.0.0.0:4001",
"-initial-advertise-peer-urls",
"http://localhost:2380",
"-listen-peer-urls",
"http://0.0.0.0:2380",
"-initial-cluster-token",
"etcd-cluster-1",
"-initial-cluster",
"etcd0=http://localhost:2380",
"-initial-cluster-state",
"new"
]
ports:
- "12379:2379"
networks:
- weaver_net

networks:
weaver_net:
63 changes: 63 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module github.com/gojektech/weaver

require (
github.com/certifi/gocertifi v0.0.0-20170123212243-03be5e6bb987 // indirect
github.com/coreos/bbolt v1.3.2 // indirect
github.com/coreos/etcd v3.3.0+incompatible
github.com/coreos/go-semver v0.2.0 // indirect
github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142 // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/getsentry/raven-go v0.0.0-20161115135411-3f7439d3e74d
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gogo/protobuf v1.2.0 // indirect
github.com/gojekfarm/hashring v0.0.0-20180330151038-7bba2fd52501
github.com/golang/geo v0.0.0-20170430223333-5747e9816367
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c // indirect
github.com/gorilla/websocket v1.4.0 // indirect
github.com/gravitational/trace v0.0.0-20171118015604-0bd13642feb8 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.7.0 // indirect
github.com/hashicorp/hcl v0.0.0-20170217164738-630949a3c5fa // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/magiconair/properties v0.0.0-20170113111004-b3b15ef068fd // indirect
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 // indirect
github.com/mitchellh/mapstructure v0.0.0-20170125051937-db1efb556f84 // indirect
github.com/newrelic/go-agent v1.11.0
github.com/onsi/ginkgo v1.7.0 // indirect
github.com/onsi/gomega v1.4.3 // indirect
github.com/pelletier/go-buffruneio v0.2.0 // indirect
github.com/pelletier/go-toml v0.0.0-20170227222904-361678322880 // indirect
github.com/philhofer/fwd v1.0.0 // indirect
github.com/pkg/errors v0.8.0
github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7 // indirect
github.com/prometheus/client_golang v0.9.2 // indirect
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
github.com/savaki/jq v0.0.0-20161209013833-0e6baecebbf8
github.com/securego/gosec v0.0.0-20190128083818-04ce7baf6c55 // indirect
github.com/sirupsen/logrus v1.0.3
github.com/soheilhy/cmux v0.1.4 // indirect
github.com/spaolacci/murmur3 v0.0.0-20170819071325-9f5d223c6079 // indirect
github.com/spf13/afero v0.0.0-20170217164146-9be650865eab // indirect
github.com/spf13/cast v0.0.0-20170221152302-f820543c3592 // indirect
github.com/spf13/jwalterweatherman v0.0.0-20170109133355-fa7ca7e836cf // indirect
github.com/spf13/pflag v1.0.0 // indirect
github.com/spf13/viper v1.0.0
github.com/stretchr/objx v0.1.1 // indirect
github.com/stretchr/testify v1.2.2
github.com/tinylib/msgp v1.1.0 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/ugorji/go v0.0.0-20171019201919-bdcc60b419d1 // indirect
github.com/vulcand/predicate v1.0.0 // indirect
github.com/vulcand/route v0.0.0-20160805191529-61904570391b
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.2 // indirect
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 // indirect
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c // indirect
google.golang.org/grpc v1.18.0 // indirect
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/alexcesaro/statsd.v2 v2.0.0
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
gopkg.in/urfave/cli.v1 v1.20.0
)
Loading

0 comments on commit c6a3bd8

Please sign in to comment.