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

Moved interfaces to own package

parent 96775e09
Branches
Tags
9 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,!163Moved interfaces to own package,!138Develop
Showing
with 355 additions and 165 deletions
...@@ -9,6 +9,8 @@ import ( ...@@ -9,6 +9,8 @@ import (
"sync" "sync"
"time" "time"
"code.fbi.h-da.de/cocsn/gosdn/interfaces/southbound"
"github.com/google/uuid" "github.com/google/uuid"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/viper" "github.com/spf13/viper"
...@@ -88,7 +90,7 @@ func createSouthboundInterfaces() error { ...@@ -88,7 +90,7 @@ func createSouthboundInterfaces() error {
} }
// createPrincipalNetworkDomain initializes the controller with an initial PND // createPrincipalNetworkDomain initializes the controller with an initial PND
func createPrincipalNetworkDomain(s nucleus.SouthboundInterface) error { func createPrincipalNetworkDomain(s southbound.SouthboundInterface) error {
pnd, err := nucleus.NewPND("base", "gosdn base pnd", uuid.New(), s) pnd, err := nucleus.NewPND("base", "gosdn base pnd", uuid.New(), s)
if err != nil { if err != nil {
return err return err
......
...@@ -5,7 +5,10 @@ import ( ...@@ -5,7 +5,10 @@ import (
"os" "os"
"testing" "testing"
"code.fbi.h-da.de/cocsn/gosdn/nucleus" "code.fbi.h-da.de/cocsn/gosdn/interfaces/device"
"code.fbi.h-da.de/cocsn/gosdn/interfaces/networkdomain"
"code.fbi.h-da.de/cocsn/gosdn/interfaces/southbound"
"code.fbi.h-da.de/cocsn/gosdn/nucleus/util/proto" "code.fbi.h-da.de/cocsn/gosdn/nucleus/util/proto"
"github.com/google/uuid" "github.com/google/uuid"
gpb "github.com/openconfig/gnmi/proto/gnmi" gpb "github.com/openconfig/gnmi/proto/gnmi"
...@@ -22,10 +25,10 @@ var defaultSbiID uuid.UUID ...@@ -22,10 +25,10 @@ var defaultSbiID uuid.UUID
var defaultPndID uuid.UUID var defaultPndID uuid.UUID
var cuid uuid.UUID var cuid uuid.UUID
var sbi nucleus.SouthboundInterface var sbi southbound.SouthboundInterface
var httpTestPND nucleus.PrincipalNetworkDomain var httpTestPND networkdomain.NetworkDomain
var gnmiMessages map[string]pb.Message var gnmiMessages map[string]pb.Message
var httpTestDevice nucleus.Device var httpTestDevice device.Device
var args string var args string
var argsNotFound string var argsNotFound string
......
package change
import "github.com/google/uuid"
// Change is an intended change to an OND. It is unique and immutable.
// It has a cuid, a timestamp, and holds both the previous and the new
// state. It keeps track if the state is committed and confirmed. A callback
// exists to acess the proper transport for the changed OND
type Change interface {
ID() uuid.UUID
Commit() error
Confirm() error
}
package device
import (
"code.fbi.h-da.de/cocsn/gosdn/interfaces/southbound"
"code.fbi.h-da.de/cocsn/gosdn/interfaces/transport"
"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
// nucleus
type Device interface {
ID() uuid.UUID
Model() ygot.GoStruct
Transport() transport.Transport
Name() string
SBI() southbound.SouthboundInterface
ProcessResponse(proto.Message) error
}
package networkdomain
import (
ppb "code.fbi.h-da.de/cocsn/api/go/gosdn/pnd"
tpb "code.fbi.h-da.de/cocsn/api/go/gosdn/transport"
"code.fbi.h-da.de/cocsn/gosdn/interfaces/change"
"code.fbi.h-da.de/cocsn/gosdn/interfaces/device"
"code.fbi.h-da.de/cocsn/gosdn/interfaces/southbound"
"code.fbi.h-da.de/cocsn/gosdn/interfaces/store"
"github.com/google/uuid"
)
// NetworkDomain provides an interface for network domain implementations
// like principal network domain or logical network domain.
type NetworkDomain interface {
Destroy() error
AddSbi(s southbound.SouthboundInterface) error
RemoveSbi(uuid.UUID) error
AddDevice(name string, opts *tpb.TransportOption, sid uuid.UUID) error
GetDevice(identifier string) (device.Device, error)
RemoveDevice(uuid.UUID) error
Devices() []uuid.UUID
ChangeOND(uuid uuid.UUID, operation ppb.ApiOperation, path string, value ...string) error
Request(uuid.UUID, string) error
RequestAll(string) error
GetName() string
GetDescription() string
MarshalDevice(string) (string, error)
ContainsDevice(uuid.UUID) bool
GetSBIs() store.Store
ID() uuid.UUID
PendingChanges() []uuid.UUID
CommittedChanges() []uuid.UUID
GetChange(uuid.UUID, ...int) (change.Change, error)
Commit(uuid.UUID) error
Confirm(uuid.UUID) error
}
package southbound
import (
spb "code.fbi.h-da.de/cocsn/api/go/gosdn/southbound"
"github.com/google/uuid"
gpb "github.com/openconfig/gnmi/proto/gnmi"
"github.com/openconfig/goyang/pkg/yang"
"github.com/openconfig/ygot/ytypes"
)
// SouthboundInterface provides an
// interface for SBI implementations
type SouthboundInterface interface { // nolint
// deprecated
SbiIdentifier() string
// SetNode injects SBI specific model
// representation to the transport.
// Needed for type assertion.
SetNode() func(schema *yang.Entry, root interface{}, path *gpb.Path, val interface{}, opts ...ytypes.SetNodeOpt) error
Schema() *ytypes.Schema
ID() uuid.UUID
Type() spb.Type
}
package store
import "github.com/google/uuid"
// Storable provides an interface for the controller's storage architecture.
type Storable interface {
ID() uuid.UUID
}
// Store describes an interface for store implementations.
type Store interface {
Exists(id uuid.UUID) bool
Add(item Storable) error
Get(id uuid.UUID) (Storable, error)
Delete(id uuid.UUID) error
UUIDs() []uuid.UUID
}
package transport
import (
"context"
"github.com/openconfig/ygot/ytypes"
)
// Transport provides an interface for Transport implementations
// like RESTCONF or gnmi
type Transport interface {
Get(ctx context.Context, params ...string) (interface{}, error)
Set(ctx context.Context, params ...interface{}) error
Subscribe(ctx context.Context, params ...string) error
Type() string
ProcessResponse(resp interface{}, root interface{}, models *ytypes.Schema) error
}
// Code generated by mockery 2.7.5. DO NOT EDIT.
package mocks
import (
uuid "github.com/google/uuid"
mock "github.com/stretchr/testify/mock"
)
// Change is an autogenerated mock type for the Change type
type Change struct {
mock.Mock
}
// Commit provides a mock function with given fields:
func (_m *Change) Commit() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// Confirm provides a mock function with given fields:
func (_m *Change) Confirm() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// ID provides a mock function with given fields:
func (_m *Change) ID() uuid.UUID {
ret := _m.Called()
var r0 uuid.UUID
if rf, ok := ret.Get(0).(func() uuid.UUID); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(uuid.UUID)
}
}
return r0
}
// Code generated by mockery v2.6.0. DO NOT EDIT.
package mocks
import (
ygot "github.com/openconfig/ygot/ygot"
mock "github.com/stretchr/testify/mock"
)
// ConfigCallback is an autogenerated mock type for the ConfigCallback type
type ConfigCallback struct {
mock.Mock
}
// Execute provides a mock function with given fields: _a0
func (_m *ConfigCallback) Execute(_a0 ygot.ValidatedGoStruct) error {
ret := _m.Called(_a0)
var r0 error
if rf, ok := ret.Get(0).(func(ygot.ValidatedGoStruct) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
// Code generated by mockery 2.7.5. DO NOT EDIT.
package mocks
import (
southbound "code.fbi.h-da.de/cocsn/gosdn/interfaces/southbound"
mock "github.com/stretchr/testify/mock"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
transport "code.fbi.h-da.de/cocsn/gosdn/interfaces/transport"
uuid "github.com/google/uuid"
ygot "github.com/openconfig/ygot/ygot"
)
// Device is an autogenerated mock type for the Device type
type Device struct {
mock.Mock
}
// ID provides a mock function with given fields:
func (_m *Device) ID() uuid.UUID {
ret := _m.Called()
var r0 uuid.UUID
if rf, ok := ret.Get(0).(func() uuid.UUID); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(uuid.UUID)
}
}
return r0
}
// Model provides a mock function with given fields:
func (_m *Device) Model() ygot.GoStruct {
ret := _m.Called()
var r0 ygot.GoStruct
if rf, ok := ret.Get(0).(func() ygot.GoStruct); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(ygot.GoStruct)
}
}
return r0
}
// Name provides a mock function with given fields:
func (_m *Device) Name() string {
ret := _m.Called()
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// ProcessResponse provides a mock function with given fields: _a0
func (_m *Device) ProcessResponse(_a0 protoreflect.ProtoMessage) error {
ret := _m.Called(_a0)
var r0 error
if rf, ok := ret.Get(0).(func(protoreflect.ProtoMessage) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
// SBI provides a mock function with given fields:
func (_m *Device) SBI() southbound.SouthboundInterface {
ret := _m.Called()
var r0 southbound.SouthboundInterface
if rf, ok := ret.Get(0).(func() southbound.SouthboundInterface); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(southbound.SouthboundInterface)
}
}
return r0
}
// Transport provides a mock function with given fields:
func (_m *Device) Transport() transport.Transport {
ret := _m.Called()
var r0 transport.Transport
if rf, ok := ret.Get(0).(func() transport.Transport); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(transport.Transport)
}
}
return r0
}
// Code generated by mockery v2.6.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// EscapeFunc is an autogenerated mock type for the EscapeFunc type
type EscapeFunc struct {
mock.Mock
}
// Execute provides a mock function with given fields: k
func (_m *EscapeFunc) Execute(k string) string {
ret := _m.Called(k)
var r0 string
if rf, ok := ret.Get(0).(func(string) string); ok {
r0 = rf(k)
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// Code generated by mockery v2.6.0. DO NOT EDIT. // Code generated by mockery 2.7.5. DO NOT EDIT.
package mocks package mocks
......
// Code generated by mockery v2.6.0. DO NOT EDIT. // Code generated by mockery 2.7.5. DO NOT EDIT.
package mocks package mocks
......
// Code generated by mockery v2.6.0. DO NOT EDIT. // Code generated by mockery 2.7.5. DO NOT EDIT.
package mocks package mocks
......
// Code generated by mockery v2.6.0. DO NOT EDIT. // Code generated by mockery 2.7.5. DO NOT EDIT.
package mocks package mocks
......
// Code generated by mockery v2.6.0. DO NOT EDIT.
package mocks
import (
ygot "github.com/openconfig/ygot/ygot"
mock "github.com/stretchr/testify/mock"
ytypes "github.com/openconfig/ygot/ytypes"
)
// JSONUnmarshaler is an autogenerated mock type for the JSONUnmarshaler type
type JSONUnmarshaler struct {
mock.Mock
}
// Execute provides a mock function with given fields: _a0, _a1, _a2
func (_m *JSONUnmarshaler) Execute(_a0 []byte, _a1 ygot.GoStruct, _a2 ...ytypes.UnmarshalOpt) error {
_va := make([]interface{}, len(_a2))
for _i := range _a2 {
_va[_i] = _a2[_i]
}
var _ca []interface{}
_ca = append(_ca, _a0, _a1)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 error
if rf, ok := ret.Get(0).(func([]byte, ygot.GoStruct, ...ytypes.UnmarshalOpt) error); ok {
r0 = rf(_a0, _a1, _a2...)
} else {
r0 = ret.Error(0)
}
return r0
}
...@@ -3,22 +3,29 @@ ...@@ -3,22 +3,29 @@
package mocks package mocks
import ( import (
change "code.fbi.h-da.de/cocsn/gosdn/interfaces/change"
device "code.fbi.h-da.de/cocsn/gosdn/interfaces/device"
mock "github.com/stretchr/testify/mock" mock "github.com/stretchr/testify/mock"
pnd "code.fbi.h-da.de/cocsn/api/go/gosdn/pnd" pnd "code.fbi.h-da.de/cocsn/api/go/gosdn/pnd"
southbound "code.fbi.h-da.de/cocsn/gosdn/interfaces/southbound"
store "code.fbi.h-da.de/cocsn/gosdn/interfaces/store"
transport "code.fbi.h-da.de/cocsn/api/go/gosdn/transport" transport "code.fbi.h-da.de/cocsn/api/go/gosdn/transport"
uuid "github.com/google/uuid" uuid "github.com/google/uuid"
) )
// PrincipalNetworkDomain is an autogenerated mock type for the PrincipalNetworkDomain type // NetworkDomain is an autogenerated mock type for the NetworkDomain type
type PrincipalNetworkDomain struct { type NetworkDomain struct {
mock.Mock mock.Mock
} }
// AddDevice provides a mock function with given fields: name, opts, sid // AddDevice provides a mock function with given fields: name, opts, sid
func (_m *PrincipalNetworkDomain) AddDevice(name string, opts *transport.TransportOption, sid uuid.UUID) error { func (_m *NetworkDomain) AddDevice(name string, opts *transport.TransportOption, sid uuid.UUID) error {
ret := _m.Called(name, opts, sid) ret := _m.Called(name, opts, sid)
var r0 error var r0 error
...@@ -31,13 +38,13 @@ func (_m *PrincipalNetworkDomain) AddDevice(name string, opts *transport.Transpo ...@@ -31,13 +38,13 @@ func (_m *PrincipalNetworkDomain) AddDevice(name string, opts *transport.Transpo
return r0 return r0
} }
// AddSbi provides a mock function with given fields: _a0 // AddSbi provides a mock function with given fields: s
func (_m *PrincipalNetworkDomain) AddSbi(_a0 interface{}) error { func (_m *NetworkDomain) AddSbi(s southbound.SouthboundInterface) error {
ret := _m.Called(_a0) ret := _m.Called(s)
var r0 error var r0 error
if rf, ok := ret.Get(0).(func(interface{}) error); ok { if rf, ok := ret.Get(0).(func(southbound.SouthboundInterface) error); ok {
r0 = rf(_a0) r0 = rf(s)
} else { } else {
r0 = ret.Error(0) r0 = ret.Error(0)
} }
...@@ -46,7 +53,7 @@ func (_m *PrincipalNetworkDomain) AddSbi(_a0 interface{}) error { ...@@ -46,7 +53,7 @@ func (_m *PrincipalNetworkDomain) AddSbi(_a0 interface{}) error {
} }
// ChangeOND provides a mock function with given fields: _a0, operation, path, value // ChangeOND provides a mock function with given fields: _a0, operation, path, value
func (_m *PrincipalNetworkDomain) ChangeOND(_a0 uuid.UUID, operation pnd.ApiOperation, path string, value ...string) error { func (_m *NetworkDomain) ChangeOND(_a0 uuid.UUID, operation pnd.ApiOperation, path string, value ...string) error {
_va := make([]interface{}, len(value)) _va := make([]interface{}, len(value))
for _i := range value { for _i := range value {
_va[_i] = value[_i] _va[_i] = value[_i]
...@@ -67,7 +74,7 @@ func (_m *PrincipalNetworkDomain) ChangeOND(_a0 uuid.UUID, operation pnd.ApiOper ...@@ -67,7 +74,7 @@ func (_m *PrincipalNetworkDomain) ChangeOND(_a0 uuid.UUID, operation pnd.ApiOper
} }
// Commit provides a mock function with given fields: _a0 // Commit provides a mock function with given fields: _a0
func (_m *PrincipalNetworkDomain) Commit(_a0 uuid.UUID) error { func (_m *NetworkDomain) Commit(_a0 uuid.UUID) error {
ret := _m.Called(_a0) ret := _m.Called(_a0)
var r0 error var r0 error
...@@ -81,7 +88,7 @@ func (_m *PrincipalNetworkDomain) Commit(_a0 uuid.UUID) error { ...@@ -81,7 +88,7 @@ func (_m *PrincipalNetworkDomain) Commit(_a0 uuid.UUID) error {
} }
// CommittedChanges provides a mock function with given fields: // CommittedChanges provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) CommittedChanges() []uuid.UUID { func (_m *NetworkDomain) CommittedChanges() []uuid.UUID {
ret := _m.Called() ret := _m.Called()
var r0 []uuid.UUID var r0 []uuid.UUID
...@@ -97,7 +104,7 @@ func (_m *PrincipalNetworkDomain) CommittedChanges() []uuid.UUID { ...@@ -97,7 +104,7 @@ func (_m *PrincipalNetworkDomain) CommittedChanges() []uuid.UUID {
} }
// Confirm provides a mock function with given fields: _a0 // Confirm provides a mock function with given fields: _a0
func (_m *PrincipalNetworkDomain) Confirm(_a0 uuid.UUID) error { func (_m *NetworkDomain) Confirm(_a0 uuid.UUID) error {
ret := _m.Called(_a0) ret := _m.Called(_a0)
var r0 error var r0 error
...@@ -111,7 +118,7 @@ func (_m *PrincipalNetworkDomain) Confirm(_a0 uuid.UUID) error { ...@@ -111,7 +118,7 @@ func (_m *PrincipalNetworkDomain) Confirm(_a0 uuid.UUID) error {
} }
// ContainsDevice provides a mock function with given fields: _a0 // ContainsDevice provides a mock function with given fields: _a0
func (_m *PrincipalNetworkDomain) ContainsDevice(_a0 uuid.UUID) bool { func (_m *NetworkDomain) ContainsDevice(_a0 uuid.UUID) bool {
ret := _m.Called(_a0) ret := _m.Called(_a0)
var r0 bool var r0 bool
...@@ -125,7 +132,7 @@ func (_m *PrincipalNetworkDomain) ContainsDevice(_a0 uuid.UUID) bool { ...@@ -125,7 +132,7 @@ func (_m *PrincipalNetworkDomain) ContainsDevice(_a0 uuid.UUID) bool {
} }
// Destroy provides a mock function with given fields: // Destroy provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) Destroy() error { func (_m *NetworkDomain) Destroy() error {
ret := _m.Called() ret := _m.Called()
var r0 error var r0 error
...@@ -139,7 +146,7 @@ func (_m *PrincipalNetworkDomain) Destroy() error { ...@@ -139,7 +146,7 @@ func (_m *PrincipalNetworkDomain) Destroy() error {
} }
// Devices provides a mock function with given fields: // Devices provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) Devices() []uuid.UUID { func (_m *NetworkDomain) Devices() []uuid.UUID {
ret := _m.Called() ret := _m.Called()
var r0 []uuid.UUID var r0 []uuid.UUID
...@@ -155,7 +162,7 @@ func (_m *PrincipalNetworkDomain) Devices() []uuid.UUID { ...@@ -155,7 +162,7 @@ func (_m *PrincipalNetworkDomain) Devices() []uuid.UUID {
} }
// GetChange provides a mock function with given fields: _a0, _a1 // GetChange provides a mock function with given fields: _a0, _a1
func (_m *PrincipalNetworkDomain) GetChange(_a0 uuid.UUID, _a1 ...int) (interface{}, error) { func (_m *NetworkDomain) GetChange(_a0 uuid.UUID, _a1 ...int) (change.Change, error) {
_va := make([]interface{}, len(_a1)) _va := make([]interface{}, len(_a1))
for _i := range _a1 { for _i := range _a1 {
_va[_i] = _a1[_i] _va[_i] = _a1[_i]
...@@ -165,12 +172,12 @@ func (_m *PrincipalNetworkDomain) GetChange(_a0 uuid.UUID, _a1 ...int) (interfac ...@@ -165,12 +172,12 @@ func (_m *PrincipalNetworkDomain) GetChange(_a0 uuid.UUID, _a1 ...int) (interfac
_ca = append(_ca, _va...) _ca = append(_ca, _va...)
ret := _m.Called(_ca...) ret := _m.Called(_ca...)
var r0 interface{} var r0 change.Change
if rf, ok := ret.Get(0).(func(uuid.UUID, ...int) interface{}); ok { if rf, ok := ret.Get(0).(func(uuid.UUID, ...int) change.Change); ok {
r0 = rf(_a0, _a1...) r0 = rf(_a0, _a1...)
} else { } else {
if ret.Get(0) != nil { if ret.Get(0) != nil {
r0 = ret.Get(0).(interface{}) r0 = ret.Get(0).(change.Change)
} }
} }
...@@ -185,7 +192,7 @@ func (_m *PrincipalNetworkDomain) GetChange(_a0 uuid.UUID, _a1 ...int) (interfac ...@@ -185,7 +192,7 @@ func (_m *PrincipalNetworkDomain) GetChange(_a0 uuid.UUID, _a1 ...int) (interfac
} }
// GetDescription provides a mock function with given fields: // GetDescription provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) GetDescription() string { func (_m *NetworkDomain) GetDescription() string {
ret := _m.Called() ret := _m.Called()
var r0 string var r0 string
...@@ -199,15 +206,15 @@ func (_m *PrincipalNetworkDomain) GetDescription() string { ...@@ -199,15 +206,15 @@ func (_m *PrincipalNetworkDomain) GetDescription() string {
} }
// GetDevice provides a mock function with given fields: identifier // GetDevice provides a mock function with given fields: identifier
func (_m *PrincipalNetworkDomain) GetDevice(identifier string) (interface{}, error) { func (_m *NetworkDomain) GetDevice(identifier string) (device.Device, error) {
ret := _m.Called(identifier) ret := _m.Called(identifier)
var r0 interface{} var r0 device.Device
if rf, ok := ret.Get(0).(func(string) interface{}); ok { if rf, ok := ret.Get(0).(func(string) device.Device); ok {
r0 = rf(identifier) r0 = rf(identifier)
} else { } else {
if ret.Get(0) != nil { if ret.Get(0) != nil {
r0 = ret.Get(0).(interface{}) r0 = ret.Get(0).(device.Device)
} }
} }
...@@ -222,7 +229,7 @@ func (_m *PrincipalNetworkDomain) GetDevice(identifier string) (interface{}, err ...@@ -222,7 +229,7 @@ func (_m *PrincipalNetworkDomain) GetDevice(identifier string) (interface{}, err
} }
// GetName provides a mock function with given fields: // GetName provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) GetName() string { func (_m *NetworkDomain) GetName() string {
ret := _m.Called() ret := _m.Called()
var r0 string var r0 string
...@@ -236,15 +243,15 @@ func (_m *PrincipalNetworkDomain) GetName() string { ...@@ -236,15 +243,15 @@ func (_m *PrincipalNetworkDomain) GetName() string {
} }
// GetSBIs provides a mock function with given fields: // GetSBIs provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) GetSBIs() interface{} { func (_m *NetworkDomain) GetSBIs() store.Store {
ret := _m.Called() ret := _m.Called()
var r0 interface{} var r0 store.Store
if rf, ok := ret.Get(0).(func() interface{}); ok { if rf, ok := ret.Get(0).(func() store.Store); ok {
r0 = rf() r0 = rf()
} else { } else {
if ret.Get(0) != nil { if ret.Get(0) != nil {
r0 = ret.Get(0).(interface{}) r0 = ret.Get(0).(store.Store)
} }
} }
...@@ -252,7 +259,7 @@ func (_m *PrincipalNetworkDomain) GetSBIs() interface{} { ...@@ -252,7 +259,7 @@ func (_m *PrincipalNetworkDomain) GetSBIs() interface{} {
} }
// ID provides a mock function with given fields: // ID provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) ID() uuid.UUID { func (_m *NetworkDomain) ID() uuid.UUID {
ret := _m.Called() ret := _m.Called()
var r0 uuid.UUID var r0 uuid.UUID
...@@ -268,7 +275,7 @@ func (_m *PrincipalNetworkDomain) ID() uuid.UUID { ...@@ -268,7 +275,7 @@ func (_m *PrincipalNetworkDomain) ID() uuid.UUID {
} }
// MarshalDevice provides a mock function with given fields: _a0 // MarshalDevice provides a mock function with given fields: _a0
func (_m *PrincipalNetworkDomain) MarshalDevice(_a0 string) (string, error) { func (_m *NetworkDomain) MarshalDevice(_a0 string) (string, error) {
ret := _m.Called(_a0) ret := _m.Called(_a0)
var r0 string var r0 string
...@@ -289,7 +296,7 @@ func (_m *PrincipalNetworkDomain) MarshalDevice(_a0 string) (string, error) { ...@@ -289,7 +296,7 @@ func (_m *PrincipalNetworkDomain) MarshalDevice(_a0 string) (string, error) {
} }
// PendingChanges provides a mock function with given fields: // PendingChanges provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) PendingChanges() []uuid.UUID { func (_m *NetworkDomain) PendingChanges() []uuid.UUID {
ret := _m.Called() ret := _m.Called()
var r0 []uuid.UUID var r0 []uuid.UUID
...@@ -305,7 +312,7 @@ func (_m *PrincipalNetworkDomain) PendingChanges() []uuid.UUID { ...@@ -305,7 +312,7 @@ func (_m *PrincipalNetworkDomain) PendingChanges() []uuid.UUID {
} }
// RemoveDevice provides a mock function with given fields: _a0 // RemoveDevice provides a mock function with given fields: _a0
func (_m *PrincipalNetworkDomain) RemoveDevice(_a0 uuid.UUID) error { func (_m *NetworkDomain) RemoveDevice(_a0 uuid.UUID) error {
ret := _m.Called(_a0) ret := _m.Called(_a0)
var r0 error var r0 error
...@@ -319,7 +326,7 @@ func (_m *PrincipalNetworkDomain) RemoveDevice(_a0 uuid.UUID) error { ...@@ -319,7 +326,7 @@ func (_m *PrincipalNetworkDomain) RemoveDevice(_a0 uuid.UUID) error {
} }
// RemoveSbi provides a mock function with given fields: _a0 // RemoveSbi provides a mock function with given fields: _a0
func (_m *PrincipalNetworkDomain) RemoveSbi(_a0 uuid.UUID) error { func (_m *NetworkDomain) RemoveSbi(_a0 uuid.UUID) error {
ret := _m.Called(_a0) ret := _m.Called(_a0)
var r0 error var r0 error
...@@ -333,7 +340,7 @@ func (_m *PrincipalNetworkDomain) RemoveSbi(_a0 uuid.UUID) error { ...@@ -333,7 +340,7 @@ func (_m *PrincipalNetworkDomain) RemoveSbi(_a0 uuid.UUID) error {
} }
// Request provides a mock function with given fields: _a0, _a1 // Request provides a mock function with given fields: _a0, _a1
func (_m *PrincipalNetworkDomain) Request(_a0 uuid.UUID, _a1 string) error { func (_m *NetworkDomain) Request(_a0 uuid.UUID, _a1 string) error {
ret := _m.Called(_a0, _a1) ret := _m.Called(_a0, _a1)
var r0 error var r0 error
...@@ -347,7 +354,7 @@ func (_m *PrincipalNetworkDomain) Request(_a0 uuid.UUID, _a1 string) error { ...@@ -347,7 +354,7 @@ func (_m *PrincipalNetworkDomain) Request(_a0 uuid.UUID, _a1 string) error {
} }
// RequestAll provides a mock function with given fields: _a0 // RequestAll provides a mock function with given fields: _a0
func (_m *PrincipalNetworkDomain) RequestAll(_a0 string) error { func (_m *NetworkDomain) RequestAll(_a0 string) error {
ret := _m.Called(_a0) ret := _m.Called(_a0)
var r0 error var r0 error
......
// Code generated by mockery v2.6.0. DO NOT EDIT.
package mocks
import (
mock "github.com/stretchr/testify/mock"
protoiface "google.golang.org/protobuf/runtime/protoiface"
)
// PublishFunc is an autogenerated mock type for the PublishFunc type
type PublishFunc struct {
mock.Mock
}
// Execute provides a mock function with given fields: addr, message
func (_m *PublishFunc) Execute(addr string, message protoiface.MessageV1) {
_m.Called(addr, message)
}
// Code generated by mockery v2.6.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SBIGreeter is an autogenerated mock type for the SBIGreeter type
type SBIGreeter struct {
mock.Mock
}
// SBIHello provides a mock function with given fields:
func (_m *SBIGreeter) SBIHello() {
_m.Called()
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment