Skip to content

Commit 8682d2e

Browse files
Merge pull request #19 from C4T-BuT-S4D/pomo/better-modules
Make Neo importable in Go
2 parents b380bc7 + 7cb7b46 commit 8682d2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+220
-210
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
uses: actions/checkout@v3
1111

1212
- name: Set up Go
13-
uses: actions/setup-go@v3
13+
uses: actions/setup-go@v4
1414
with:
1515
go-version-file: 'go.mod'
1616

cmd/client/cli/add.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import (
1717
"github.com/spf13/cobra"
1818
"google.golang.org/protobuf/types/known/durationpb"
1919

20-
"github.com/c4t-but-s4d/neo/internal/client"
21-
"github.com/c4t-but-s4d/neo/pkg/archive"
22-
epb "github.com/c4t-but-s4d/neo/proto/go/exploits"
20+
"github.com/c4t-but-s4d/neo/v2/internal/client"
21+
"github.com/c4t-but-s4d/neo/v2/pkg/archive"
22+
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
2323
)
2424

2525
type addCLI struct {

cmd/client/cli/broadcast.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/sirupsen/logrus"
88
"github.com/spf13/cobra"
99

10-
"github.com/c4t-but-s4d/neo/internal/client"
10+
"github.com/c4t-but-s4d/neo/v2/internal/client"
1111
)
1212

1313
type broadcastCLI struct {

cmd/client/cli/cli.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
"google.golang.org/grpc/credentials/insecure"
1313
"google.golang.org/grpc/encoding/gzip"
1414

15-
"github.com/c4t-but-s4d/neo/internal/client"
16-
"github.com/c4t-but-s4d/neo/pkg/grpcauth"
15+
"github.com/c4t-but-s4d/neo/v2/internal/client"
16+
"github.com/c4t-but-s4d/neo/v2/pkg/grpcauth"
1717
)
1818

1919
type NeoCLI interface {

cmd/client/cli/dry_run.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import (
1010
"github.com/sirupsen/logrus"
1111
"github.com/spf13/cobra"
1212

13-
"github.com/c4t-but-s4d/neo/internal/client"
14-
"github.com/c4t-but-s4d/neo/internal/config"
15-
"github.com/c4t-but-s4d/neo/internal/exploit"
16-
"github.com/c4t-but-s4d/neo/internal/queue"
17-
"github.com/c4t-but-s4d/neo/pkg/joblogger"
13+
"github.com/c4t-but-s4d/neo/v2/internal/client"
14+
"github.com/c4t-but-s4d/neo/v2/internal/config"
15+
"github.com/c4t-but-s4d/neo/v2/internal/exploit"
16+
"github.com/c4t-but-s4d/neo/v2/internal/queue"
17+
"github.com/c4t-but-s4d/neo/v2/pkg/joblogger"
1818
)
1919

2020
type dryRunCLI struct {

cmd/client/cli/info.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66

77
"github.com/spf13/cobra"
88

9-
"github.com/c4t-but-s4d/neo/internal/client"
10-
"github.com/c4t-but-s4d/neo/internal/config"
9+
"github.com/c4t-but-s4d/neo/v2/internal/client"
10+
"github.com/c4t-but-s4d/neo/v2/internal/config"
1111
)
1212

1313
type infoCLI struct {

cmd/client/cli/run.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"github.com/sirupsen/logrus"
88
"github.com/spf13/cobra"
99

10-
"github.com/c4t-but-s4d/neo/internal/client"
11-
"github.com/c4t-but-s4d/neo/internal/exploit"
12-
"github.com/c4t-but-s4d/neo/pkg/joblogger"
10+
"github.com/c4t-but-s4d/neo/v2/internal/client"
11+
"github.com/c4t-but-s4d/neo/v2/internal/exploit"
12+
"github.com/c4t-but-s4d/neo/v2/pkg/joblogger"
1313
)
1414

1515
const JobsPerCPU = 5

cmd/client/cli/set_disabled.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"github.com/spf13/cobra"
88

9-
"github.com/c4t-but-s4d/neo/internal/client"
9+
"github.com/c4t-but-s4d/neo/v2/internal/client"
1010
)
1111

1212
type setDisabledCli struct {

cmd/client/cli/single.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/sirupsen/logrus"
88
"github.com/spf13/cobra"
99

10-
"github.com/c4t-but-s4d/neo/internal/client"
10+
"github.com/c4t-but-s4d/neo/v2/internal/client"
1111
)
1212

1313
type singleRunCLI struct {

cmd/client/cli/tail.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"github.com/sirupsen/logrus"
88
"github.com/spf13/cobra"
99

10-
"github.com/c4t-but-s4d/neo/internal/client"
11-
logspb "github.com/c4t-but-s4d/neo/proto/go/logs"
10+
"github.com/c4t-but-s4d/neo/v2/internal/client"
11+
logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
1212
)
1313

1414
type tailCLI struct {

cmd/client/cli/update.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"github.com/spf13/cobra"
1111
"google.golang.org/protobuf/types/known/durationpb"
1212

13-
"github.com/c4t-but-s4d/neo/internal/client"
13+
"github.com/c4t-but-s4d/neo/v2/internal/client"
1414

15-
epb "github.com/c4t-but-s4d/neo/proto/go/exploits"
15+
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
1616
)
1717

1818
type updateCLI struct {

cmd/client/cli/utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/samber/lo"
77

8-
"github.com/c4t-but-s4d/neo/proto/go/exploits"
8+
"github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
99
)
1010

1111
func isBinary(data []byte) bool {

cmd/client/cmd/add.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"github.com/sirupsen/logrus"
77
"github.com/spf13/cobra"
88

9-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
10-
"github.com/c4t-but-s4d/neo/internal/client"
9+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
10+
"github.com/c4t-but-s4d/neo/v2/internal/client"
1111
)
1212

1313
// addCmd represents the add command

cmd/client/cmd/broadcast.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/sirupsen/logrus"
55
"github.com/spf13/cobra"
66

7-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
8-
"github.com/c4t-but-s4d/neo/internal/client"
7+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
8+
"github.com/c4t-but-s4d/neo/v2/internal/client"
99
)
1010

1111
// broadcastCmd represents the broadcast command

cmd/client/cmd/disable.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/sirupsen/logrus"
55
"github.com/spf13/cobra"
66

7-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
8-
"github.com/c4t-but-s4d/neo/internal/client"
7+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
8+
"github.com/c4t-but-s4d/neo/v2/internal/client"
99
)
1010

1111
// disableCmd represents the disable command

cmd/client/cmd/dry_run.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"github.com/sirupsen/logrus"
77
"github.com/spf13/cobra"
88

9-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
10-
"github.com/c4t-but-s4d/neo/internal/client"
9+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
10+
"github.com/c4t-but-s4d/neo/v2/internal/client"
1111
)
1212

1313
// runCmd represents the run command

cmd/client/cmd/enable.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/sirupsen/logrus"
55
"github.com/spf13/cobra"
66

7-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
8-
"github.com/c4t-but-s4d/neo/internal/client"
7+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
8+
"github.com/c4t-but-s4d/neo/v2/internal/client"
99
)
1010

1111
// enableCmd represents the enable command

cmd/client/cmd/info.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/sirupsen/logrus"
55
"github.com/spf13/cobra"
66

7-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
8-
"github.com/c4t-but-s4d/neo/internal/client"
7+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
8+
"github.com/c4t-but-s4d/neo/v2/internal/client"
99
)
1010

1111
// infoCmd represents the info command

cmd/client/cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/spf13/cobra"
1111
"github.com/spf13/viper"
1212

13-
"github.com/c4t-but-s4d/neo/internal/logger"
13+
"github.com/c4t-but-s4d/neo/v2/internal/logger"
1414
)
1515

1616
// rootCmd represents the base command when called without any subcommands

cmd/client/cmd/run.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"github.com/sirupsen/logrus"
77
"github.com/spf13/cobra"
88

9-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
10-
"github.com/c4t-but-s4d/neo/internal/client"
9+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
10+
"github.com/c4t-but-s4d/neo/v2/internal/client"
1111
)
1212

1313
// runCmd represents the run command

cmd/client/cmd/single.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/sirupsen/logrus"
55
"github.com/spf13/cobra"
66

7-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
8-
"github.com/c4t-but-s4d/neo/internal/client"
7+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
8+
"github.com/c4t-but-s4d/neo/v2/internal/client"
99
)
1010

1111
// singleRunCmd represents the single command

cmd/client/cmd/tail.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/sirupsen/logrus"
55
"github.com/spf13/cobra"
66

7-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
8-
"github.com/c4t-but-s4d/neo/internal/client"
7+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
8+
"github.com/c4t-but-s4d/neo/v2/internal/client"
99
)
1010

1111
// tailCmd represents the tail command

cmd/client/cmd/update.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package cmd
33
import (
44
"time"
55

6-
"github.com/c4t-but-s4d/neo/cmd/client/cli"
7-
"github.com/c4t-but-s4d/neo/internal/client"
86
"github.com/sirupsen/logrus"
97
"github.com/spf13/cobra"
8+
9+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cli"
10+
"github.com/c4t-but-s4d/neo/v2/internal/client"
1011
)
1112

1213
// tailCmd represents the tail command

cmd/client/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"os"
66
"os/signal"
77

8-
"github.com/c4t-but-s4d/neo/cmd/client/cmd"
8+
"github.com/c4t-but-s4d/neo/v2/cmd/client/cmd"
99
)
1010

1111
func main() {

cmd/reaper/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88

99
"github.com/sirupsen/logrus"
1010

11-
"github.com/c4t-but-s4d/neo/internal/logger"
12-
"github.com/c4t-but-s4d/neo/pkg/neoproc"
11+
"github.com/c4t-but-s4d/neo/v2/internal/logger"
12+
"github.com/c4t-but-s4d/neo/v2/pkg/neoproc"
1313
)
1414

1515
func main() {

cmd/server/main.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ import (
1919
_ "google.golang.org/grpc/encoding/gzip"
2020
"google.golang.org/grpc/reflection"
2121

22-
"github.com/c4t-but-s4d/neo/internal/logger"
23-
"github.com/c4t-but-s4d/neo/internal/server/config"
24-
"github.com/c4t-but-s4d/neo/internal/server/exploits"
25-
"github.com/c4t-but-s4d/neo/internal/server/fs"
26-
logs "github.com/c4t-but-s4d/neo/internal/server/logs"
27-
"github.com/c4t-but-s4d/neo/pkg/grpcauth"
28-
"github.com/c4t-but-s4d/neo/pkg/neosync"
29-
epb "github.com/c4t-but-s4d/neo/proto/go/exploits"
30-
fspb "github.com/c4t-but-s4d/neo/proto/go/fileserver"
31-
logspb "github.com/c4t-but-s4d/neo/proto/go/logs"
22+
"github.com/c4t-but-s4d/neo/v2/internal/logger"
23+
"github.com/c4t-but-s4d/neo/v2/internal/server/config"
24+
"github.com/c4t-but-s4d/neo/v2/internal/server/exploits"
25+
"github.com/c4t-but-s4d/neo/v2/internal/server/fs"
26+
logs "github.com/c4t-but-s4d/neo/v2/internal/server/logs"
27+
"github.com/c4t-but-s4d/neo/v2/pkg/grpcauth"
28+
"github.com/c4t-but-s4d/neo/v2/pkg/neosync"
29+
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
30+
fspb "github.com/c4t-but-s4d/neo/v2/proto/go/fileserver"
31+
logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
3232
)
3333

3434
func main() {

compose.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '2.4'
2-
31
services:
42
server:
53
build: .

go.mod

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,58 @@
1-
module github.com/c4t-but-s4d/neo
1+
module github.com/c4t-but-s4d/neo/v2
22

33
go 1.21
44

55
require (
66
github.com/denisbrodbeck/machineid v1.0.1
77
github.com/fsnotify/fsnotify v1.6.0 // indirect
88
github.com/go-redis/redis/v8 v8.11.5
9-
github.com/google/go-cmp v0.5.9
9+
github.com/google/go-cmp v0.6.0
1010
github.com/google/uuid v1.3.1
1111
github.com/mitchellh/mapstructure v1.5.0
1212
github.com/sirupsen/logrus v1.9.3
1313
github.com/spaolacci/murmur3 v1.1.0
1414
github.com/spf13/cobra v1.7.0
1515
github.com/spf13/pflag v1.0.5
16-
github.com/spf13/viper v1.16.0
16+
github.com/spf13/viper v1.17.0
1717
github.com/stretchr/testify v1.8.4
1818
go.etcd.io/bbolt v1.3.7
1919
go.uber.org/goleak v1.2.1
20-
google.golang.org/grpc v1.57.0
20+
google.golang.org/grpc v1.58.3
2121
google.golang.org/protobuf v1.31.0
2222
gopkg.in/yaml.v3 v3.0.1 // indirect
2323
)
2424

2525
require (
26-
github.com/prometheus/client_golang v1.16.0
26+
github.com/prometheus/client_golang v1.17.0
2727
github.com/prometheus/common v0.44.0
2828
github.com/samber/lo v1.38.1
29-
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
30-
golang.org/x/sys v0.11.0
29+
golang.org/x/sys v0.13.0
3130
)
3231

3332
require (
3433
github.com/beorn7/perks v1.0.1 // indirect
3534
github.com/cespare/xxhash/v2 v2.2.0 // indirect
36-
github.com/davecgh/go-spew v1.1.1 // indirect
35+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3736
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
3837
github.com/golang/protobuf v1.5.3 // indirect
3938
github.com/hashicorp/hcl v1.0.0 // indirect
4039
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4140
github.com/magiconair/properties v1.8.7 // indirect
4241
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
43-
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
44-
github.com/pmezard/go-difflib v1.0.0 // indirect
45-
github.com/prometheus/client_model v0.4.0 // indirect
46-
github.com/prometheus/procfs v0.11.1 // indirect
47-
github.com/spf13/afero v1.9.5 // indirect
42+
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
43+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
44+
github.com/prometheus/client_model v0.5.0 // indirect
45+
github.com/prometheus/procfs v0.12.0 // indirect
46+
github.com/sagikazarmark/locafero v0.3.0 // indirect
47+
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
48+
github.com/sourcegraph/conc v0.3.0 // indirect
49+
github.com/spf13/afero v1.10.0 // indirect
4850
github.com/spf13/cast v1.5.1 // indirect
49-
github.com/spf13/jwalterweatherman v1.1.0 // indirect
5051
github.com/subosito/gotenv v1.6.0 // indirect
51-
golang.org/x/net v0.14.0 // indirect
52-
golang.org/x/text v0.12.0 // indirect
53-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
52+
go.uber.org/multierr v1.11.0 // indirect
53+
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
54+
golang.org/x/net v0.17.0 // indirect
55+
golang.org/x/text v0.13.0 // indirect
56+
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect
5457
gopkg.in/ini.v1 v1.67.0 // indirect
5558
)

0 commit comments

Comments
 (0)