From 180c5343728b00c8f11677565eebecdf6dae62e4 Mon Sep 17 00:00:00 2001 From: NikitaSkrynnik Date: Mon, 5 Feb 2024 15:39:33 +0700 Subject: [PATCH] fix go linter issues Signed-off-by: NikitaSkrynnik --- .../mechanisms/memif/memifrxmode/client.go | 7 ++++--- .../mechanisms/memif/memifrxmode/common.go | 2 +- .../mechanisms/memif/memifrxmode/metadata.go | 2 ++ .../mechanisms/memif/memifrxmode/server.go | 7 ++++--- pkg/networkservice/up/client.go | 7 ++++--- pkg/networkservice/up/common.go | 2 +- pkg/networkservice/up/ipsecup/client.go | 7 ++++--- pkg/networkservice/up/ipsecup/common.go | 10 ++-------- pkg/networkservice/up/server.go | 7 ++++--- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/pkg/networkservice/mechanisms/memif/memifrxmode/client.go b/pkg/networkservice/mechanisms/memif/memifrxmode/client.go index cdc03b96..67d7e347 100644 --- a/pkg/networkservice/mechanisms/memif/memifrxmode/client.go +++ b/pkg/networkservice/mechanisms/memif/memifrxmode/client.go @@ -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 // @@ -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" @@ -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, diff --git a/pkg/networkservice/mechanisms/memif/memifrxmode/common.go b/pkg/networkservice/mechanisms/memif/memifrxmode/common.go index 7b2e020b..a87dbda2 100644 --- a/pkg/networkservice/mechanisms/memif/memifrxmode/common.go +++ b/pkg/networkservice/mechanisms/memif/memifrxmode/common.go @@ -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 // diff --git a/pkg/networkservice/mechanisms/memif/memifrxmode/metadata.go b/pkg/networkservice/mechanisms/memif/memifrxmode/metadata.go index 9409f9bf..d8cf47c3 100644 --- a/pkg/networkservice/mechanisms/memif/memifrxmode/metadata.go +++ b/pkg/networkservice/mechanisms/memif/memifrxmode/metadata.go @@ -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"); diff --git a/pkg/networkservice/mechanisms/memif/memifrxmode/server.go b/pkg/networkservice/mechanisms/memif/memifrxmode/server.go index a1ca66e3..05325e01 100644 --- a/pkg/networkservice/mechanisms/memif/memifrxmode/server.go +++ b/pkg/networkservice/mechanisms/memif/memifrxmode/server.go @@ -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 // @@ -22,6 +22,7 @@ import ( "context" "github.com/pkg/errors" + "go.fd.io/govpp/api" "github.com/golang/protobuf/ptypes/empty" @@ -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, diff --git a/pkg/networkservice/up/client.go b/pkg/networkservice/up/client.go index 0f16df28..760ad2a1 100644 --- a/pkg/networkservice/up/client.go +++ b/pkg/networkservice/up/client.go @@ -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 // @@ -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" @@ -39,7 +40,7 @@ import ( type upClient struct { ctx context.Context - vppConn Connection + vppConn api.Connection loadIfIndex ifIndexFunc inited uint32 @@ -47,7 +48,7 @@ type upClient struct { } // 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, } diff --git a/pkg/networkservice/up/common.go b/pkg/networkservice/up/common.go index 5d43e4a8..b9deb257 100644 --- a/pkg/networkservice/up/common.go +++ b/pkg/networkservice/up/common.go @@ -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 // diff --git a/pkg/networkservice/up/ipsecup/client.go b/pkg/networkservice/up/ipsecup/client.go index b3500838..7a552a3c 100644 --- a/pkg/networkservice/up/ipsecup/client.go +++ b/pkg/networkservice/up/ipsecup/client.go @@ -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 // @@ -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" @@ -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, diff --git a/pkg/networkservice/up/ipsecup/common.go b/pkg/networkservice/up/ipsecup/common.go index 2f3f56df..3e956c38 100644 --- a/pkg/networkservice/up/ipsecup/common.go +++ b/pkg/networkservice/up/ipsecup/common.go @@ -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 // @@ -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 diff --git a/pkg/networkservice/up/server.go b/pkg/networkservice/up/server.go index addaf32d..89022534 100644 --- a/pkg/networkservice/up/server.go +++ b/pkg/networkservice/up/server.go @@ -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 // @@ -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" @@ -34,7 +35,7 @@ import ( type upServer struct { ctx context.Context - vppConn Connection + vppConn api.Connection loadIfIndex ifIndexFunc inited uint32 @@ -42,7 +43,7 @@ type upServer struct { } // 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, }