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
......@@ -3,9 +3,9 @@ package nucleus
import (
tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport"
"github.com/docker/docker/pkg/namesgenerator"
"github.com/golang/protobuf/proto"
"github.com/google/uuid"
"github.com/openconfig/ygot/ygot"
"google.golang.org/protobuf/proto"
)
// Device represents an Orchestrated Network Device (OND) which is managed by
......@@ -21,6 +21,7 @@ type Device interface {
isDevice()
}
// CommonDevice represents an OND
type CommonDevice struct {
// UUID represents the Devices UUID
UUID uuid.UUID
......@@ -63,34 +64,42 @@ func (d *CommonDevice) ID() uuid.UUID {
return d.UUID
}
// Model returns the ygot representation of the Device
func (d *CommonDevice) Model() ygot.GoStruct {
return d.GoStruct
}
// Transport returns the Transport of the device
func (d *CommonDevice) Transport() Transport {
return d.transport
}
// Name returns the name of the device
func (d *CommonDevice) Name() string {
return d.name
}
// SBI returns the sbi of the Device
func (d *CommonDevice) SBI() SouthboundInterface {
return d.sbi
}
// SetTransport sets the Device's Transport
func (d *CommonDevice) SetTransport(t Transport) {
d.transport = t
}
// SetName sets the Device's name
func (d *CommonDevice) SetName(n string) {
d.name = n
}
// SetSBI sets the Device's SBI
func (d *CommonDevice) SetSBI(sbi SouthboundInterface) {
d.sbi = sbi
}
// ProcessResponse processes a response for the Device
func (d *CommonDevice) ProcessResponse(resp proto.Message) error {
return d.transport.ProcessResponse(resp, d.GoStruct, d.sbi.Schema())
}
......
......@@ -342,10 +342,12 @@ func (g *Gnmi) Close() error {
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) {
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) {
return g.client.Get(ctx, req)
}
......@@ -11,11 +11,11 @@ import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus/errors"
"github.com/golang/protobuf/proto"
"github.com/google/uuid"
"github.com/openconfig/ygot/ygot"
"github.com/openconfig/ygot/ytypes"
log "github.com/sirupsen/logrus"
"google.golang.org/protobuf/proto"
)
// PrincipalNetworkDomain provides an
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment