Skip to content

Commit

Permalink
Move go proto to pkg/proto, add .gitattributes
Browse files Browse the repository at this point in the history
  • Loading branch information
pomo-mondreganto committed Nov 17, 2023
1 parent 98745f7 commit 2c3d1f9
Show file tree
Hide file tree
Showing 31 changed files with 33 additions and 3,155 deletions.
2 changes: 1 addition & 1 deletion cmd/client/cli/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/c4t-but-s4d/neo/v2/internal/client"
"github.com/c4t-but-s4d/neo/v2/pkg/archive"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

type addCLI struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/client/cli/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra"

"github.com/c4t-but-s4d/neo/v2/internal/client"
logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
logspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/logs"
)

type tailCLI struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/client/cli/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

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

epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

type updateCLI struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/client/cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/samber/lo"

"github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
"github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

func isBinary(data []byte) bool {
Expand Down
6 changes: 3 additions & 3 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"github.com/c4t-but-s4d/neo/v2/pkg/mu"
"github.com/c4t-but-s4d/neo/v2/pkg/neohttp"
"github.com/c4t-but-s4d/neo/v2/pkg/neosync"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
fspb "github.com/c4t-but-s4d/neo/v2/proto/go/fileserver"
logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
fspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/fileserver"
logspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/logs"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"google.golang.org/grpc"

"github.com/c4t-but-s4d/neo/v2/pkg/filestream"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
fspb "github.com/c4t-but-s4d/neo/v2/proto/go/fileserver"
logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
fspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/fileserver"
logspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/logs"
)

func New(cc grpc.ClientConnInterface, id string) *Client {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"google.golang.org/protobuf/types/known/durationpb"

epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

type ExploitsConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/exploit/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sync"
"time"

epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

func NewCache() *Cache {
Expand Down
2 changes: 1 addition & 1 deletion internal/exploit/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/google/go-cmp/cmp/cmpopts"
"google.golang.org/protobuf/testing/protocmp"

epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

func TestCache_Diff(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/exploit/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/c4t-but-s4d/neo/v2/internal/models"
"github.com/c4t-but-s4d/neo/v2/internal/queue"
"github.com/c4t-but-s4d/neo/v2/pkg/joblogger"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/exploit/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/c4t-but-s4d/neo/v2/internal/client"
"github.com/c4t-but-s4d/neo/v2/pkg/archive"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

func NewStorage(cache *Cache, exploitDir string, client *client.Client) *Storage {
Expand Down
2 changes: 1 addition & 1 deletion internal/exploit/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/c4t-but-s4d/neo/v2/pkg/archive"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

func mockStorage() (*Storage, func() error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/exploits/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
serverConfig "github.com/c4t-but-s4d/neo/v2/internal/server/config"
"github.com/c4t-but-s4d/neo/v2/pkg/gstream"
"github.com/c4t-but-s4d/neo/v2/pkg/hostbucket"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
"github.com/c4t-but-s4d/neo/v2/pkg/pubsub"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
)

func New(cfg *serverConfig.Config, storage *CachedStorage) *Server {
Expand Down
4 changes: 2 additions & 2 deletions internal/server/exploits/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

"github.com/c4t-but-s4d/neo/v2/internal/server/config"
"github.com/c4t-but-s4d/neo/v2/pkg/hostbucket"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
fspb "github.com/c4t-but-s4d/neo/v2/proto/go/fileserver"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
fspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/fileserver"
)

func testServer(t *testing.T) (*Server, func()) {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/exploits/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
bolt "go.etcd.io/bbolt"
"google.golang.org/protobuf/proto"

epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/server/exploits/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/testing/protocmp"

epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
fspb "github.com/c4t-but-s4d/neo/v2/proto/go/fileserver"
epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
fspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/fileserver"
)

func testDB() (*bolt.DB, func()) {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/fs/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
serverConfig "github.com/c4t-but-s4d/neo/v2/internal/server/config"
"github.com/c4t-but-s4d/neo/v2/internal/server/utils"
"github.com/c4t-but-s4d/neo/v2/pkg/filestream"
fspb "github.com/c4t-but-s4d/neo/v2/proto/go/fileserver"
fspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/fileserver"
)

func New(cfg *serverConfig.Config) (*Server, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/logs/logline.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/mitchellh/mapstructure"

logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
logspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/logs"
)

func NewLogLineFromValues(vals map[string]interface{}) (*LogLine, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/logs/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/c4t-but-s4d/neo/v2/internal/server/common"
"github.com/c4t-but-s4d/neo/v2/internal/server/utils"
"github.com/c4t-but-s4d/neo/v2/pkg/gstream"
logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
logspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/logs"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/filestream/filestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io"

fspb "github.com/c4t-but-s4d/neo/v2/proto/go/fileserver"
fspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/fileserver"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/filestream/filestream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"

fspb "github.com/c4t-but-s4d/neo/v2/proto/go/fileserver"
fspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/fileserver"
)

type failedReadWriter struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/hostbucket/hostbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

epb "github.com/c4t-but-s4d/neo/v2/pkg/proto/exploits"
"github.com/c4t-but-s4d/neo/v2/pkg/rendezvous"
epb "github.com/c4t-but-s4d/neo/v2/proto/go/exploits"
)

func New(teams map[string]string) *HostBucket {
Expand Down
2 changes: 1 addition & 1 deletion pkg/joblogger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/sirupsen/logrus"

"github.com/c4t-but-s4d/neo/v2/internal/logger"
logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
logspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/logs"
)

// 1 MB.
Expand Down
2 changes: 1 addition & 1 deletion pkg/joblogger/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/sirupsen/logrus"

"github.com/c4t-but-s4d/neo/v2/internal/client"
logspb "github.com/c4t-but-s4d/neo/v2/proto/go/logs"
logspb "github.com/c4t-but-s4d/neo/v2/pkg/proto/logs"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions proto/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ version: v1
managed:
enabled: true
go_package_prefix:
default: github.com/c4t-but-s4d/neo/v2/proto/go
default: github.com/c4t-but-s4d/neo/v2/pkg/proto
plugins:
# Go
- name: go
out: go
out: ../pkg/proto
opt:
- paths=source_relative
- name: go-grpc
out: go
out: ../pkg/proto
opt:
- paths=source_relative

Expand Down
Loading

0 comments on commit 2c3d1f9

Please sign in to comment.