diff --git a/cmd/cnetflow/cnetflow.go b/cmd/cnetflow/cnetflow.go index 120a937..f8780fc 100644 --- a/cmd/cnetflow/cnetflow.go +++ b/cmd/cnetflow/cnetflow.go @@ -3,14 +3,14 @@ package main import ( "flag" "fmt" - "github.com/cloudflare/goflow/transport" - "github.com/cloudflare/goflow/utils" - log "github.com/sirupsen/logrus" + "net/http" "os" "runtime" + "github.com/cloudflare/goflow/v3/transport" + "github.com/cloudflare/goflow/v3/utils" "github.com/prometheus/client_golang/prometheus/promhttp" - "net/http" + log "github.com/sirupsen/logrus" ) var ( diff --git a/cmd/cnflegacy/cnflegacy.go b/cmd/cnflegacy/cnflegacy.go index dd8a454..722d559 100644 --- a/cmd/cnflegacy/cnflegacy.go +++ b/cmd/cnflegacy/cnflegacy.go @@ -3,14 +3,14 @@ package main import ( "flag" "fmt" - "github.com/cloudflare/goflow/transport" - "github.com/cloudflare/goflow/utils" - log "github.com/sirupsen/logrus" + "net/http" "os" "runtime" + "github.com/cloudflare/goflow/v3/transport" + "github.com/cloudflare/goflow/v3/utils" "github.com/prometheus/client_golang/prometheus/promhttp" - "net/http" + log "github.com/sirupsen/logrus" ) var ( diff --git a/cmd/csflow/csflow.go b/cmd/csflow/csflow.go index 18e8878..92e3e40 100644 --- a/cmd/csflow/csflow.go +++ b/cmd/csflow/csflow.go @@ -3,14 +3,14 @@ package main import ( "flag" "fmt" - "github.com/cloudflare/goflow/transport" - "github.com/cloudflare/goflow/utils" - log "github.com/sirupsen/logrus" + "net/http" "os" "runtime" + "github.com/cloudflare/goflow/v3/transport" + "github.com/cloudflare/goflow/v3/utils" "github.com/prometheus/client_golang/prometheus/promhttp" - "net/http" + log "github.com/sirupsen/logrus" ) var ( diff --git a/cmd/goflow/goflow.go b/cmd/goflow/goflow.go index af12937..5c8afad 100644 --- a/cmd/goflow/goflow.go +++ b/cmd/goflow/goflow.go @@ -3,16 +3,15 @@ package main import ( "flag" "fmt" - "github.com/cloudflare/goflow/transport" - "github.com/cloudflare/goflow/utils" - log "github.com/sirupsen/logrus" + "net/http" "os" "runtime" + "sync" + "github.com/cloudflare/goflow/v3/transport" + "github.com/cloudflare/goflow/v3/utils" "github.com/prometheus/client_golang/prometheus/promhttp" - "net/http" - - "sync" + log "github.com/sirupsen/logrus" ) var ( diff --git a/decoders/netflow/netflow.go b/decoders/netflow/netflow.go index e8b53fb..3a415d2 100644 --- a/decoders/netflow/netflow.go +++ b/decoders/netflow/netflow.go @@ -4,8 +4,9 @@ import ( "bytes" "encoding/binary" "fmt" - "github.com/cloudflare/goflow/decoders/utils" "sync" + + "github.com/cloudflare/goflow/v3/decoders/utils" ) type FlowBaseTemplateSet map[uint16]map[uint32]map[uint16]interface{} diff --git a/decoders/netflowlegacy/netflow.go b/decoders/netflowlegacy/netflow.go index 93741fa..fdeca7b 100644 --- a/decoders/netflowlegacy/netflow.go +++ b/decoders/netflowlegacy/netflow.go @@ -3,7 +3,8 @@ package netflowlegacy import ( "bytes" "fmt" - "github.com/cloudflare/goflow/decoders/utils" + + "github.com/cloudflare/goflow/v3/decoders/utils" ) type ErrorVersion struct { diff --git a/decoders/netflowlegacy/netflow_test.go b/decoders/netflowlegacy/netflow_test.go index a72f178..076db5d 100644 --- a/decoders/netflowlegacy/netflow_test.go +++ b/decoders/netflowlegacy/netflow_test.go @@ -2,8 +2,9 @@ package netflowlegacy import ( "bytes" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestDecodeNetFlowV5(t *testing.T) { diff --git a/decoders/sflow/sflow.go b/decoders/sflow/sflow.go index a8ef311..5208809 100644 --- a/decoders/sflow/sflow.go +++ b/decoders/sflow/sflow.go @@ -4,7 +4,8 @@ import ( "bytes" "errors" "fmt" - "github.com/cloudflare/goflow/decoders/utils" + + "github.com/cloudflare/goflow/v3/decoders/utils" ) const ( diff --git a/decoders/sflow/sflow_test.go b/decoders/sflow/sflow_test.go index 68e0291..195aa9a 100644 --- a/decoders/sflow/sflow_test.go +++ b/decoders/sflow/sflow_test.go @@ -2,8 +2,9 @@ package sflow import ( "bytes" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestSFlowDecode(t *testing.T) { diff --git a/go.mod b/go.mod index 39a30bc..cae068e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cloudflare/goflow +module github.com/cloudflare/goflow/v3 go 1.12 diff --git a/pb/flow.pb.go b/pb/flow.pb.go index 9bc035b..874ed38 100644 --- a/pb/flow.pb.go +++ b/pb/flow.pb.go @@ -5,8 +5,9 @@ package flowprotob import ( fmt "fmt" - proto "github.com/golang/protobuf/proto" math "math" + + proto "github.com/golang/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/producer/producer_nf.go b/producer/producer_nf.go index 3df89a2..263a0c5 100644 --- a/producer/producer_nf.go +++ b/producer/producer_nf.go @@ -5,11 +5,12 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/cloudflare/goflow/decoders/netflow" - flowmessage "github.com/cloudflare/goflow/pb" "net" "sync" "time" + + "github.com/cloudflare/goflow/v3/decoders/netflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" ) type SamplingRateSystem interface { diff --git a/producer/producer_nflegacy.go b/producer/producer_nflegacy.go index 5dcd422..990da0e 100644 --- a/producer/producer_nflegacy.go +++ b/producer/producer_nflegacy.go @@ -3,9 +3,10 @@ package producer import ( "encoding/binary" "errors" - "github.com/cloudflare/goflow/decoders/netflowlegacy" - flowmessage "github.com/cloudflare/goflow/pb" "net" + + "github.com/cloudflare/goflow/v3/decoders/netflowlegacy" + flowmessage "github.com/cloudflare/goflow/v3/pb" ) func ConvertNetFlowLegacyRecord(baseTime uint32, uptime uint32, record netflowlegacy.RecordsNetFlowV5) *flowmessage.FlowMessage { diff --git a/producer/producer_sf.go b/producer/producer_sf.go index 963147e..12e5212 100644 --- a/producer/producer_sf.go +++ b/producer/producer_sf.go @@ -3,9 +3,10 @@ package producer import ( "encoding/binary" "errors" - "github.com/cloudflare/goflow/decoders/sflow" - flowmessage "github.com/cloudflare/goflow/pb" "net" + + "github.com/cloudflare/goflow/v3/decoders/sflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" ) func GetSFlowFlowSamples(packet *sflow.Packet) []interface{} { diff --git a/producer/producer_test.go b/producer/producer_test.go index f584ba9..fcefb3e 100644 --- a/producer/producer_test.go +++ b/producer/producer_test.go @@ -1,10 +1,11 @@ package producer import ( - "github.com/cloudflare/goflow/decoders/netflow" - "github.com/cloudflare/goflow/decoders/sflow" - "github.com/stretchr/testify/assert" "testing" + + "github.com/cloudflare/goflow/v3/decoders/netflow" + "github.com/cloudflare/goflow/v3/decoders/sflow" + "github.com/stretchr/testify/assert" ) func TestProcessMessageNetFlow(t *testing.T) { diff --git a/transport/kafka.go b/transport/kafka.go index c0aade8..ac364b6 100644 --- a/transport/kafka.go +++ b/transport/kafka.go @@ -3,20 +3,17 @@ package transport import ( "crypto/tls" "crypto/x509" - "fmt" - "strings" - - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/cloudflare/goflow/utils" - proto "github.com/golang/protobuf/proto" - - //"github.com/golang/protobuf/descriptor" "errors" "flag" + "fmt" "os" "reflect" + "strings" sarama "github.com/Shopify/sarama" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/utils" + proto "github.com/golang/protobuf/proto" ) var ( diff --git a/transport/transport_test.go b/transport/transport_test.go index 0791e0a..f092cff 100644 --- a/transport/transport_test.go +++ b/transport/transport_test.go @@ -1,9 +1,10 @@ package transport import ( - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/stretchr/testify/assert" "testing" + + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/stretchr/testify/assert" ) func TestHash(t *testing.T) { diff --git a/utils/metrics.go b/utils/metrics.go index 216f013..585923c 100644 --- a/utils/metrics.go +++ b/utils/metrics.go @@ -1,9 +1,10 @@ package utils import ( - "github.com/prometheus/client_golang/prometheus" "strconv" "time" + + "github.com/prometheus/client_golang/prometheus" ) var ( diff --git a/utils/netflow.go b/utils/netflow.go index d24dd36..6fe2935 100644 --- a/utils/netflow.go +++ b/utils/netflow.go @@ -3,14 +3,15 @@ package utils import ( "bytes" "encoding/json" - "github.com/cloudflare/goflow/decoders/netflow" - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/cloudflare/goflow/producer" - "github.com/prometheus/client_golang/prometheus" "net/http" "strconv" "sync" "time" + + "github.com/cloudflare/goflow/v3/decoders/netflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/producer" + "github.com/prometheus/client_golang/prometheus" ) type TemplateSystem struct { diff --git a/utils/nflegacy.go b/utils/nflegacy.go index 5d48c4e..124216c 100644 --- a/utils/nflegacy.go +++ b/utils/nflegacy.go @@ -2,11 +2,12 @@ package utils import ( "bytes" - "github.com/cloudflare/goflow/decoders/netflowlegacy" - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/cloudflare/goflow/producer" - "github.com/prometheus/client_golang/prometheus" "time" + + "github.com/cloudflare/goflow/v3/decoders/netflowlegacy" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/producer" + "github.com/prometheus/client_golang/prometheus" ) type StateNFLegacy struct { diff --git a/utils/sflow.go b/utils/sflow.go index 74a5243..ef62805 100644 --- a/utils/sflow.go +++ b/utils/sflow.go @@ -2,12 +2,13 @@ package utils import ( "bytes" - "github.com/cloudflare/goflow/decoders/sflow" - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/cloudflare/goflow/producer" - "github.com/prometheus/client_golang/prometheus" "net" "time" + + "github.com/cloudflare/goflow/v3/decoders/sflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/producer" + "github.com/prometheus/client_golang/prometheus" ) type StateSFlow struct { diff --git a/utils/utils.go b/utils/utils.go index 543a220..3c297fd 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -4,14 +4,15 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/cloudflare/goflow/decoders" - "github.com/cloudflare/goflow/decoders/netflow" - flowmessage "github.com/cloudflare/goflow/pb" - reuseport "github.com/libp2p/go-reuseport" - "github.com/prometheus/client_golang/prometheus" "net" "strconv" "time" + + decoder "github.com/cloudflare/goflow/v3/decoders" + "github.com/cloudflare/goflow/v3/decoders/netflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" + reuseport "github.com/libp2p/go-reuseport" + "github.com/prometheus/client_golang/prometheus" ) func GetServiceAddresses(srv string) (addrs []string, err error) {