Skip to content

Commit 8d0660d

Browse files
committed
change to vanity package
1 parent 2171d78 commit 8d0660d

22 files changed

+37
-37
lines changed

.github/workflows/tests.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
GOTEST_GITHUB_ACTIONS: 1
4141
defaults:
4242
run:
43-
working-directory: ${{ env.GOPATH }}/src/github.com/rotationalio/vanity
43+
working-directory: ${{ env.GOPATH }}/src/go.rtnl.ai/vanity
4444
steps:
4545
- name: Set up Go
4646
uses: actions/setup-go@v5
@@ -58,7 +58,7 @@ jobs:
5858
- name: Checkout Code
5959
uses: actions/checkout@v4
6060
with:
61-
path: ${{ env.GOPATH }}/src/github.com/rotationalio/vanity
61+
path: ${{ env.GOPATH }}/src/go.rtnl.ai/vanity
6262

6363
- name: Code Generation
6464
run: go generate ./...
@@ -74,7 +74,7 @@ jobs:
7474
GOBIN: ${{ github.workspace }}/go/bin
7575
defaults:
7676
run:
77-
working-directory: ${{ env.GOPATH }}/src/github.com/rotationalio/vanity
77+
working-directory: ${{ env.GOPATH }}/src/go.rtnl.ai/vanity
7878
steps:
7979
- name: Set up Go
8080
uses: actions/setup-go@v5
@@ -92,7 +92,7 @@ jobs:
9292
- name: Checkout Code
9393
uses: actions/checkout@v4
9494
with:
95-
path: ${{ env.GOPATH }}/src/github.com/rotationalio/vanity
95+
path: ${{ env.GOPATH }}/src/go.rtnl.ai/vanity
9696

9797
- name: Code Generation
9898
run: go generate ./...

.goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ builds:
88
binary: vanityd
99
flags:
1010
- -v
11-
ldflags: -s -w -X github.com/rotationalio/vanity.GitVersion={{.Commit}} -X github.com/rotationalio/vanity.BuildDate={{.Date}}
11+
ldflags: -s -w -X go.rtnl.ai/vanity.GitVersion={{.Commit}} -X go.rtnl.ai/vanity.BuildDate={{.Date}}
1212
env:
1313
- CGO_ENABLED=0
1414
goos:

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ARG TARGETARCH
1616
RUN update-ca-certificates
1717

1818
# Use modules for dependencies
19-
WORKDIR $GOPATH/src/github.com/rotationalio/vanity
19+
WORKDIR $GOPATH/src/go.rtnl.ai/vanity
2020

2121
COPY go.mod .
2222
COPY go.sum .
@@ -31,7 +31,7 @@ COPY . .
3131

3232
# Build binary
3333
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
34-
-ldflags="-X 'github.com/rotationalio/vanity.GitVersion=${GIT_REVISION}'" \
34+
-ldflags="-X 'go.rtnl.ai/vanity.GitVersion=${GIT_REVISION}'" \
3535
-o /go/bin/vanityd \
3636
./cmd/vanityd
3737

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Golang Vanity URLs for Import Paths
22

3-
This package implements a server that can respond to the golang import paths protocol and redirect `go tool` to the correct repository path so that we can host our go packages at `go.rotational.io` instead of `github.com/rotationalio`.
3+
This package implements a server that can respond to the golang import paths protocol and redirect `go tool` to the correct repository path so that we can host our go packages at `go.rtnl.ai` instead of `github.com/rotationalio`.
44

55
This server implements some Rotational specific tools. If you're interested in hosting your own vanity URLs for Go packages, I suggest reading [Making a Golang Vanity URL](https://medium.com/@JonNRb/making-a-golang-vanity-url-f56d8eec5f6c) by Jon Betti and using his [go.jonrb.io/vanity](https://pkg.go.dev/go.jonnrb.io/vanity) server as a starting place.

cmd/vanityd/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"os"
66
"text/tabwriter"
77

8-
pkg "github.com/rotationalio/vanity"
9-
"github.com/rotationalio/vanity/config"
10-
"github.com/rotationalio/vanity/server"
8+
pkg "go.rtnl.ai/vanity"
9+
"go.rtnl.ai/vanity/config"
10+
"go.rtnl.ai/vanity/server"
1111

1212
"github.com/joho/godotenv"
1313
confire "github.com/rotationalio/confire/usage"

config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"time"
55

66
"github.com/rotationalio/confire"
7-
"github.com/rotationalio/vanity/logger"
87
"github.com/rs/zerolog"
8+
"go.rtnl.ai/vanity/logger"
99
)
1010

1111
// All environment variables will have this prefix unless otherwise defined in struct

config/config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"os"
55
"testing"
66

7-
"github.com/rotationalio/vanity/config"
87
"github.com/rs/zerolog"
98
"github.com/stretchr/testify/require"
9+
"go.rtnl.ai/vanity/config"
1010
)
1111

1212
var testEnv = map[string]string{

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/rotationalio/vanity
1+
module go.rtnl.ai/vanity
22

33
go 1.23.3
44

logger/level_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"testing"
77

8-
"github.com/rotationalio/vanity/logger"
8+
"go.rtnl.ai/vanity/logger"
99

1010
"github.com/rs/zerolog"
1111
"github.com/stretchr/testify/require"

logger/logger_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"testing"
77
"time"
88

9-
"github.com/rotationalio/vanity/logger"
9+
"go.rtnl.ai/vanity/logger"
1010

1111
"github.com/rs/zerolog"
1212
"github.com/rs/zerolog/log"

logger/middleware.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"time"
66

77
"github.com/julienschmidt/httprouter"
8-
"github.com/rotationalio/vanity/server/middleware"
98
"github.com/rs/zerolog/log"
9+
"go.rtnl.ai/vanity/server/middleware"
1010
)
1111

1212
func HTTPLogger(server, version string) middleware.Middleware {

server/maintenance.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"time"
66

77
"github.com/julienschmidt/httprouter"
8-
"github.com/rotationalio/vanity"
9-
"github.com/rotationalio/vanity/server/middleware"
10-
"github.com/rotationalio/vanity/server/render"
8+
"go.rtnl.ai/vanity"
9+
"go.rtnl.ai/vanity/server/middleware"
10+
"go.rtnl.ai/vanity/server/render"
1111
)
1212

1313
// If the server is in maintenance mode, aborts the current request and renders the

server/middleware/middleware_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"testing"
88

99
"github.com/julienschmidt/httprouter"
10-
. "github.com/rotationalio/vanity/server/middleware"
1110
"github.com/stretchr/testify/require"
11+
. "go.rtnl.ai/vanity/server/middleware"
1212
)
1313

1414
func MakeTestMiddleware(name string, abort bool, calls *Calls) Middleware {

server/render/render_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"net/http/httptest"
88
"testing"
99

10-
"github.com/rotationalio/vanity/server/render"
1110
"github.com/stretchr/testify/require"
11+
"go.rtnl.ai/vanity/server/render"
1212
)
1313

1414
func TestText(t *testing.T) {

server/routes.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"net/http"
66

77
"github.com/julienschmidt/httprouter"
8-
"github.com/rotationalio/vanity"
9-
"github.com/rotationalio/vanity/logger"
10-
"github.com/rotationalio/vanity/server/middleware"
8+
"go.rtnl.ai/vanity"
9+
"go.rtnl.ai/vanity/logger"
10+
"go.rtnl.ai/vanity/server/middleware"
1111
)
1212

1313
// Sets up the server's middleware and routes.

server/server.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
"time"
1313

1414
"github.com/julienschmidt/httprouter"
15-
"github.com/rotationalio/vanity"
16-
"github.com/rotationalio/vanity/config"
17-
"github.com/rotationalio/vanity/logger"
1815
"github.com/rs/zerolog"
1916
"github.com/rs/zerolog/log"
17+
"go.rtnl.ai/vanity"
18+
"go.rtnl.ai/vanity/config"
19+
"go.rtnl.ai/vanity/logger"
2020
)
2121

2222
func init() {

server/status.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"time"
66

77
"github.com/julienschmidt/httprouter"
8-
"github.com/rotationalio/vanity"
9-
"github.com/rotationalio/vanity/server/render"
8+
"go.rtnl.ai/vanity"
9+
"go.rtnl.ai/vanity/server/render"
1010
)
1111

1212
const (

server/vanity.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"net/http"
77

88
"github.com/julienschmidt/httprouter"
9-
"github.com/rotationalio/vanity"
9+
"go.rtnl.ai/vanity"
1010
)
1111

1212
func Vanity(pkg *vanity.GoPackage) httprouter.Handle {

server/web.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"net/http"
88

99
"github.com/julienschmidt/httprouter"
10-
"github.com/rotationalio/vanity"
10+
"go.rtnl.ai/vanity"
1111
)
1212

1313
//go:embed all:templates

vanity.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"path/filepath"
99
"strings"
1010

11-
"github.com/rotationalio/vanity/config"
11+
"go.rtnl.ai/vanity/config"
1212
"gopkg.in/yaml.v3"
1313
)
1414

vanity_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"net/url"
66
"testing"
77

8-
. "github.com/rotationalio/vanity"
9-
"github.com/rotationalio/vanity/config"
108
"github.com/stretchr/testify/require"
9+
. "go.rtnl.ai/vanity"
10+
"go.rtnl.ai/vanity/config"
1111
)
1212

1313
type expected struct {

version.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ const (
1111
VersionReleaseNumber = 1
1212
)
1313

14-
// Set the GitVersion via -ldflags="-X 'github.com/rotationalio/vanity.GitVersion=$(git rev-parse --short HEAD)'"
14+
// Set the GitVersion via -ldflags="-X 'go.rtnl.ai/vanity.GitVersion=$(git rev-parse --short HEAD)'"
1515
var GitVersion string
1616

17-
// Set the BuildDate via -ldflags="-X github.com/rotationalio/vanity.BuildDate=YYYY-MM-DD"
17+
// Set the BuildDate via -ldflags="-X go.rtnl.ai/vanity.BuildDate=YYYY-MM-DD"
1818
var BuildDate string
1919

2020
// Version returns the semantic version for the current build.

0 commit comments

Comments
 (0)