From ed45ba2777c6cdde0c26e19a0964c6755c089b15 Mon Sep 17 00:00:00 2001 From: katexochen <49727155+katexochen@users.noreply.github.com> Date: Tue, 29 Mar 2022 11:55:47 +0200 Subject: [PATCH] Rename things in vpn package --- cli/cmd/init.go | 2 +- cli/vpn/{configurer.go => vpn.go} | 8 ++++---- cli/vpn/{configurer_test.go => vpn_test.go} | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename cli/vpn/{configurer.go => vpn.go} (94%) rename cli/vpn/{configurer_test.go => vpn_test.go} (99%) diff --git a/cli/cmd/init.go b/cli/cmd/init.go index 6d22d34f3..e5f5a929d 100644 --- a/cli/cmd/init.go +++ b/cli/cmd/init.go @@ -55,7 +55,7 @@ func runInitialize(cmd *cobra.Command, args []string) error { protoClient := proto.NewClient(*config.Provider.GCP.PCRs) defer protoClient.Close() - vpnClient, err := vpn.NewWithDefaults() + vpnClient, err := vpn.NewConfigurerWithDefaults() if err != nil { return err } diff --git a/cli/vpn/configurer.go b/cli/vpn/vpn.go similarity index 94% rename from cli/vpn/configurer.go rename to cli/vpn/vpn.go index b1d04e5e0..704db21dd 100644 --- a/cli/vpn/configurer.go +++ b/cli/vpn/vpn.go @@ -59,8 +59,8 @@ type Configurer struct { vpn vpn } -// NewWithDefaults creates a new vpn client. -func NewWithDefaults() (*Configurer, error) { +// NewConfigurerWithDefaults creates a new vpn client. +func NewConfigurerWithDefaults() (*Configurer, error) { vpn, err := wgctrl.New() if err != nil { return nil, err @@ -68,9 +68,9 @@ func NewWithDefaults() (*Configurer, error) { return &Configurer{netLink: newNetLink(), vpn: vpn}, nil } -// New creates a new vpn client with the provided +// NewConfigurer creates a new vpn client with the provided // network link and vpn interface. -func New(netLink networkLink, vpn vpn) (*Configurer, error) { +func NewConfigurer(netLink networkLink, vpn vpn) (*Configurer, error) { return &Configurer{netLink: netLink, vpn: vpn}, nil } diff --git a/cli/vpn/configurer_test.go b/cli/vpn/vpn_test.go similarity index 99% rename from cli/vpn/configurer_test.go rename to cli/vpn/vpn_test.go index 55ce5ecb5..f7086ac13 100644 --- a/cli/vpn/configurer_test.go +++ b/cli/vpn/vpn_test.go @@ -75,7 +75,7 @@ func TestConfigurer(t *testing.T) { link := newStubNetworkLink() vpn := newStubVPN() - client, err := New(link, vpn) + client, err := NewConfigurer(link, vpn) require.NoError(err) coordinatorPubKey, err := wgtypes.GenerateKey() require.NoError(err)