Skip to content

Commit

Permalink
feat(go)!: use wrpc.io module URL
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <[email protected]>
  • Loading branch information
rvolosatovs committed Aug 23, 2024
1 parent a729dab commit e0e6216
Show file tree
Hide file tree
Showing 37 changed files with 91 additions and 93 deletions.
6 changes: 2 additions & 4 deletions crates/wit-bindgen-go/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ impl Deps {
}

fn wrpc(&mut self) -> &'static str {
self.map.insert(
"wrpc".to_string(),
"github.com/bytecodealliance/wrpc/go".to_string(),
);
self.map
.insert("wrpc".to_string(), "wrpc.io/go".to_string());
"wrpc"
}

Expand Down
4 changes: 2 additions & 2 deletions crates/wit-bindgen-go/tests/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ use .",
go 1.22.2
require github.com/bytecodealliance/wrpc/go v0.0.0-unpublished
require wrpc.io/go v0.0.0-unpublished
replace github.com/bytecodealliance/wrpc/go v0.0.0-unpublished => {}",
replace wrpc.io/go v0.0.0-unpublished => {}",
root.join("go").display(),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
binary "encoding/binary"
errors "errors"
fmt "fmt"
wrpc "github.com/bytecodealliance/wrpc/go"
io "io"
slog "log/slog"
math "math"
utf8 "unicode/utf8"
wrpc "wrpc.io/go"
)

type Foo interface{}
Expand Down
4 changes: 2 additions & 2 deletions examples/go/complex-server/bindings/server.wrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package server

import (
exports__wrpc_examples__complex__resources "github.com/bytecodealliance/wrpc/examples/go/complex-server/bindings/exports/wrpc_examples/complex/resources"
wrpc "github.com/bytecodealliance/wrpc/go"
exports__wrpc_examples__complex__resources "wrpc.io/examples/go/complex-server/bindings/exports/wrpc_examples/complex/resources"
wrpc "wrpc.io/go"
)

func Serve(s wrpc.Server, h0 exports__wrpc_examples__complex__resources.Handler) (stop func() error, err error) {
Expand Down
8 changes: 4 additions & 4 deletions examples/go/complex-server/cmd/complex-server-nats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"sync"
"syscall"

server "github.com/bytecodealliance/wrpc/examples/go/complex-server/bindings"
"github.com/bytecodealliance/wrpc/examples/go/complex-server/bindings/exports/wrpc_examples/complex/resources"
wrpc "github.com/bytecodealliance/wrpc/go"
wrpcnats "github.com/bytecodealliance/wrpc/go/nats"
server "wrpc.io/examples/go/complex-server/bindings"
"wrpc.io/examples/go/complex-server/bindings/exports/wrpc_examples/complex/resources"
wrpc "wrpc.io/go"
wrpcnats "wrpc.io/go/nats"
"github.com/google/uuid"
"github.com/nats-io/nats.go"
)
Expand Down
2 changes: 1 addition & 1 deletion examples/go/complex-server/complex_server.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package github.com/bytecodealliance/wrpc/examples/go/complex-server/bindings wit
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package wrpc.io/examples/go/complex-server/bindings wit

package complex_server
6 changes: 3 additions & 3 deletions examples/go/complex-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/bytecodealliance/wrpc/examples/go/complex-server
module wrpc.io/examples/go/complex-server

go 1.22.2

require (
github.com/bytecodealliance/wrpc/go v0.0.1
github.com/google/uuid v1.6.0
github.com/nats-io/nats.go v1.37.0
wrpc.io/go v0.0.2
)

require (
Expand All @@ -16,4 +16,4 @@ require (
golang.org/x/sys v0.20.0 // indirect
)

replace github.com/bytecodealliance/wrpc/go v0.0.1 => ../../../go
replace wrpc.io/go v0.0.2 => ../../../go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
context "context"
errors "errors"
fmt "fmt"
wrpc "github.com/bytecodealliance/wrpc/go"
io "io"
slog "log/slog"
utf8 "unicode/utf8"
wrpc "wrpc.io/go"
)

func Hello(ctx__ context.Context, wrpc__ wrpc.Invoker) (r0__ string, err__ error) {
Expand Down
4 changes: 2 additions & 2 deletions examples/go/hello-client/cmd/hello-client-nats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"log/slog"
"os"

"github.com/bytecodealliance/wrpc/examples/go/hello-client/bindings/wrpc_examples/hello/handler"
wrpcnats "github.com/bytecodealliance/wrpc/go/nats"
"wrpc.io/examples/go/hello-client/bindings/wrpc_examples/hello/handler"
wrpcnats "wrpc.io/go/nats"
"github.com/nats-io/nats.go"
)

Expand Down
6 changes: 3 additions & 3 deletions examples/go/hello-client/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/bytecodealliance/wrpc/examples/go/hello-client
module wrpc.io/examples/go/hello-client

go 1.22.2

require (
github.com/bytecodealliance/wrpc/go v0.0.1
github.com/nats-io/nats.go v1.37.0
wrpc.io/go v0.0.2
)

require (
Expand All @@ -15,4 +15,4 @@ require (
golang.org/x/sys v0.20.0 // indirect
)

replace github.com/bytecodealliance/wrpc/go v0.0.1 => ../../../go
replace wrpc.io/go v0.0.2 => ../../../go
2 changes: 1 addition & 1 deletion examples/go/hello-client/hello_client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package github.com/bytecodealliance/wrpc/examples/go/hello-client/bindings wit
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package wrpc.io/examples/go/hello-client/bindings wit

package hello_client
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
context "context"
binary "encoding/binary"
fmt "fmt"
wrpc "github.com/bytecodealliance/wrpc/go"
io "io"
slog "log/slog"
math "math"
wrpc "wrpc.io/go"
)

type Handler interface {
Expand Down
4 changes: 2 additions & 2 deletions examples/go/hello-server/bindings/server.wrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package server

import (
exports__wrpc_examples__hello__handler "github.com/bytecodealliance/wrpc/examples/go/hello-server/bindings/exports/wrpc_examples/hello/handler"
wrpc "github.com/bytecodealliance/wrpc/go"
exports__wrpc_examples__hello__handler "wrpc.io/examples/go/hello-server/bindings/exports/wrpc_examples/hello/handler"
wrpc "wrpc.io/go"
)

func Serve(s wrpc.Server, h0 exports__wrpc_examples__hello__handler.Handler) (stop func() error, err error) {
Expand Down
4 changes: 2 additions & 2 deletions examples/go/hello-server/cmd/hello-server-nats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"os/signal"
"syscall"

server "github.com/bytecodealliance/wrpc/examples/go/hello-server/bindings"
wrpcnats "github.com/bytecodealliance/wrpc/go/nats"
server "wrpc.io/examples/go/hello-server/bindings"
wrpcnats "wrpc.io/go/nats"
"github.com/nats-io/nats.go"
)

Expand Down
6 changes: 3 additions & 3 deletions examples/go/hello-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/bytecodealliance/wrpc/examples/go/hello-server
module wrpc.io/examples/go/hello-server

go 1.22.2

require (
github.com/bytecodealliance/wrpc/go v0.0.1
github.com/nats-io/nats.go v1.37.0
wrpc.io/go v0.0.2
)

require (
Expand All @@ -15,4 +15,4 @@ require (
golang.org/x/sys v0.20.0 // indirect
)

replace github.com/bytecodealliance/wrpc/go v0.0.1 => ../../../go
replace wrpc.io/go v0.0.2 => ../../../go
2 changes: 1 addition & 1 deletion examples/go/hello-server/hello_server.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package github.com/bytecodealliance/wrpc/examples/go/hello-server/bindings wit
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package wrpc.io/examples/go/hello-server/bindings wit

package hello_server
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
binary "encoding/binary"
errors "errors"
fmt "fmt"
wrpc "github.com/bytecodealliance/wrpc/go"
io "io"
slog "log/slog"
math "math"
sync "sync"
atomic "sync/atomic"
wrpc "wrpc.io/go"
)

type Req struct {
Expand Down
4 changes: 2 additions & 2 deletions examples/go/streams-client/cmd/streams-client-nats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"sync"
"time"

"github.com/bytecodealliance/wrpc/examples/go/streams-client/bindings/wrpc_examples/streams/handler"
wrpcnats "github.com/bytecodealliance/wrpc/go/nats"
"wrpc.io/examples/go/streams-client/bindings/wrpc_examples/streams/handler"
wrpcnats "wrpc.io/go/nats"
"github.com/nats-io/nats.go"
)

Expand Down
6 changes: 3 additions & 3 deletions examples/go/streams-client/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/bytecodealliance/wrpc/examples/go/streams-client
module wrpc.io/examples/go/streams-client

go 1.22.2

require (
github.com/bytecodealliance/wrpc/go v0.0.1
github.com/nats-io/nats.go v1.37.0
wrpc.io/go v0.0.2
)

require (
Expand All @@ -15,4 +15,4 @@ require (
golang.org/x/sys v0.20.0 // indirect
)

replace github.com/bytecodealliance/wrpc/go v0.0.1 => ../../../go
replace wrpc.io/go v0.0.2 => ../../../go
2 changes: 1 addition & 1 deletion examples/go/streams-client/streams_client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package github.com/bytecodealliance/wrpc/examples/go/streams-client/bindings wit
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package wrpc.io/examples/go/streams-client/bindings wit

package streams_client
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
binary "encoding/binary"
errors "errors"
fmt "fmt"
wrpc "github.com/bytecodealliance/wrpc/go"
io "io"
slog "log/slog"
math "math"
sync "sync"
atomic "sync/atomic"
wrpc "wrpc.io/go"
)

type Req struct {
Expand Down
4 changes: 2 additions & 2 deletions examples/go/streams-server/bindings/server.wrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package server

import (
exports__wrpc_examples__streams__handler "github.com/bytecodealliance/wrpc/examples/go/streams-server/bindings/exports/wrpc_examples/streams/handler"
wrpc "github.com/bytecodealliance/wrpc/go"
exports__wrpc_examples__streams__handler "wrpc.io/examples/go/streams-server/bindings/exports/wrpc_examples/streams/handler"
wrpc "wrpc.io/go"
)

func Serve(s wrpc.Server, h0 exports__wrpc_examples__streams__handler.Handler) (stop func() error, err error) {
Expand Down
8 changes: 4 additions & 4 deletions examples/go/streams-server/cmd/streams-server-nats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"os/signal"
"syscall"

server "github.com/bytecodealliance/wrpc/examples/go/streams-server/bindings"
"github.com/bytecodealliance/wrpc/examples/go/streams-server/bindings/exports/wrpc_examples/streams/handler"
wrpc "github.com/bytecodealliance/wrpc/go"
wrpcnats "github.com/bytecodealliance/wrpc/go/nats"
server "wrpc.io/examples/go/streams-server/bindings"
"wrpc.io/examples/go/streams-server/bindings/exports/wrpc_examples/streams/handler"
wrpc "wrpc.io/go"
wrpcnats "wrpc.io/go/nats"
"github.com/nats-io/nats.go"
)

Expand Down
6 changes: 3 additions & 3 deletions examples/go/streams-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/bytecodealliance/wrpc/examples/go/streams-server
module wrpc.io/examples/go/streams-server

go 1.22.2

require (
github.com/bytecodealliance/wrpc/go v0.0.1
github.com/nats-io/nats.go v1.37.0
wrpc.io/go v0.0.2
)

require (
Expand All @@ -15,4 +15,4 @@ require (
golang.org/x/sys v0.20.0 // indirect
)

replace github.com/bytecodealliance/wrpc/go v0.0.1 => ../../../go
replace wrpc.io/go v0.0.2 => ../../../go
2 changes: 1 addition & 1 deletion examples/go/streams-server/streams_server.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package github.com/bytecodealliance/wrpc/examples/go/streams-server/bindings wit
//go:generate cargo run --bin wit-bindgen-wrpc go --out-dir bindings --package wrpc.io/examples/go/streams-server/bindings wit

package streams_server
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ use (
./tests/go
)

replace github.com/bytecodealliance/wrpc/go v0.0.1 => ./go
replace wrpc.io/go v0.0.2 => ./go
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/bytecodealliance/wrpc/go
module wrpc.io/go

go 1.22.2

Expand Down
2 changes: 1 addition & 1 deletion go/nats/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"
"sync/atomic"

wrpc "github.com/bytecodealliance/wrpc/go"
wrpc "wrpc.io/go"
"github.com/nats-io/nats.go"
)

Expand Down
4 changes: 2 additions & 2 deletions tests/go/async.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate $WIT_BINDGEN_WRPC go --world async-server --out-dir bindings/async_server --package github.com/bytecodealliance/wrpc/tests/go/bindings/async_server ../wit
//go:generate $WIT_BINDGEN_WRPC go --world async-server --out-dir bindings/async_server --package wrpc.io/tests/go/bindings/async_server ../wit

package integration

Expand All @@ -7,7 +7,7 @@ import (
"context"
"log/slog"

wrpc "github.com/bytecodealliance/wrpc/go"
wrpc "wrpc.io/go"
)

type AsyncHandler struct{}
Expand Down
12 changes: 6 additions & 6 deletions tests/go/async_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate $WIT_BINDGEN_WRPC go --world async-client --out-dir bindings/async_client --package github.com/bytecodealliance/wrpc/tests/go/bindings/async_client ../wit
//go:generate $WIT_BINDGEN_WRPC go --world async-client --out-dir bindings/async_client --package wrpc.io/tests/go/bindings/async_client ../wit

package integration_test

Expand All @@ -10,11 +10,11 @@ import (
"testing"
"time"

wrpcnats "github.com/bytecodealliance/wrpc/go/nats"
integration "github.com/bytecodealliance/wrpc/tests/go"
"github.com/bytecodealliance/wrpc/tests/go/bindings/async_client/wrpc_test/integration/async"
"github.com/bytecodealliance/wrpc/tests/go/bindings/async_server"
"github.com/bytecodealliance/wrpc/tests/go/internal"
wrpcnats "wrpc.io/go/nats"
integration "wrpc.io/tests/go"
"wrpc.io/tests/go/bindings/async_client/wrpc_test/integration/async"
"wrpc.io/tests/go/bindings/async_server"
"wrpc.io/tests/go/internal"
"github.com/nats-io/nats.go"
)

Expand Down
6 changes: 3 additions & 3 deletions tests/go/cmd/sync-server-nats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"os/signal"
"syscall"

wrpcnats "github.com/bytecodealliance/wrpc/go/nats"
integration "github.com/bytecodealliance/wrpc/tests/go"
"github.com/bytecodealliance/wrpc/tests/go/bindings/sync_server"
wrpcnats "wrpc.io/go/nats"
integration "wrpc.io/tests/go"
"wrpc.io/tests/go/bindings/sync_server"
"github.com/nats-io/nats.go"
)

Expand Down
6 changes: 3 additions & 3 deletions tests/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/bytecodealliance/wrpc/tests/go
module wrpc.io/tests/go

go 1.22.2

require (
github.com/bytecodealliance/wrpc/go v0.0.1
github.com/google/uuid v1.6.0
github.com/nats-io/nats-server/v2 v2.10.14
github.com/nats-io/nats.go v1.37.0
wrpc.io/go v0.0.2
)

require (
Expand All @@ -24,4 +24,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/bytecodealliance/wrpc/go v0.0.1 => ../../go
replace wrpc.io/go v0.0.2 => ../../go
Loading

0 comments on commit e0e6216

Please sign in to comment.