Skip to content

Commit

Permalink
Fix lint and format issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Lenco committed Jan 11, 2019
1 parent ce4e213 commit 1be6ac1
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion cmd/contiv-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import (
const (
defaultStartupTimeout = 45 * time.Second

grpcDBPath = "/var/bolt/grpc.db"
grpcDBPath = "/var/bolt/grpc.db"
grpcEndpoint = "localhost:9111"
)

Expand Down
2 changes: 1 addition & 1 deletion mock/localclient/dsl/linux/data_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/ligato/vpp-agent/plugins/vpp/model/stn"
"github.com/ligato/vpp-agent/plugins/vppv2/model/acl"
"github.com/ligato/vpp-agent/plugins/vppv2/model/interfaces"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l2"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l3"
"github.com/ligato/vpp-agent/plugins/vppv2/model/nat"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/punt"
)

Expand Down
2 changes: 1 addition & 1 deletion mock/localclient/dsl/linux/data_resync.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/ligato/vpp-agent/plugins/vpp/model/stn"
"github.com/ligato/vpp-agent/plugins/vppv2/model/acl"
"github.com/ligato/vpp-agent/plugins/vppv2/model/interfaces"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l2"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l3"
"github.com/ligato/vpp-agent/plugins/vppv2/model/nat"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/punt"
)

Expand Down
2 changes: 1 addition & 1 deletion mock/localclient/dsl/vpp/data_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/ligato/vpp-agent/plugins/vpp/model/bfd"
"github.com/ligato/vpp-agent/plugins/vpp/model/l4"
"github.com/ligato/vpp-agent/plugins/vpp/model/stn"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/acl"
"github.com/ligato/vpp-agent/plugins/vppv2/model/interfaces"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l2"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l3"
"github.com/ligato/vpp-agent/plugins/vppv2/model/nat"
Expand Down
2 changes: 1 addition & 1 deletion mock/localclient/dsl/vpp/data_resync.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"github.com/ligato/vpp-agent/plugins/vpp/model/stn"
"github.com/ligato/vpp-agent/plugins/vppv2/model/acl"
"github.com/ligato/vpp-agent/plugins/vppv2/model/interfaces"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l2"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l3"
"github.com/ligato/vpp-agent/plugins/vppv2/model/nat"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/punt"
)

Expand Down
7 changes: 3 additions & 4 deletions plugins/controller/api/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ func protoToString(msg proto.Message) string {
// ExternalConfigChange is an Update event that represents change for one key
// from the external configuration (for vpp-agent).
type ExternalConfigChange struct {
result chan error
blocking bool
result chan error
blocking bool

Source string
UpdatedKVs ExternalConfig
Expand Down Expand Up @@ -328,7 +328,6 @@ func (ev *ExternalConfigChange) Wait() error {
return <-ev.result
}


/*************************** External Config Resync ***************************/

// ExternalConfigResync is a Resync event triggered by external config source.
Expand Down Expand Up @@ -360,7 +359,7 @@ func (ev *ExternalConfigResync) GetName() string {
func (ev *ExternalConfigResync) String() string {
flags := []string{strings.ToUpper(ev.Source)}
str := ev.GetName() + " " + flagsToString(flags, 0)
for key, _ := range ev.ExternalConfig {
for key := range ev.ExternalConfig {
str += fmt.Sprintf("\n* key: %s", key)
}
return str
Expand Down
30 changes: 15 additions & 15 deletions plugins/grpc/clientv2/data_change_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
)

const (
notImplementedPanic = "not implemented in v.2 yet"
deprecatedPanic = "deprecated in v.2"
notImplemented = "not implemented in v.2 yet"
deprecated = "deprecated in v.2"
)

// NewDataChangeDSL is a constructor
Expand Down Expand Up @@ -117,21 +117,21 @@ func (dsl *PutDSL) ACL(val *acl.Acl) linuxclient.PutDSL {
// BfdSession adds a request to create or update VPP bidirectional
// forwarding detection session.
func (dsl *PutDSL) BfdSession(val *bfd.SingleHopBFD_Session) linuxclient.PutDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// BfdAuthKeys adds a request to create or update VPP bidirectional
// forwarding detection key.
func (dsl *PutDSL) BfdAuthKeys(val *bfd.SingleHopBFD_Key) linuxclient.PutDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// BfdEchoFunction adds a request to create or update VPP bidirectional
// forwarding detection echo function.
func (dsl *PutDSL) BfdEchoFunction(val *bfd.SingleHopBFD_EchoFunction) linuxclient.PutDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

Expand Down Expand Up @@ -186,19 +186,19 @@ func (dsl *PutDSL) IPScanNeighbor(val *l3.IPScanNeighbor) linuxclient.PutDSL {

// L4Features adds a request to enable or disable L4 features
func (dsl *PutDSL) L4Features(val *l4.L4Features) linuxclient.PutDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// AppNamespace adds a request to create or update VPP Application namespace
func (dsl *PutDSL) AppNamespace(val *l4.AppNamespaces_AppNamespace) linuxclient.PutDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// StnRule adds a request to create or update VPP Stn rule.
func (dsl *PutDSL) StnRule(val *stn.STN_Rule) linuxclient.PutDSL {
panic(deprecatedPanic)
defer func() { panic(deprecated) }()
return dsl
}

Expand Down Expand Up @@ -310,21 +310,21 @@ func (dsl *DeleteDSL) ACL(aclName string) linuxclient.DeleteDSL {
// BfdSession adds a request to delete an existing VPP bidirectional
// forwarding detection session.
func (dsl *DeleteDSL) BfdSession(bfdSessionIfaceName string) linuxclient.DeleteDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// BfdAuthKeys adds a request to delete an existing VPP bidirectional
// forwarding detection key.
func (dsl *DeleteDSL) BfdAuthKeys(bfdKey string) linuxclient.DeleteDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// BfdEchoFunction adds a request to delete an existing VPP bidirectional
// forwarding detection echo function.
func (dsl *DeleteDSL) BfdEchoFunction(bfdEchoName string) linuxclient.DeleteDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

Expand All @@ -338,7 +338,7 @@ func (dsl *DeleteDSL) BD(bdName string) linuxclient.DeleteDSL {
return dsl
}

// FIB adds a request to delete an existing VPP L2 Forwarding Information
// BDFIB adds a request to delete an existing VPP L2 Forwarding Information
// Base.
func (dsl *DeleteDSL) BDFIB(bdName string, mac string) linuxclient.DeleteDSL {
dsl.parent.delReq.FIBs = append(dsl.parent.delReq.FIBs,
Expand Down Expand Up @@ -399,19 +399,19 @@ func (dsl *DeleteDSL) IPScanNeighbor() linuxclient.DeleteDSL {

// L4Features adds a request to enable or disable L4 features
func (dsl *DeleteDSL) L4Features() linuxclient.DeleteDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// AppNamespace adds a request to delete VPP Application namespace
func (dsl *DeleteDSL) AppNamespace(id string) linuxclient.DeleteDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// StnRule adds a request to delete an existing VPP Stn rule.
func (dsl *DeleteDSL) StnRule(ruleName string) linuxclient.DeleteDSL {
panic(deprecatedPanic)
defer func() { panic(deprecated) }()
return dsl
}

Expand Down
16 changes: 8 additions & 8 deletions plugins/grpc/clientv2/data_resync_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ func (dsl *DataResyncDSL) LinuxInterface(val *linux_interfaces.Interface) linuxc
return dsl
}

// LinuxInterface adds Linux ARP entry to the RESYNC request.
// LinuxArpEntry adds Linux ARP entry to the RESYNC request.
func (dsl *DataResyncDSL) LinuxArpEntry(val *linux_l3.StaticARPEntry) linuxclient.DataResyncDSL {
dsl.req.LinuxArpEntries = append(dsl.req.LinuxArpEntries, val)
return dsl
}

// LinuxInterface adds Linux route to the RESYNC request.
// LinuxRoute adds Linux route to the RESYNC request.
func (dsl *DataResyncDSL) LinuxRoute(val *linux_l3.StaticRoute) linuxclient.DataResyncDSL {
dsl.req.LinuxRoutes = append(dsl.req.LinuxRoutes, val)
return dsl
Expand All @@ -83,21 +83,21 @@ func (dsl *DataResyncDSL) ACL(val *acl.Acl) linuxclient.DataResyncDSL {
// BfdSession adds VPP bidirectional forwarding detection session
// to the RESYNC request.
func (dsl *DataResyncDSL) BfdSession(val *bfd.SingleHopBFD_Session) linuxclient.DataResyncDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// BfdAuthKeys adds VPP bidirectional forwarding detection key to the RESYNC
// request.
func (dsl *DataResyncDSL) BfdAuthKeys(val *bfd.SingleHopBFD_Key) linuxclient.DataResyncDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// BfdEchoFunction adds VPP bidirectional forwarding detection echo function
// to the RESYNC request.
func (dsl *DataResyncDSL) BfdEchoFunction(val *bfd.SingleHopBFD_EchoFunction) linuxclient.DataResyncDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

Expand Down Expand Up @@ -145,19 +145,19 @@ func (dsl *DataResyncDSL) IPScanNeighbor(val *l3.IPScanNeighbor) linuxclient.Dat

// L4Features adds L4 features to the RESYNC request
func (dsl *DataResyncDSL) L4Features(val *l4.L4Features) linuxclient.DataResyncDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// AppNamespace adds VPP Application namespaces to the RESYNC request
func (dsl *DataResyncDSL) AppNamespace(val *l4.AppNamespaces_AppNamespace) linuxclient.DataResyncDSL {
panic(notImplementedPanic)
defer func() { panic(notImplemented) }()
return dsl
}

// StnRule adds Stn rule to the RESYNC request.
func (dsl *DataResyncDSL) StnRule(val *stn.STN_Rule) linuxclient.DataResyncDSL {
panic(deprecatedPanic)
defer func() { panic(deprecated) }()
return dsl
}

Expand Down
11 changes: 5 additions & 6 deletions plugins/grpc/rpc_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,28 @@ import (
"github.com/gogo/protobuf/proto"
"golang.org/x/net/context"

"github.com/ligato/cn-infra/datasync"
"github.com/ligato/cn-infra/db/keyval"
"github.com/ligato/cn-infra/infra"
"github.com/ligato/cn-infra/logging"
"github.com/ligato/cn-infra/rpc/grpc"
"github.com/ligato/cn-infra/datasync"
"github.com/ligato/cn-infra/db/keyval"

"github.com/ligato/vpp-agent/plugins/linuxv2/model/interfaces"
"github.com/ligato/vpp-agent/plugins/linuxv2/model/l3"
"github.com/ligato/vpp-agent/plugins/vppv2/model/acl"
"github.com/ligato/vpp-agent/plugins/vppv2/model/interfaces"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l2"
"github.com/ligato/vpp-agent/plugins/vppv2/model/l3"
"github.com/ligato/vpp-agent/plugins/vppv2/model/nat"
"github.com/ligato/vpp-agent/plugins/vppv2/model/ipsec"
"github.com/ligato/vpp-agent/plugins/vppv2/model/punt"
"github.com/ligato/vpp-agent/plugins/linuxv2/model/interfaces"
"github.com/ligato/vpp-agent/plugins/linuxv2/model/l3"

controller "github.com/contiv/vpp/plugins/controller/api"
"github.com/contiv/vpp/plugins/grpc/rpc"
)

//go:generate protoc --proto_path=rpc --proto_path=$GOPATH/src --gogo_out=plugins=grpc:rpc rpc/rpc.proto


// Plugin implements GRPC access to Contiv's VPP-agent.
type Plugin struct {
Deps
Expand Down

0 comments on commit 1be6ac1

Please sign in to comment.