Skip to content

Commit

Permalink
Merge pull request #49 from Jeffail/feature/use-dep
Browse files Browse the repository at this point in the history
Transition to dep
  • Loading branch information
Jeffail authored Feb 19, 2018
2 parents 2c202c4 + 9d68cd5 commit 89d8ab9
Show file tree
Hide file tree
Showing 64 changed files with 1,955 additions and 186 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
vendor
bin
releases
./leaps
Expand Down
42 changes: 0 additions & 42 deletions .gitmodules

This file was deleted.

133 changes: 133 additions & 0 deletions Gopkg.lock

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

82 changes: 82 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/Jeffail/gabs"
version = "1.0.0"

[[constraint]]
branch = "master"
name = "github.com/amir/raidman"

[[constraint]]
name = "github.com/azure/azure-sdk-for-go"
version = "12.5.0-beta"

[[constraint]]
name = "github.com/cenkalti/backoff"
version = "1.1.0"

[[constraint]]
name = "github.com/elazarl/go-bindata-assetfs"
version = "1.0.0"

[[constraint]]
name = "github.com/garyburd/redigo"
version = "1.5.0"

[[constraint]]
name = "github.com/go-sql-driver/mysql"
version = "1.3.0"

[[constraint]]
name = "github.com/gorilla/websocket"
version = "1.2.0"

[[constraint]]
branch = "master"
name = "github.com/kardianos/osext"

[[constraint]]
branch = "master"
name = "github.com/lib/pq"

[[constraint]]
name = "github.com/satori/go.uuid"
version = "1.2.0"

[[constraint]]
name = "gopkg.in/alexcesaro/statsd.v2"
version = "2.0.0"

[[constraint]]
branch = "v2"
name = "gopkg.in/yaml.v2"

[prune]
go-tests = true
unused-packages = true
55 changes: 19 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,55 +58,38 @@ for your OS from [the latest releases page][3].

### From homebrew

```bash
``` sh
brew install leaps
leaps -h
```

### Build with Go

```bash
go get github.com/jeffail/leaps/cmd/...
``` sh
go get github.com/Jeffail/leaps/cmd/...
leaps -h
```

## Vendoring

Versions of go above 1.6 should automatically `go get` all vendored libraries.
Otherwise, while cloning use `--recursive`:
Leaps uses [dep][https://github.com/golang/dep] for managing its dependencies.
To obtain the correct versions of all dependencies use:

`git clone https://github.com/jeffail/leaps --recursive`

Or, if the repo is already cloned, get the latest libraries with:

`git submodule update --init`

To add new libraries simply run:

```
PACKAGE=github.com/jeffail/util
git submodule add https://$PACKAGE vendor/$PACKAGE"
```

It might be handy to set yourself a function for this in your `.bashrc`:

```bash
function go-add-vendor {
git submodule add https://$1 vendor/$1
}
``` sh
dep ensure
```

## System compatibility

OS | Status
---------------- | ------
OSX x86_64 | Supported, tested
Linux x86 | Supported
Linux x86_64 | Supported, tested
Linux ARMv5 | Builds
Linux ARMv7 | Supported, tested
Windows x86 | Builds
Windows x86_64 | Builds
OS | Status
------------------ | ------
OSX `x86_64` | Supported, tested
Linux `x86` | Supported
Linux `x86_64` | Supported, tested
Linux `ARMv5` | Builds
Linux `ARMv7` | Supported, tested
Windows `x86` | Builds
Windows `x86_64` | Builds

## Contributing and customizing

Expand All @@ -122,7 +105,7 @@ Ashley Jeffs
[1]: https://godoc.org/github.com/Jeffail/leaps
[2]: client/javascript/README.md
[3]: https://github.com/Jeffail/leaps/releases/latest
[4]: https://godoc.org/github.com/jeffail/leaps?status.svg
[5]: http://godoc.org/github.com/jeffail/leaps
[6]: https://goreportcard.com/badge/github.com/jeffail/leaps
[4]: https://godoc.org/github.com/Jeffail/leaps?status.svg
[5]: http://godoc.org/github.com/Jeffail/leaps
[6]: https://goreportcard.com/badge/github.com/Jeffail/leaps
[7]: https://goreportcard.com/report/jeffail/leaps
27 changes: 15 additions & 12 deletions cmd/leaps/leaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ import (
"syscall"
"time"

"github.com/Jeffail/leaps/lib/acl"
"github.com/Jeffail/leaps/lib/api"
apiio "github.com/Jeffail/leaps/lib/api/io"
"github.com/Jeffail/leaps/lib/audit"
"github.com/Jeffail/leaps/lib/curator"
"github.com/Jeffail/leaps/lib/store"
"github.com/Jeffail/leaps/lib/util"
"github.com/Jeffail/leaps/lib/util/service/log"
"github.com/Jeffail/leaps/lib/util/service/metrics"
"github.com/gorilla/websocket"
"github.com/jeffail/leaps/lib/acl"
"github.com/jeffail/leaps/lib/api"
apiio "github.com/jeffail/leaps/lib/api/io"
"github.com/jeffail/leaps/lib/audit"
"github.com/jeffail/leaps/lib/curator"
"github.com/jeffail/leaps/lib/store"
"github.com/jeffail/leaps/lib/util"
"github.com/jeffail/util/log"
"github.com/jeffail/util/metrics"
)

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -201,9 +201,10 @@ If a path is not specified the current directory is shared instead.
logger := log.NewLogger(os.Stdout, logConf)

statConf := metrics.NewConfig()
statConf.Prefix = "leaps"
statConf.Type = "http"
statConf.HTTP.Prefix = "leaps"

stats, err := metrics.New(statConf)
stats, err := metrics.NewHTTP(statConf)
if err != nil {
fmt.Fprintln(os.Stderr, fmt.Sprintf("Metrics init error: %v\n", err))
return
Expand Down Expand Up @@ -323,7 +324,9 @@ If a path is not specified the current directory is shared instead.
w.Write(data)
})

handle("/stats", "Lists all aggregated metrics as a json blob.", stats.JSONHandler())
if hStats, ok := stats.(*metrics.HTTP); ok {
handle("/stats", "Lists all aggregated metrics as a json blob.", hStats.JSONHandler())
}

wwwPath := gopath.Join("/", subdirPath)
stripPath := ""
Expand Down
Loading

0 comments on commit 89d8ab9

Please sign in to comment.