Skip to content

Commit

Permalink
fix go linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: NikitaSkrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik committed Feb 5, 2024
1 parent 1d87e98 commit 180c534
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 25 deletions.
7 changes: 4 additions & 3 deletions pkg/networkservice/mechanisms/memif/memifrxmode/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022-2023 Cisco and/or its affiliates.
// Copyright (c) 2022-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -22,6 +22,7 @@ import (
"context"

"github.com/pkg/errors"
"go.fd.io/govpp/api"
"google.golang.org/grpc"

"github.com/golang/protobuf/ptypes/empty"
Expand All @@ -38,11 +39,11 @@ import (

type memifrxmodeClient struct {
chainCtx context.Context
vppConn Connection
vppConn api.Connection
}

// NewClient provides a NetworkServiceClient chain elements that support the memif Mechanism
func NewClient(chainCtx context.Context, vppConn Connection) networkservice.NetworkServiceClient {
func NewClient(chainCtx context.Context, vppConn api.Connection) networkservice.NetworkServiceClient {
return &memifrxmodeClient{
chainCtx: chainCtx,
vppConn: vppConn,
Expand Down
2 changes: 1 addition & 1 deletion pkg/networkservice/mechanisms/memif/memifrxmode/common.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022-2023 Cisco and/or its affiliates.
// Copyright (c) 2022-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
2 changes: 2 additions & 0 deletions pkg/networkservice/mechanisms/memif/memifrxmode/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//
// Copyright (c) 2021-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
7 changes: 4 additions & 3 deletions pkg/networkservice/mechanisms/memif/memifrxmode/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022-2023 Cisco and/or its affiliates.
// Copyright (c) 2022-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -22,6 +22,7 @@ import (
"context"

"github.com/pkg/errors"
"go.fd.io/govpp/api"

"github.com/golang/protobuf/ptypes/empty"

Expand All @@ -37,11 +38,11 @@ import (

type memifrxmodeServer struct {
chainCtx context.Context
vppConn Connection
vppConn api.Connection
}

// NewServer - create a new memifProxy server chain element
func NewServer(chainCtx context.Context, vppConn Connection) networkservice.NetworkServiceServer {
func NewServer(chainCtx context.Context, vppConn api.Connection) networkservice.NetworkServiceServer {
return &memifrxmodeServer{
chainCtx: chainCtx,
vppConn: vppConn,
Expand Down
7 changes: 4 additions & 3 deletions pkg/networkservice/up/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2022 Cisco and/or its affiliates.
// Copyright (c) 2020-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -24,6 +24,7 @@ import (

"github.com/golang/protobuf/ptypes/empty"
"github.com/pkg/errors"
"go.fd.io/govpp/api"
"google.golang.org/grpc"

"github.com/networkservicemesh/api/pkg/api/networkservice"
Expand All @@ -39,15 +40,15 @@ import (

type upClient struct {
ctx context.Context
vppConn Connection
vppConn api.Connection
loadIfIndex ifIndexFunc

inited uint32
initMutex sync.Mutex
}

// NewClient provides a NetworkServiceClient chain elements that 'up's the swIfIndex
func NewClient(ctx context.Context, vppConn Connection, opts ...Option) networkservice.NetworkServiceClient {
func NewClient(ctx context.Context, vppConn api.Connection, opts ...Option) networkservice.NetworkServiceClient {
o := &options{
loadIfIndex: ifindex.Load,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/networkservice/up/common.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2020-2021 Cisco and/or its affiliates.
//
// Copyright (c) 2023 Cisco and/or its affiliates.
// Copyright (c) 2023-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
7 changes: 4 additions & 3 deletions pkg/networkservice/up/ipsecup/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022 Cisco and/or its affiliates.
// Copyright (c) 2022-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -21,6 +21,7 @@ import (
"context"

"github.com/pkg/errors"
"go.fd.io/govpp/api"
"google.golang.org/grpc"

"github.com/golang/protobuf/ptypes/empty"
Expand All @@ -34,11 +35,11 @@ import (

type ipsecUpClient struct {
ctx context.Context
vppConn Connection
vppConn api.Connection
}

// NewClient provides a NetworkServiceClient chain element that waits the 'up' of the IPSec interface
func NewClient(ctx context.Context, vppConn Connection) networkservice.NetworkServiceClient {
func NewClient(ctx context.Context, vppConn api.Connection) networkservice.NetworkServiceClient {
return &ipsecUpClient{
ctx: ctx,
vppConn: vppConn,
Expand Down
10 changes: 2 additions & 8 deletions pkg/networkservice/up/ipsecup/common.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022-2023 Cisco and/or its affiliates.
// Copyright (c) 2022-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -30,13 +30,7 @@ import (
"github.com/networkservicemesh/sdk-vpp/pkg/tools/ifindex"
)

// Connection - simply combines tha api.Connection and api.ChannelProvider interfaces
type Connection interface {
api.Connection
api.ChannelProvider
}

func waitForUpLinkUp(ctx context.Context, vppConn Connection, isClient bool) error {
func waitForUpLinkUp(ctx context.Context, vppConn api.Connection, isClient bool) error {
swIfIndex, ok := ifindex.Load(ctx, isClient)
if !ok {
return nil
Expand Down
7 changes: 4 additions & 3 deletions pkg/networkservice/up/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2022 Cisco and/or its affiliates.
// Copyright (c) 2020-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -23,6 +23,7 @@ import (

"github.com/golang/protobuf/ptypes/empty"
"github.com/pkg/errors"
"go.fd.io/govpp/api"

"github.com/networkservicemesh/api/pkg/api/networkservice"

Expand All @@ -34,15 +35,15 @@ import (

type upServer struct {
ctx context.Context
vppConn Connection
vppConn api.Connection
loadIfIndex ifIndexFunc

inited uint32
initMutex sync.Mutex
}

// NewServer provides a NetworkServiceServer chain elements that 'up's the swIfIndex
func NewServer(ctx context.Context, vppConn Connection, opts ...Option) networkservice.NetworkServiceServer {
func NewServer(ctx context.Context, vppConn api.Connection, opts ...Option) networkservice.NetworkServiceServer {
o := &options{
loadIfIndex: ifindex.Load,
}
Expand Down

0 comments on commit 180c534

Please sign in to comment.