Skip to content
Snippets Groups Projects
Commit 9cca50b3 authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

golint --fix

parent 6a993573
Branches
Tags
8 merge requests!246Develop,!245Develop into Master,!244Master into develop2 into master,!219Draft: Testing,!214Test pipelines,!195DO NOT MERGE 2,!194DO NOT MERGE! just for testing,!138Develop
Pipeline #74243 passed
This commit is part of merge request !138. Comments created here will be created in the context of that merge request.
...@@ -3,9 +3,9 @@ package nucleus ...@@ -3,9 +3,9 @@ package nucleus
import ( import (
tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport"
"github.com/docker/docker/pkg/namesgenerator" "github.com/docker/docker/pkg/namesgenerator"
"github.com/golang/protobuf/proto"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/openconfig/ygot/ygot" "github.com/openconfig/ygot/ygot"
"google.golang.org/protobuf/proto"
) )
// Device represents an Orchestrated Network Device (OND) which is managed by // Device represents an Orchestrated Network Device (OND) which is managed by
...@@ -21,6 +21,7 @@ type Device interface { ...@@ -21,6 +21,7 @@ type Device interface {
isDevice() isDevice()
} }
// CommonDevice represents an OND
type CommonDevice struct { type CommonDevice struct {
// UUID represents the Devices UUID // UUID represents the Devices UUID
UUID uuid.UUID UUID uuid.UUID
...@@ -63,34 +64,42 @@ func (d *CommonDevice) ID() uuid.UUID { ...@@ -63,34 +64,42 @@ func (d *CommonDevice) ID() uuid.UUID {
return d.UUID return d.UUID
} }
// Model returns the ygot representation of the Device
func (d *CommonDevice) Model() ygot.GoStruct { func (d *CommonDevice) Model() ygot.GoStruct {
return d.GoStruct return d.GoStruct
} }
// Transport returns the Transport of the device
func (d *CommonDevice) Transport() Transport { func (d *CommonDevice) Transport() Transport {
return d.transport return d.transport
} }
// Name returns the name of the device
func (d *CommonDevice) Name() string { func (d *CommonDevice) Name() string {
return d.name return d.name
} }
// SBI returns the sbi of the Device
func (d *CommonDevice) SBI() SouthboundInterface { func (d *CommonDevice) SBI() SouthboundInterface {
return d.sbi return d.sbi
} }
// SetTransport sets the Device's Transport
func (d *CommonDevice) SetTransport(t Transport) { func (d *CommonDevice) SetTransport(t Transport) {
d.transport = t d.transport = t
} }
// SetName sets the Device's name
func (d *CommonDevice) SetName(n string) { func (d *CommonDevice) SetName(n string) {
d.name = n d.name = n
} }
// SetSBI sets the Device's SBI
func (d *CommonDevice) SetSBI(sbi SouthboundInterface) { func (d *CommonDevice) SetSBI(sbi SouthboundInterface) {
d.sbi = sbi d.sbi = sbi
} }
// ProcessResponse processes a response for the Device
func (d *CommonDevice) ProcessResponse(resp proto.Message) error { func (d *CommonDevice) ProcessResponse(resp proto.Message) error {
return d.transport.ProcessResponse(resp, d.GoStruct, d.sbi.Schema()) return d.transport.ProcessResponse(resp, d.GoStruct, d.sbi.Schema())
} }
......
...@@ -342,10 +342,12 @@ func (g *Gnmi) Close() error { ...@@ -342,10 +342,12 @@ func (g *Gnmi) Close() error {
return nil return nil
} }
// SetPassthrough allows to pass an existing SetRequest. Used for cSBI
func (g *Gnmi) SetPassthrough(ctx context.Context, req *gpb.SetRequest) (*gpb.SetResponse, error) { func (g *Gnmi) SetPassthrough(ctx context.Context, req *gpb.SetRequest) (*gpb.SetResponse, error) {
return g.client.Set(ctx, req) return g.client.Set(ctx, req)
} }
// GetPassthrough allows to pass an existing GetRequest. Used for cSBI
func (g *Gnmi) GetPassthrough(ctx context.Context, req *gpb.GetRequest) (*gpb.GetResponse, error) { func (g *Gnmi) GetPassthrough(ctx context.Context, req *gpb.GetRequest) (*gpb.GetResponse, error) {
return g.client.Get(ctx, req) return g.client.Get(ctx, req)
} }
...@@ -11,11 +11,11 @@ import ( ...@@ -11,11 +11,11 @@ import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus/errors" "code.fbi.h-da.de/cocsn/gosdn/nucleus/errors"
"github.com/golang/protobuf/proto"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/openconfig/ygot/ygot" "github.com/openconfig/ygot/ygot"
"github.com/openconfig/ygot/ytypes" "github.com/openconfig/ygot/ytypes"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"google.golang.org/protobuf/proto"
) )
// PrincipalNetworkDomain provides an // PrincipalNetworkDomain provides an
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment