Rename things in vpn package

This commit is contained in:
katexochen 2022-03-29 11:55:47 +02:00 committed by Paul Meyer
parent 66fe34ee32
commit ed45ba2777
3 changed files with 6 additions and 6 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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)