Skip to content

Commit

Permalink
Merge pull request #6 from lpabon/logrus-rename
Browse files Browse the repository at this point in the history
Logrus rename
  • Loading branch information
lpabon authored Mar 15, 2018
2 parents 0a9e969 + 8401fff commit b3655d9
Show file tree
Hide file tree
Showing 289 changed files with 70,480 additions and 23,615 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dist: trusty
language: go
go:
- 1.6
before_install:
before_install:
- sudo apt-get update -yq
script:
- make test
Expand Down
67 changes: 67 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#

[[override]]
name = "github.com/miekg/dns"
revision = "48ab6605c66ac797e07f615101c3e9e10e932b66"

[[override]]
name = "github.com/armon/go-metrics"
revision = "fbf75676ee9c0a3a23eb0a4d9220a3612cfbd1ed"

[[override]]
name = "github.com/hashicorp/go-multierror"
revision = "d30f09973e19c1dfcd120b2d9c4f168e68d6b5d5"

[[constraint]]
name = "github.com/hashicorp/logutils"
revision = "0dc08b1671f34c4250ce212759ebd880f743d883"

[[constraint]]
name = "github.com/hashicorp/memberlist"
revision = "7c7d6bae440fb7c6dcde850672e0f68263f9e29c"

[prune]
go-tests = true
unused-packages = true
19 changes: 6 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ ifndef PKGS
PKGS := $(shell go list ./... 2>&1 | grep -v 'github.com/libopenstorage/gossip/vendor')
endif

.PHONY: dep

export GO15VENDOREXPERIMENT=1

deps:
Expand All @@ -16,19 +18,10 @@ test-deps:
update-test-deps:
GO15VENDOREXPERIMENT=0 go get -tags "$(TAGS)" -d -v -t -u -f $(PKGS)

vendor-update:
GO15VENDOREXPERIMENT=0 GOOS=linux GOARCH=amd64 go get -d -v -t -u -f $(shell go list ./... 2>&1 | grep -v 'github.com/portworx/arturo/vendor')

vendor-without-update:
go get -v github.com/kardianos/govendor
rm -rf vendor
govendor init
GOOS=linux GOARCH=amd64 govendor add +external
GOOS=linux GOARCH=amd64 govendor update +vendor
GOOS=linux GOARCH=amd64 govendor add +external
GOOS=linux GOARCH=amd64 govendor update +vendor

vendor: vendor-update vendor-without-update
dep:
curl -s -L https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o $(GOPATH)/bin/dep
chmod +x $(GOPATH)/bin/dep
$(GOPATH)/bin/dep ensure

all: test

Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Go implementation of the Gossip protocol.

## Overview

This package provides an implementation of an eventually consistent in-memory
data store. The data store values are exchanged using a push-pull gossip protocol.

Expand All @@ -13,7 +15,7 @@ g := NewGossiper("<ip>:<port>", "<unique node id>", "<peer-list>")
// Add peer nodes with whom you want to gossip
g.AddNode("<peer_ip>:<peer_port>")
...
// update self values
// update self values
g.UpdateSelf("<some_key>", "<any_value>")
// start gossip
g.Start()
Expand All @@ -36,3 +38,19 @@ for _, key := range storeKeys.List {
// Stop gossiping
g.Stop()
```

## Contributing

### Testing

To test, run `make test`. This will run the unit tests

### Vendoring

For vendoring, we use [dep](https://golang.github.io/dep/). Some useful dep commands are:
- `dep ensure`: install the project's dependencies
- `dep ensure -update`: update the locked versions of all dependencies
- `dep ensure -add github.com/pkg/errors`: add a dependency to the project



2 changes: 1 addition & 1 deletion proto/gossip.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync"
"time"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/hashicorp/logutils"
ml "github.com/hashicorp/memberlist"
"github.com/libopenstorage/gossip/types"
Expand Down
2 changes: 1 addition & 1 deletion proto/gossip_delegates.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/Sirupsen/logrus"
"github.com/sirupsen/logrus"
"github.com/hashicorp/memberlist"

"github.com/libopenstorage/gossip/proto/state"
Expand Down
2 changes: 1 addition & 1 deletion proto/gossip_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/Sirupsen/logrus"
"github.com/sirupsen/logrus"
"github.com/libopenstorage/gossip/types"
)

Expand Down
4 changes: 2 additions & 2 deletions proto/gossip_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ func TestGossipStoreUpdateData(t *testing.T) {
t.Error("Wrongly Updated latest data d: ", n, " o: ", nodeInfo)
}
olderTime := n.LastUpdateTs.UnixNano() + 1000
ts := time.Unix(0, olderTime)
if ts != nodeInfo.LastUpdateTs {
ts := time.Unix(0, olderTime).UnixNano()
if ts != nodeInfo.LastUpdateTs.UnixNano() {
t.Error("Wrongly Updated latest data d: ", n, " o: ", nodeInfo)
}
}
Expand Down
41 changes: 0 additions & 41 deletions vendor/github.com/Sirupsen/logrus/json_formatter.go

This file was deleted.

Loading

0 comments on commit b3655d9

Please sign in to comment.