Skip to content

Commit

Permalink
Update all dependencies
Browse files Browse the repository at this point in the history
Added go.mod and updated all dependencies, including all NATS ones.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
  • Loading branch information
kozlovic committed Jun 4, 2019
1 parent 1ce7677 commit dfa75d1
Show file tree
Hide file tree
Showing 864 changed files with 155,038 additions and 68,395 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -8,12 +8,13 @@ env:
go_import_path: github.com/nats-io/nats-streaming-server
install:
- go get -t ./...
- go get github.com/nats-io/gnatsd
- go get github.com/nats-io/nats-server
- go get github.com/mattn/goveralls
- go get github.com/wadey/gocovmerge
- go get -u honnef.co/go/tools/cmd/staticcheck
- go get -u github.com/client9/misspell/cmd/misspell
- go get -u github.com/go-sql-driver/mysql
- go get github.com/tcnksm/ghr
services:
- mysql
before_script:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -8,7 +8,7 @@ WORKDIR /go/src/github.com/nats-io/nats-streaming-server
# Set the NATS Server git commit based on the rev that
# we actually vendor. This can be found in the
# vendor/manifest file.
ARG NATS_GIT_COMMIT='github.com/nats-io/nats-streaming-server/vendor/github.com/nats-io/gnatsd/server.gitCommit=3e64f0b'
ARG NATS_GIT_COMMIT='github.com/nats-io/nats-streaming-server/vendor/github.com/nats-io/nats-server/server.gitCommit=3e64f0b'

RUN CGO_ENABLED=0 GO111MODULE=off GOOS=linux GOARCH=amd64 go build -v -a -tags netgo -installsuffix netgo -ldflags "-s -w -X github.com/nats-io/nats-streaming-server/server.gitCommit=`git rev-parse --short HEAD` -X ${NATS_GIT_COMMIT}" -o pkg/linux-amd64/nats-streaming-server
RUN CGO_ENABLED=0 GO111MODULE=off GOOS=linux GOARCH=arm GOARM=6 go build -v -a -tags netgo -installsuffix netgo -ldflags "-s -w -X github.com/nats-io/nats-streaming-server/server.gitCommit=`git rev-parse --short HEAD` -X ${NATS_GIT_COMMIT}" -o pkg/linux-arm6/nats-streaming-server
Expand Down
19 changes: 19 additions & 0 deletions go.mod
@@ -0,0 +1,19 @@
module github.com/nats-io/nats-streaming-server

replace github.com/nats-io/go-nats => github.com/nats-io/nats.go v1.8.1

require (
github.com/go-sql-driver/mysql v1.4.1
github.com/gogo/protobuf v1.2.1
github.com/hashicorp/go-msgpack v0.5.5
github.com/hashicorp/raft v1.1.0
github.com/lib/pq v1.1.1
github.com/nats-io/nats-server/v2 v2.0.0-RC19
github.com/nats-io/nats.go v1.8.1
github.com/nats-io/nuid v1.0.1
github.com/nats-io/stan.go v0.4.5
github.com/prometheus/procfs v0.0.2
go.etcd.io/bbolt v1.3.2
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5
golang.org/x/sys v0.0.0-20190412213103-97732733099d
)
72 changes: 72 additions & 0 deletions go.sum
@@ -0,0 +1,72 @@
github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM=
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-hclog v0.9.1 h1:9PZfAcVEvez4yhLH2TBU64/h/z4xlFI80cWXRrxuKuM=
github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/raft v1.1.0 h1:qPMePEczgbkiQsqCsRfuHRqvDUO+zmAInDaD5ptXlq0=
github.com/hashicorp/raft v1.1.0/go.mod h1:4Ak7FSPnuvmb0GV6vgIAJ4vYT4bek9bb6Q+7HVbyzqM=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/nats-io/jwt v0.2.6 h1:eAyoYvGgGLXR2EpnsBUvi/FcFrBqN6YKFVbOoEfPN4k=
github.com/nats-io/jwt v0.2.6/go.mod h1:mQxQ0uHQ9FhEVPIcTSKwx2lqZEpXWWcCgA7R6NrWvvY=
github.com/nats-io/nats-server/v2 v2.0.0-RC19 h1:zwx9E5EimKLME0nlvSvcOC5ToX4sZLyRkAQmgpeA72o=
github.com/nats-io/nats-server/v2 v2.0.0-RC19/go.mod h1:RyVdsHHvY4B6c9pWG+uRLpZ0h0XsqiuKp2XCTurP5LI=
github.com/nats-io/nats.go v1.8.1 h1:6lF/f1/NN6kzUDBz6pyvQDEXO39jqXcWRLu/tKjtOUQ=
github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM=
github.com/nats-io/nkeys v0.0.2 h1:+qM7QpgXnvDDixitZtQUBDY9w/s9mu1ghS+JIbsrx6M=
github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/nats-io/stan.go v0.4.5 h1:lPZ9y1jVGiXcTaUc1SnEIWPYfh0avuEiHBePNJYgpPk=
github.com/nats-io/stan.go v0.4.5/go.mod h1:Ji7mK6gRZJSH1nc3ZJH6vi7zn/QnZhpR9Arm4iuzsUQ=
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc=
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
6 changes: 3 additions & 3 deletions logger/logger.go
@@ -1,4 +1,4 @@
// Copyright 2017-2018 The NATS Authors
// Copyright 2017-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -17,8 +17,8 @@ import (
"io"
"sync"

natsdLogger "github.com/nats-io/gnatsd/logger"
natsd "github.com/nats-io/gnatsd/server"
natsdLogger "github.com/nats-io/nats-server/v2/logger"
natsd "github.com/nats-io/nats-server/v2/server"
)

// LogPrefix is prefixed to all NATS Streaming log messages
Expand Down
4 changes: 2 additions & 2 deletions logger/logger_test.go
@@ -1,4 +1,4 @@
// Copyright 2017-2018 The NATS Authors
// Copyright 2017-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -22,7 +22,7 @@ import (
"strings"
"testing"

natsdLogger "github.com/nats-io/gnatsd/logger"
natsdLogger "github.com/nats-io/nats-server/v2/logger"
)

func TestMain(m *testing.M) {
Expand Down
4 changes: 2 additions & 2 deletions nats-streaming-server.go
@@ -1,4 +1,4 @@
// Copyright 2017-2018 The NATS Authors
// Copyright 2017-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -21,7 +21,7 @@ import (
"os"
"runtime"

natsd "github.com/nats-io/gnatsd/server"
natsd "github.com/nats-io/nats-server/v2/server"
stand "github.com/nats-io/nats-streaming-server/server"

_ "github.com/go-sql-driver/mysql" // mysql driver
Expand Down
7 changes: 6 additions & 1 deletion scripts/cross_compile.sh
@@ -1,6 +1,11 @@
#!/bin/bash -e

# For now depend on vendor directory.
# When we change to modules we need this to force pull in windows.
# GOOS=windows GOARCH=amd64 go get -u
export GO111MODULE="off"

go get github.com/mitchellh/gox
go get github.com/tcnksm/ghr

export APPNAME="nats-streaming-server"
export OSARCH="linux/386 linux/amd64 linux/arm64 darwin/amd64 windows/386 windows/amd64"
Expand Down
4 changes: 2 additions & 2 deletions server/bench_test.go
@@ -1,4 +1,4 @@
// Copyright 2016-2018 The NATS Authors
// Copyright 2016-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -19,9 +19,9 @@ import (
"testing"
"time"

"github.com/nats-io/go-nats-streaming"
"github.com/nats-io/nats-streaming-server/stores"
"github.com/nats-io/nats-streaming-server/test"
"github.com/nats-io/stan.go"
)

func benchCleanupDatastore(b *testing.B, dir string) {
Expand Down
4 changes: 2 additions & 2 deletions server/clustering.go
@@ -1,4 +1,4 @@
// Copyright 2017-2018 The NATS Authors
// Copyright 2017-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -24,8 +24,8 @@ import (
"time"

"github.com/hashicorp/raft"
"github.com/nats-io/go-nats"
"github.com/nats-io/nats-streaming-server/spb"
"github.com/nats-io/nats.go"
)

const (
Expand Down
12 changes: 6 additions & 6 deletions server/clustering_test.go
@@ -1,4 +1,4 @@
// Copyright 2017-2018 The NATS Authors
// Copyright 2017-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down Expand Up @@ -32,14 +32,14 @@ import (
"time"

"github.com/hashicorp/raft"
natsd "github.com/nats-io/gnatsd/server"
natsdTest "github.com/nats-io/gnatsd/test"
"github.com/nats-io/go-nats"
"github.com/nats-io/go-nats-streaming"
"github.com/nats-io/go-nats-streaming/pb"
natsd "github.com/nats-io/nats-server/v2/server"
natsdTest "github.com/nats-io/nats-server/v2/test"
"github.com/nats-io/nats-streaming-server/stores"
"github.com/nats-io/nats-streaming-server/test"
"github.com/nats-io/nats-streaming-server/util"
"github.com/nats-io/nats.go"
"github.com/nats-io/stan.go"
"github.com/nats-io/stan.go/pb"
)

var defaultRaftLog string
Expand Down
10 changes: 7 additions & 3 deletions server/conf.go
@@ -1,4 +1,4 @@
// Copyright 2016-2018 The NATS Authors
// Copyright 2016-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -21,12 +21,16 @@ import (
"strings"
"time"

"github.com/nats-io/gnatsd/conf"
natsd "github.com/nats-io/gnatsd/server"
"github.com/nats-io/nats-server/v2/conf"
natsd "github.com/nats-io/nats-server/v2/server"
"github.com/nats-io/nats-streaming-server/stores"
"github.com/nats-io/nats-streaming-server/util"
)

func init() {
natsd.NoErrOnUnknownFields(true)
}

// ProcessConfigFile parses the configuration file `configFile` and updates
// the given Streaming options `opts`.
func ProcessConfigFile(configFile string, opts *Options) error {
Expand Down
8 changes: 4 additions & 4 deletions server/conf_test.go
@@ -1,4 +1,4 @@
// Copyright 2016-2018 The NATS Authors
// Copyright 2016-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -24,7 +24,7 @@ import (
"testing"
"time"

natsd "github.com/nats-io/gnatsd/server"
natsd "github.com/nats-io/nats-server/v2/server"
"github.com/nats-io/nats-streaming-server/stores"
)

Expand Down Expand Up @@ -557,9 +557,9 @@ func TestParseConfigureOptions(t *testing.T) {
}

// Failures with bytes
expectToFail([]string{"-max_bytes", "12abc"}, "error")
expectToFail([]string{"-max_bytes", "12abc"}, "should be a size")
expectToFail([]string{"-max_bytes", "x1x"}, "size")
expectToFail([]string{"-max_bytes", "100a", "-mb", "100a", "-file_compact_min_size", "200a", "-file_buffer_size", "300a"}, "error")
expectToFail([]string{"-max_bytes", "100a", "-mb", "100a", "-file_compact_min_size", "200a", "-file_buffer_size", "300a"}, "should be a size")

sconf := "s.conf"
nconf := "n.conf"
Expand Down
4 changes: 2 additions & 2 deletions server/ft.go
@@ -1,4 +1,4 @@
// Copyright 2017-2018 The NATS Authors
// Copyright 2017-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -18,10 +18,10 @@ import (
"math/rand"
"time"

"github.com/nats-io/go-nats"
"github.com/nats-io/nats-streaming-server/spb"
"github.com/nats-io/nats-streaming-server/stores"
"github.com/nats-io/nats-streaming-server/util"
"github.com/nats-io/nats.go"
)

// FT constants
Expand Down
8 changes: 4 additions & 4 deletions server/ft_test.go
@@ -1,4 +1,4 @@
// Copyright 2017-2018 The NATS Authors
// Copyright 2017-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -24,11 +24,11 @@ import (
"testing"
"time"

natsdTest "github.com/nats-io/gnatsd/test"
"github.com/nats-io/go-nats"
"github.com/nats-io/go-nats-streaming"
natsdTest "github.com/nats-io/nats-server/v2/test"
"github.com/nats-io/nats-streaming-server/spb"
"github.com/nats-io/nats-streaming-server/stores"
"github.com/nats-io/nats.go"
"github.com/nats-io/stan.go"
)

// A mock store that we use to override GetExclusiveLock() behavior.
Expand Down
16 changes: 10 additions & 6 deletions server/monitor.go
@@ -1,4 +1,4 @@
// Copyright 2017-2018 The NATS Authors
// Copyright 2017-2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -23,7 +23,7 @@ import (
"strconv"
"time"

gnatsd "github.com/nats-io/gnatsd/server"
natsd "github.com/nats-io/nats-server/v2/server"
"github.com/nats-io/nats-streaming-server/stores"
"github.com/prometheus/procfs"
)
Expand Down Expand Up @@ -128,12 +128,16 @@ type Subscriptionz struct {
IsStalled bool `json:"is_stalled"`
}

func (s *StanServer) startMonitoring(nOpts *gnatsd.Options) error {
func (s *StanServer) startMonitoring(nOpts *natsd.Options) error {
var hh http.Handler
// If we are connecting to remote NATS Server, we start our own
// HTTP(s) server.
if s.opts.NATSServerURL != "" {
s.natsServer = gnatsd.New(nOpts)
ns, err := natsd.NewServer(nOpts)
if err != nil {
return err
}
s.natsServer = ns
if err := s.natsServer.StartMonitoring(); err != nil {
return err
}
Expand Down Expand Up @@ -203,7 +207,7 @@ func (s *StanServer) handleServerz(w http.ResponseWriter, r *http.Request) {
http.Error(w, fmt.Sprintf("Error getting file descriptors len: %v", err), http.StatusInternalServerError)
return
}
limits, err := p.NewLimits()
limits, err := p.Limits()
if err != nil {
http.Error(w, fmt.Sprintf("Error getting process limits: %v", err), http.StatusInternalServerError)
return
Expand Down Expand Up @@ -519,7 +523,7 @@ func (s *StanServer) sendResponse(w http.ResponseWriter, r *http.Request, conten
if err != nil {
s.log.Errorf("Error marshaling response to %q request: %v", r.URL, err)
}
gnatsd.ResponseHandler(w, r, b)
natsd.ResponseHandler(w, r, b)
}

func getOffsetAndLimit(r *http.Request) (int, int) {
Expand Down

0 comments on commit dfa75d1

Please sign in to comment.