Skip to content

Commit

Permalink
refactor!: add "v1" to module
Browse files Browse the repository at this point in the history
Rename the module to include a v1 suffix. Since the API of the
yggdrasil-0.2 branch is frozen, adding an API suffix shouldn't be
harmful, but would require clients to update their import paths when
updating to newer versions of the yggdrasil-0.2 project.
  • Loading branch information
subpop committed Aug 28, 2024
1 parent d8110a5 commit 16490f7
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 37 deletions.
6 changes: 3 additions & 3 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ github.com/ofabry/go-callvis`) and run:
# Call graph of the main function of yggd, up to calls into the yggdrasil package
go-callvis -nostd -format png -file yggdrasil.main ./cmd/yggd
# Call graph of the yggdrasil package, as invoked by yggd
go-callvis -nostd -format png -file yggdrasil.yggdrasil -focus github.com/redhatinsights/yggdrasil ./cmd/yggd
go-callvis -nostd -format png -file yggdrasil.yggdrasil -focus github.com/redhatinsights/yggdrasil/v1 ./cmd/yggd
# Call graph of the main function of ygg, up to calls into the yggdrasil package
go-callvis -nostd -format png -file ygg.main ./cmd/ygg
# Call graph of the yggdrasil package, as invoked by ygg
go-callvis -nostd -format png -file ygg.yggdrasil -focus github.com/redhatinsights/yggdrasil ./cmd/ygg
go-callvis -nostd -format png -file ygg.yggdrasil -focus github.com/redhatinsights/yggdrasil/v1./cmd/ygg
```

For more detailed, interactive call graphs, install `callgraph` and `digraph`.
Expand All @@ -98,7 +98,7 @@ standard library calls and pipe the result into `digraph`. See the `-help`
output of `digraph` for how to interact with the graph.

```bash
callgraph -algo pta -format digraph ./cmd/ygg | grep github.com/redhatinsights/yggdrasil | sort | uniq | digraph
callgraph -algo pta -format digraph ./cmd/ygg | grep github.com/redhatinsights/yggdrasil/v1 | sort | uniq | digraph
```

# Code Guidelines
Expand Down
34 changes: 17 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ SYSTEMD_SYSTEM_UNIT_DIR := $(shell pkg-config --variable systemdsystemunitdir s

# Build flags
LDFLAGS :=
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.Version=$(VERSION)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.ShortName=$(SHORTNAME)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.LongName=$(LONGNAME)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.BrandName=$(BRANDNAME)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.PrefixDir=$(PREFIX)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.BinDir=$(BINDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.SbinDir=$(SBINDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.LibexecDir=$(LIBEXECDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.SysconfDir=$(SYSCONFDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.DataDir=$(DATADIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.DatarootDir=$(DATAROOTDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.ManDir=$(MANDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.DocDir=$(DOCDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.LocalstateDir=$(LOCALSTATEDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.TopicPrefix=$(TOPICPREFIX)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.DataHost=$(DATAHOST)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil.Provider=$(PROVIDER)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.Version=$(VERSION)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.ShortName=$(SHORTNAME)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.LongName=$(LONGNAME)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.BrandName=$(BRANDNAME)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.PrefixDir=$(PREFIX)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.BinDir=$(BINDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.SbinDir=$(SBINDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.LibexecDir=$(LIBEXECDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.SysconfDir=$(SYSCONFDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.DataDir=$(DATADIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.DatarootDir=$(DATAROOTDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.ManDir=$(MANDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.DocDir=$(DOCDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.LocalstateDir=$(LOCALSTATEDIR)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.TopicPrefix=$(TOPICPREFIX)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.DataHost=$(DATAHOST)'
LDFLAGS += -X 'github.com/redhatinsights/yggdrasil/v1.Provider=$(PROVIDER)'

BUILDFLAGS ?=
ifeq ($(shell find . -name vendor), ./vendor)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![godocs.io](https://godocs.io/github.com/RedHatInsights/yggdrasil?status.svg)](https://godocs.io/github.com/RedHatInsights/yggdrasil)
[![godocs.io](https://godocs.io/github.com/RedHatInsights/yggdrasil/v1?status.svg)](https://godocs.io/github.com/RedHatInsights/yggdrasil/v1)

# yggdrasil

Expand Down
2 changes: 1 addition & 1 deletion cmd/ygg/activate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

systemd "github.com/coreos/go-systemd/v22/dbus"
"github.com/redhatinsights/yggdrasil"
"github.com/redhatinsights/yggdrasil/v1"
)

func activate() error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/ygg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

"github.com/briandowns/spinner"
systemd "github.com/coreos/go-systemd/v22/dbus"
"github.com/redhatinsights/yggdrasil"
internal "github.com/redhatinsights/yggdrasil/internal"
"github.com/redhatinsights/yggdrasil/v1"
internal "github.com/redhatinsights/yggdrasil/v1/internal"
"github.com/urfave/cli/v2"
"golang.org/x/term"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/yggd/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"time"

"git.sr.ht/~spc/go-log"
"github.com/redhatinsights/yggdrasil"
pb "github.com/redhatinsights/yggdrasil/protocol"
"github.com/redhatinsights/yggdrasil/v1"
pb "github.com/redhatinsights/yggdrasil/v1/protocol"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/yggd/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"git.sr.ht/~spc/go-log"
"github.com/redhatinsights/yggdrasil"
"github.com/redhatinsights/yggdrasil/v1"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions cmd/yggd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"git.sr.ht/~spc/go-log"
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/google/uuid"
"github.com/redhatinsights/yggdrasil"
internal "github.com/redhatinsights/yggdrasil/internal"
pb "github.com/redhatinsights/yggdrasil/protocol"
"github.com/redhatinsights/yggdrasil/v1"
internal "github.com/redhatinsights/yggdrasil/v1/internal"
pb "github.com/redhatinsights/yggdrasil/v1/protocol"
"github.com/rjeczalik/notify"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2/altsrc"
Expand Down
2 changes: 1 addition & 1 deletion cmd/yggd/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"git.sr.ht/~spc/go-log"
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/google/uuid"
"github.com/redhatinsights/yggdrasil"
"github.com/redhatinsights/yggdrasil/v1"
)

func handleDataMessage(client mqtt.Client, msg mqtt.Message, sendQ chan<- yggdrasil.Data) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/yggd/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"git.sr.ht/~spc/go-log"
"github.com/pelletier/go-toml"
"github.com/redhatinsights/yggdrasil"
"github.com/redhatinsights/yggdrasil/v1"
"github.com/rjeczalik/notify"
"golang.org/x/net/http/httpproxy"
)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/redhatinsights/yggdrasil
module github.com/redhatinsights/yggdrasil/v1

go 1.19

Expand All @@ -13,6 +13,7 @@ require (
github.com/pelletier/go-toml v1.9.3
github.com/rjeczalik/notify v0.9.2
github.com/urfave/cli/v2 v2.3.0
golang.org/x/net v0.12.0
golang.org/x/term v0.13.0
google.golang.org/grpc v1.58.3
google.golang.org/protobuf v1.31.0
Expand All @@ -28,7 +29,6 @@ require (
github.com/mattn/go-isatty v0.0.8 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
Expand Down
2 changes: 1 addition & 1 deletion protocol/yggdrasil.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/redhatinsights/yggdrasil/protocol";
option go_package = "github.com/redhatinsights/yggdrasil/v1/protocol";

package yggdrasil;

Expand Down
2 changes: 1 addition & 1 deletion worker/echo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"git.sr.ht/~spc/go-log"

pb "github.com/redhatinsights/yggdrasil/protocol"
pb "github.com/redhatinsights/yggdrasil/v1/protocol"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
Expand Down
2 changes: 1 addition & 1 deletion worker/echo/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"git.sr.ht/~spc/go-log"
"github.com/google/uuid"
pb "github.com/redhatinsights/yggdrasil/protocol"
pb "github.com/redhatinsights/yggdrasil/v1/protocol"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
Expand Down

0 comments on commit 16490f7

Please sign in to comment.