Skip to content

Commit

Permalink
rename go module to riverqueue.com/riverui (#126)
Browse files Browse the repository at this point in the history
The new vanity module name will enable a packaged Go module to be
shipped that includes bundled static assets for the UI.
  • Loading branch information
bgentry authored Aug 27, 2024
1 parent a0bc947 commit d65285f
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 30 deletions.
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ linters-settings:
- Standard
- Default
- Prefix(github.com/riverqueue)
- Prefix(riverqueue.com/riverui)

gomoddirectives:
replace-local: true
Expand Down
3 changes: 2 additions & 1 deletion cmd/riverui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (

"github.com/riverqueue/river"
"github.com/riverqueue/river/riverdriver/riverpgxv5"
"github.com/riverqueue/riverui"

"riverqueue.com/riverui"
)

var logger *slog.Logger //nolint:gochecknoglobals
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/riverqueue/riverui
module riverqueue.com/riverui

go 1.22

Expand Down
7 changes: 4 additions & 3 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (
"github.com/riverqueue/river/rivershared/startstop"
"github.com/riverqueue/river/rivershared/util/randutil"
"github.com/riverqueue/river/rivershared/util/valutil"
"github.com/riverqueue/riverui/internal/apiendpoint"
"github.com/riverqueue/riverui/internal/apimiddleware"
"github.com/riverqueue/riverui/internal/dbsqlc"

"riverqueue.com/riverui/internal/apiendpoint"
"riverqueue.com/riverui/internal/apimiddleware"
"riverqueue.com/riverui/internal/dbsqlc"
)

type DBTXWithBegin interface {
Expand Down
11 changes: 6 additions & 5 deletions handler_api_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import (
"github.com/riverqueue/river/rivershared/util/ptrutil"
"github.com/riverqueue/river/rivershared/util/sliceutil"
"github.com/riverqueue/river/rivertype"
"github.com/riverqueue/riverui/internal/apiendpoint"
"github.com/riverqueue/riverui/internal/apierror"
"github.com/riverqueue/riverui/internal/dbsqlc"
"github.com/riverqueue/riverui/internal/querycacher"
"github.com/riverqueue/riverui/internal/util/pgxutil"

"riverqueue.com/riverui/internal/apiendpoint"
"riverqueue.com/riverui/internal/apierror"
"riverqueue.com/riverui/internal/dbsqlc"
"riverqueue.com/riverui/internal/querycacher"
"riverqueue.com/riverui/internal/util/pgxutil"
)

// A bundle of common utilities needed for many API endpoints.
Expand Down
7 changes: 4 additions & 3 deletions handler_api_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
"github.com/riverqueue/river/rivershared/startstop"
"github.com/riverqueue/river/rivershared/util/ptrutil"
"github.com/riverqueue/river/rivertype"
"github.com/riverqueue/riverui/internal/apierror"
"github.com/riverqueue/riverui/internal/riverinternaltest"
"github.com/riverqueue/riverui/internal/riverinternaltest/testfactory"

"riverqueue.com/riverui/internal/apierror"
"riverqueue.com/riverui/internal/riverinternaltest"
"riverqueue.com/riverui/internal/riverinternaltest/testfactory"
)

type setupEndpointTestBundle struct {
Expand Down
5 changes: 3 additions & 2 deletions handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import (
"github.com/stretchr/testify/require"

"github.com/riverqueue/river/rivershared/util/ptrutil"
"github.com/riverqueue/riverui/internal/riverinternaltest"
"github.com/riverqueue/riverui/internal/riverinternaltest/testfactory"

"riverqueue.com/riverui/internal/riverinternaltest"
"riverqueue.com/riverui/internal/riverinternaltest/testfactory"
)

func TestNewHandlerIntegration(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/apiendpoint/api_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/jackc/pgerrcode"
"github.com/jackc/pgx/v5/pgconn"

"github.com/riverqueue/riverui/internal/apierror"
"github.com/riverqueue/riverui/internal/validate"
"riverqueue.com/riverui/internal/apierror"
"riverqueue.com/riverui/internal/validate"
)

// Endpoint is a struct that should be embedded on an API endpoint, and which
Expand Down
4 changes: 2 additions & 2 deletions internal/apiendpoint/api_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/jackc/pgx/v5/pgconn"
"github.com/stretchr/testify/require"

"github.com/riverqueue/riverui/internal/apierror"
"github.com/riverqueue/riverui/internal/riverinternaltest"
"riverqueue.com/riverui/internal/apierror"
"riverqueue.com/riverui/internal/riverinternaltest"
)

func TestMountAndServe(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/apierror/api_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/riverqueue/riverui/internal/riverinternaltest"
"riverqueue.com/riverui/internal/riverinternaltest"
)

func TestAPIError(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions internal/querycacher/query_cacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (

"github.com/riverqueue/river/rivershared/baseservice"
"github.com/riverqueue/river/rivershared/startstop"
"github.com/riverqueue/riverui/internal/dbsqlc"

"riverqueue.com/riverui/internal/dbsqlc"
)

// QueryCacher executes a database query periodically and caches the result. The
Expand Down Expand Up @@ -131,7 +132,7 @@ func (s *QueryCacher[TRes]) Start(ctx context.Context) error {
//
// So this:
//
// QueryCacher[[]*github.com/riverqueue/riverui/internal/dbsqlc.JobCountByStateRow]
// QueryCacher[[]*riverqueue.com/riverui/internal/dbsqlc.JobCountByStateRow]
//
// Becomes this:
//
Expand Down
15 changes: 8 additions & 7 deletions internal/querycacher/query_cacher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
"github.com/riverqueue/river/riverdriver/riverpgxv5"
"github.com/riverqueue/river/rivershared/riversharedtest"
"github.com/riverqueue/river/rivershared/startstoptest"
"github.com/riverqueue/riverui/internal/dbsqlc"
"github.com/riverqueue/riverui/internal/riverinternaltest"
"github.com/riverqueue/riverui/internal/riverinternaltest/testfactory"

"riverqueue.com/riverui/internal/dbsqlc"
"riverqueue.com/riverui/internal/riverinternaltest"
"riverqueue.com/riverui/internal/riverinternaltest/testfactory"
)

func TestQueryCacher(t *testing.T) {
Expand Down Expand Up @@ -118,8 +119,8 @@ func TestSimplifyArchetypeLogName(t *testing.T) {
require.Equal(t, "Simple[[]*int]", simplifyArchetypeLogName("Simple[[]*int]"))

// More realistic examples.
require.Equal(t, "QueryCacher[dbsqlc.JobCountByStateRow]", simplifyArchetypeLogName("QueryCacher[github.com/riverqueue/riverui/internal/dbsqlc.JobCountByStateRow]"))
require.Equal(t, "QueryCacher[*dbsqlc.JobCountByStateRow]", simplifyArchetypeLogName("QueryCacher[*github.com/riverqueue/riverui/internal/dbsqlc.JobCountByStateRow]"))
require.Equal(t, "QueryCacher[[]dbsqlc.JobCountByStateRow]", simplifyArchetypeLogName("QueryCacher[[]github.com/riverqueue/riverui/internal/dbsqlc.JobCountByStateRow]"))
require.Equal(t, "QueryCacher[[]*dbsqlc.JobCountByStateRow]", simplifyArchetypeLogName("QueryCacher[[]*github.com/riverqueue/riverui/internal/dbsqlc.JobCountByStateRow]"))
require.Equal(t, "QueryCacher[dbsqlc.JobCountByStateRow]", simplifyArchetypeLogName("QueryCacher[riverqueue.com/riverui/internal/dbsqlc.JobCountByStateRow]"))
require.Equal(t, "QueryCacher[*dbsqlc.JobCountByStateRow]", simplifyArchetypeLogName("QueryCacher[*riverqueue.com/riverui/internal/dbsqlc.JobCountByStateRow]"))
require.Equal(t, "QueryCacher[[]dbsqlc.JobCountByStateRow]", simplifyArchetypeLogName("QueryCacher[[]riverqueue.com/riverui/internal/dbsqlc.JobCountByStateRow]"))
require.Equal(t, "QueryCacher[[]*dbsqlc.JobCountByStateRow]", simplifyArchetypeLogName("QueryCacher[[]*riverqueue.com/riverui/internal/dbsqlc.JobCountByStateRow]"))
}
2 changes: 1 addition & 1 deletion internal/util/pgxutil/db_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/jackc/pgx/v5"
"github.com/stretchr/testify/require"

"github.com/riverqueue/riverui/internal/riverinternaltest"
"riverqueue.com/riverui/internal/riverinternaltest"
)

func TestWithTx(t *testing.T) {
Expand Down

0 comments on commit d65285f

Please sign in to comment.