Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor location of types as they not only belong to plugins #1485

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ dkron/ui-dist: ui/node_modules ui/public/* ui/src/* ui/src/*/*
rm -rf dkron/ui-dist
cd ui; bun run build --out-dir ../dkron/ui-dist

plugin/types/%.pb.go: proto/%.proto
protoc -I proto/ --go_out=plugin/types --go_opt=paths=source_relative --go-grpc_out=plugin/types --go-grpc_opt=paths=source_relative $<
proto: types/dkron.pb.go types/executor.pb.go types/pro.pb.go

types/%.pb.go: proto/%.proto
protoc -I proto/ --go_out=types --go_opt=paths=source_relative --go-grpc_out=types --go-grpc_opt=paths=source_relative $<

ui: dkron/ui-dist

main: dkron/ui-dist plugin/types/dkron.pb.go plugin/types/executor.pb.go *.go */*.go */*/*.go */*/*/*.go
main: dkron/ui-dist types/dkron.pb.go types/executor.pb.go *.go */*.go */*/*.go */*/*/*.go
GOBIN=`pwd` go install ./builtin/...
go mod tidy
go build main.go
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-gcppubsub/gcppubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"cloud.google.com/go/pubsub"
dkplugin "github.com/distribworks/dkron/v4/plugin"
dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
)

// GCPPubSub plugin publish message to topic when Execute method is called.
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-gcppubsub/gcppubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"cloud.google.com/go/pubsub"
dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/armon/circbuf"
dkplugin "github.com/distribworks/dkron/v4/plugin"
dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
"github.com/fullstorydev/grpcurl"
"github.com/jhump/protoreflect/grpcreflect"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-grpc/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/distribworks/dkron/v4/builtin/bins/dkron-executor-grpc/test"
dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/armon/circbuf"

dkplugin "github.com/distribworks/dkron/v4/plugin"
dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-kafka/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
)

func TestProduceExecuteWithKey(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-nats/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/nats-io/nats.go"

dkplugin "github.com/distribworks/dkron/v4/plugin"
dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-nats/nats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
)

func TestPublishExecute(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-rabbitmq/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"

dkplugin "github.com/distribworks/dkron/v4/plugin"
dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
"github.com/streadway/amqp"
)

Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-executor-rabbitmq/rabbitmq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

dktypes "github.com/distribworks/dkron/v4/plugin/types"
dktypes "github.com/distribworks/dkron/v4/types"
)

func TestPublishExecute(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-processor-files/files_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"

"github.com/distribworks/dkron/v4/plugin"
"github.com/distribworks/dkron/v4/plugin/types"
"github.com/distribworks/dkron/v4/types"
log "github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-processor-files/files_output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/distribworks/dkron/v4/plugin"
"github.com/distribworks/dkron/v4/plugin/types"
"github.com/distribworks/dkron/v4/types"
"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-processor-fluent/fluent_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"

"github.com/distribworks/dkron/v4/plugin"
"github.com/distribworks/dkron/v4/plugin/types"
"github.com/distribworks/dkron/v4/types"
log "github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-processor-log/log_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/distribworks/dkron/v4/plugin"
"github.com/distribworks/dkron/v4/plugin/types"
"github.com/distribworks/dkron/v4/types"
log "github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-processor-log/log_output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/distribworks/dkron/v4/plugin"
"github.com/distribworks/dkron/v4/plugin/types"
"github.com/distribworks/dkron/v4/types"
"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-processor-syslog/syslog_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"

"github.com/distribworks/dkron/v4/plugin"
"github.com/distribworks/dkron/v4/plugin/types"
"github.com/distribworks/dkron/v4/types"
gsyslog "github.com/hashicorp/go-syslog"
log "github.com/sirupsen/logrus"
)
Expand Down
2 changes: 1 addition & 1 deletion builtin/bins/dkron-processor-syslog/syslog_output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/distribworks/dkron/v4/plugin"
"github.com/distribworks/dkron/v4/plugin/types"
"github.com/distribworks/dkron/v4/types"
"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion dkron/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
metrics "github.com/armon/go-metrics"
"github.com/devopsfaith/krakend-usage/client"
"github.com/distribworks/dkron/v4/plugin"
proto "github.com/distribworks/dkron/v4/plugin/types"
proto "github.com/distribworks/dkron/v4/types"
"github.com/hashicorp/go-uuid"
"github.com/hashicorp/memberlist"
"github.com/hashicorp/raft"
Expand Down
2 changes: 1 addition & 1 deletion dkron/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
"time"

proto "github.com/distribworks/dkron/v4/plugin/types"
proto "github.com/distribworks/dkron/v4/types"
"google.golang.org/protobuf/types/known/timestamppb"
)

Expand Down
2 changes: 1 addition & 1 deletion dkron/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dkron
import (
"io"

dkronpb "github.com/distribworks/dkron/v4/plugin/types"
dkronpb "github.com/distribworks/dkron/v4/types"
"github.com/hashicorp/raft"
"github.com/sirupsen/logrus"
"google.golang.org/protobuf/proto"
Expand Down
2 changes: 1 addition & 1 deletion dkron/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

metrics "github.com/armon/go-metrics"
"github.com/distribworks/dkron/v4/plugin"
proto "github.com/distribworks/dkron/v4/plugin/types"
proto "github.com/distribworks/dkron/v4/types"
"github.com/golang/protobuf/ptypes/empty"
"github.com/hashicorp/raft"
"github.com/hashicorp/serf/serf"
Expand Down
2 changes: 1 addition & 1 deletion dkron/grpc_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/armon/circbuf"
metrics "github.com/armon/go-metrics"
"github.com/distribworks/dkron/v4/plugin/types"
"github.com/distribworks/dkron/v4/types"
"github.com/sirupsen/logrus"
"google.golang.org/protobuf/types/known/timestamppb"
)
Expand Down
2 changes: 1 addition & 1 deletion dkron/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

metrics "github.com/armon/go-metrics"
proto "github.com/distribworks/dkron/v4/plugin/types"
proto "github.com/distribworks/dkron/v4/types"
"github.com/golang/protobuf/ptypes/empty"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion dkron/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/distribworks/dkron/v4/extcron"
"github.com/distribworks/dkron/v4/ntime"
"github.com/distribworks/dkron/v4/plugin"
proto "github.com/distribworks/dkron/v4/plugin/types"
proto "github.com/distribworks/dkron/v4/types"
"github.com/sirupsen/logrus"
"github.com/tidwall/buntdb"
"google.golang.org/protobuf/types/known/timestamppb"
Expand Down
2 changes: 1 addition & 1 deletion dkron/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/distribworks/dkron/v4/ntime"
"github.com/distribworks/dkron/v4/plugin"
proto "github.com/distribworks/dkron/v4/plugin/types"
proto "github.com/distribworks/dkron/v4/types"
"github.com/hashicorp/serf/testutil"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion dkron/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sync"
"time"

dkronpb "github.com/distribworks/dkron/v4/plugin/types"
dkronpb "github.com/distribworks/dkron/v4/types"
"github.com/sirupsen/logrus"
"github.com/tidwall/buntdb"
"google.golang.org/protobuf/proto"
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/armon/go-metrics v0.4.1
github.com/aws/aws-sdk-go v1.42.18 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/deepmap/oapi-codegen v1.16.2 // indirect
github.com/devopsfaith/krakend-usage v1.4.0
github.com/fluent/fluent-logger-golang v1.9.0
github.com/fullstorydev/grpcurl v1.8.9
Expand All @@ -34,6 +35,7 @@ require (
github.com/mattn/go-shellwords v1.0.12
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/nats-io/nats.go v1.32.0
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.18.0
github.com/robfig/cron/v3 v3.0.1
Expand Down
Loading
Loading