Skip to content

Commit

Permalink
refactor: update import paths to use the new repository structure
Browse files Browse the repository at this point in the history
  • Loading branch information
XPH0816 committed Nov 15, 2024
1 parent d56e503 commit b3fe21b
Show file tree
Hide file tree
Showing 31 changed files with 61 additions and 61 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# wgctrl [![Test Status](https://github.com/WireKCP/wkctrl/workflows/Linux%20Test/badge.svg)](https://github.com/WireKCP/wkctrl/actions) [![Go Reference](https://pkg.go.dev/badge/golang.zx2c4.com/wirekcp/wkctrl.svg)](https://pkg.go.dev/golang.zx2c4.com/wirekcp/wkctrl) [![Go Report Card](https://goreportcard.com/badge/github.com/wirekcp/wkctrl)](https://goreportcard.com/report/github.com/wirekcp/wkctrl)
# wgctrl [![Test Status](https://github.com/WireKCP/wgctrl/workflows/Linux%20Test/badge.svg)](https://github.com/WireKCP/wgctrl/actions) [![Go Reference](https://pkg.go.dev/badge/github.com/wirekcp/wgctrl.svg)](https://pkg.go.dev/github.com/wirekcp/wgctrl) [![Go Report Card](https://goreportcard.com/badge/github.com/wirekcp/wgctrl)](https://goreportcard.com/report/github.com/wirekcp/wgctrl)


Package `wgctrl` enables control of WireGuard devices on multiple platforms.
Expand All @@ -22,7 +22,7 @@ As new operating systems add support for in-kernel WireGuard implementations,
this package should also be extended to support those native implementations.

If you are aware of any efforts on this front, please
[file an issue](https://github.com/WireKCP/wkctrl/issues/new).
[file an issue](https://github.com/WireKCP/wgctrl/issues/new).

This package implements WireGuard configuration protocol operations, enabling
the configuration of existing WireGuard devices. Operations such as creating
Expand Down
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"os"

"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/wgtypes"
)

// Expose an identical interface to the underlying packages.
Expand Down
8 changes: 4 additions & 4 deletions client_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/mikioh/ipaddr"
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgtest"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/internal/wgtest"
"github.com/wirekcp/wgctrl/wgtypes"
)

func TestIntegrationClient(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/wgtypes"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions cmd/wgctrl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net"
"strings"

"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl"
"github.com/wirekcp/wgctrl/wgtypes"
)

func main() {
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 golang.zx2c4.com/wireguard/wgctrl
module github.com/wirekcp/wgctrl

go 1.20

Expand Down
8 changes: 4 additions & 4 deletions internal/wgfreebsd/client_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"time"
"unsafe"

"github.com/wirekcp/wgctrl/internal/wgfreebsd/internal/nv"
"github.com/wirekcp/wgctrl/internal/wgfreebsd/internal/wgh"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgfreebsd/internal/nv"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgfreebsd/internal/wgh"
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

// ifGroupWG is the WireGuard interface group name passed to the kernel.
Expand Down
2 changes: 1 addition & 1 deletion internal/wgfreebsd/internal/nv/nvlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"unsafe"

"golang.zx2c4.com/wireguard/wgctrl/internal/wgfreebsd/internal/nv"
"github.com/wirekcp/wgctrl/internal/wgfreebsd/internal/nv"
)

func TestMarshaling(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/wginternal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"io"

"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/wgtypes"
)

// ErrReadOnly indicates that the driver backing a device is read-only. It is
Expand Down
4 changes: 2 additions & 2 deletions internal/wglinux/client_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/mdlayher/genetlink"
"github.com/mdlayher/netlink"
"github.com/mdlayher/netlink/nlenc"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

var _ wginternal.Client = &Client{}
Expand Down
2 changes: 1 addition & 1 deletion internal/wglinux/client_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"github.com/mdlayher/netlink"
"github.com/mdlayher/netlink/nlenc"
"github.com/mdlayher/netlink/nltest"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/wglinux/configure_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/mdlayher/netlink"
"github.com/mdlayher/netlink/nlenc"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

// configAttrs creates the required encoded netlink attributes to configure
Expand Down
4 changes: 2 additions & 2 deletions internal/wglinux/configure_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/mdlayher/netlink"
"github.com/mdlayher/netlink/nlenc"
"github.com/mikioh/ipaddr"
"github.com/wirekcp/wgctrl/internal/wgtest"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgtest"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

func TestLinuxClientConfigureDevice(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/wglinux/parse_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/mdlayher/genetlink"
"github.com/mdlayher/netlink"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

// parseDevice parses a Device from a slice of generic netlink messages,
Expand Down
4 changes: 2 additions & 2 deletions internal/wglinux/parse_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/mdlayher/genetlink/genltest"
"github.com/mdlayher/netlink"
"github.com/mdlayher/netlink/nlenc"
"github.com/wirekcp/wgctrl/internal/wgtest"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgtest"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

func TestLinuxClientDevicesError(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/wgopenbsd/client_openbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"time"
"unsafe"

"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/internal/wgopenbsd/internal/wgh"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgopenbsd/internal/wgh"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

// ifGroupWG is the WireGuard interface group name passed to the kernel.
Expand Down
6 changes: 3 additions & 3 deletions internal/wgopenbsd/client_openbsd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"unsafe"

"github.com/google/go-cmp/cmp"
"github.com/wirekcp/wgctrl/internal/wgopenbsd/internal/wgh"
"github.com/wirekcp/wgctrl/internal/wgtest"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgopenbsd/internal/wgh"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgtest"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

func TestClientDevices(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/wgtest/wgtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"net"

"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/wgtypes"
)

// MustCIDR converts CIDR string s into a net.IPNet or panics.
Expand Down
4 changes: 2 additions & 2 deletions internal/wguser/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"path/filepath"
"strings"

"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/wgtypes"
)

var _ wginternal.Client = &Client{}
Expand Down
2 changes: 1 addition & 1 deletion internal/wguser/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/wgtypes"
)

// A known device name used throughout unit and integration tests.
Expand Down
2 changes: 1 addition & 1 deletion internal/wguser/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"strings"

"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/wgtypes"
)

// configureDevice configures a device specified by its path.
Expand Down
4 changes: 2 additions & 2 deletions internal/wguser/configure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"
"time"

"golang.zx2c4.com/wireguard/wgctrl/internal/wgtest"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/internal/wgtest"
"github.com/wirekcp/wgctrl/wgtypes"
)

// Example string source (with some slight modifications to use all fields):
Expand Down
2 changes: 1 addition & 1 deletion internal/wguser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"time"

"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/wgtypes"
)

// The WireGuard userspace configuration protocol is described here:
Expand Down
2 changes: 1 addition & 1 deletion internal/wguser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/wgtypes"
)

// Example string source (with some slight modifications to use all fields):
Expand Down
6 changes: 3 additions & 3 deletions internal/wgwindows/client_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"golang.org/x/sys/windows"

"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgwindows/internal/ioctl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/internal/wgwindows/internal/ioctl"
"github.com/wirekcp/wgctrl/wgtypes"
)

var _ wginternal.Client = &Client{}
Expand Down
6 changes: 3 additions & 3 deletions os_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
package wgctrl

import (
"golang.zx2c4.com/wireguard/wgctrl/internal/wgfreebsd"
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wguser"
"github.com/wirekcp/wgctrl/internal/wgfreebsd"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/internal/wguser"
)

// newClients configures wginternal.Clients for FreeBSD systems.
Expand Down
6 changes: 3 additions & 3 deletions os_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
package wgctrl

import (
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wglinux"
"golang.zx2c4.com/wireguard/wgctrl/internal/wguser"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/internal/wglinux"
"github.com/wirekcp/wgctrl/internal/wguser"
)

// newClients configures wginternal.Clients for Linux systems.
Expand Down
6 changes: 3 additions & 3 deletions os_openbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
package wgctrl

import (
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgopenbsd"
"golang.zx2c4.com/wireguard/wgctrl/internal/wguser"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/internal/wgopenbsd"
"github.com/wirekcp/wgctrl/internal/wguser"
)

// newClients configures wginternal.Clients for OpenBSD systems.
Expand Down
4 changes: 2 additions & 2 deletions os_userspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
package wgctrl

import (
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wguser"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/internal/wguser"
)

// newClients configures wginternal.Clients for systems which only support
Expand Down
6 changes: 3 additions & 3 deletions os_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
package wgctrl

import (
"golang.zx2c4.com/wireguard/wgctrl/internal/wginternal"
"golang.zx2c4.com/wireguard/wgctrl/internal/wguser"
"golang.zx2c4.com/wireguard/wgctrl/internal/wgwindows"
"github.com/wirekcp/wgctrl/internal/wginternal"
"github.com/wirekcp/wgctrl/internal/wguser"
"github.com/wirekcp/wgctrl/internal/wgwindows"
)

// newClients configures wginternal.Clients for Windows systems.
Expand Down
2 changes: 1 addition & 1 deletion wgtypes/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/wirekcp/wgctrl/wgtypes"
"golang.org/x/crypto/curve25519"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)

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

0 comments on commit b3fe21b

Please sign in to comment.