286 lines
7.1 KiB
Go
286 lines
7.1 KiB
Go
|
// Code generated by mockery v2.43.1. DO NOT EDIT.
|
||
|
|
||
|
package network
|
||
|
|
||
|
import (
|
||
|
context "context"
|
||
|
bootstrap "isle/bootstrap"
|
||
|
|
||
|
daecommon "isle/daemon/daecommon"
|
||
|
|
||
|
mock "github.com/stretchr/testify/mock"
|
||
|
|
||
|
nebula "isle/nebula"
|
||
|
)
|
||
|
|
||
|
// MockNetwork is an autogenerated mock type for the Network type
|
||
|
type MockNetwork struct {
|
||
|
mock.Mock
|
||
|
}
|
||
|
|
||
|
// CreateHost provides a mock function with given fields: _a0, _a1, _a2
|
||
|
func (_m *MockNetwork) CreateHost(_a0 context.Context, _a1 nebula.HostName, _a2 CreateHostOpts) (JoiningBootstrap, error) {
|
||
|
ret := _m.Called(_a0, _a1, _a2)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for CreateHost")
|
||
|
}
|
||
|
|
||
|
var r0 JoiningBootstrap
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, nebula.HostName, CreateHostOpts) (JoiningBootstrap, error)); ok {
|
||
|
return rf(_a0, _a1, _a2)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, nebula.HostName, CreateHostOpts) JoiningBootstrap); ok {
|
||
|
r0 = rf(_a0, _a1, _a2)
|
||
|
} else {
|
||
|
r0 = ret.Get(0).(JoiningBootstrap)
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context, nebula.HostName, CreateHostOpts) error); ok {
|
||
|
r1 = rf(_a0, _a1, _a2)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// CreateNebulaCertificate provides a mock function with given fields: _a0, _a1, _a2
|
||
|
func (_m *MockNetwork) CreateNebulaCertificate(_a0 context.Context, _a1 nebula.HostName, _a2 nebula.EncryptingPublicKey) (nebula.Certificate, error) {
|
||
|
ret := _m.Called(_a0, _a1, _a2)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for CreateNebulaCertificate")
|
||
|
}
|
||
|
|
||
|
var r0 nebula.Certificate
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, nebula.HostName, nebula.EncryptingPublicKey) (nebula.Certificate, error)); ok {
|
||
|
return rf(_a0, _a1, _a2)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, nebula.HostName, nebula.EncryptingPublicKey) nebula.Certificate); ok {
|
||
|
r0 = rf(_a0, _a1, _a2)
|
||
|
} else {
|
||
|
r0 = ret.Get(0).(nebula.Certificate)
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context, nebula.HostName, nebula.EncryptingPublicKey) error); ok {
|
||
|
r1 = rf(_a0, _a1, _a2)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// GetConfig provides a mock function with given fields: _a0
|
||
|
func (_m *MockNetwork) GetConfig(_a0 context.Context) (daecommon.NetworkConfig, error) {
|
||
|
ret := _m.Called(_a0)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for GetConfig")
|
||
|
}
|
||
|
|
||
|
var r0 daecommon.NetworkConfig
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) (daecommon.NetworkConfig, error)); ok {
|
||
|
return rf(_a0)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) daecommon.NetworkConfig); ok {
|
||
|
r0 = rf(_a0)
|
||
|
} else {
|
||
|
r0 = ret.Get(0).(daecommon.NetworkConfig)
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||
|
r1 = rf(_a0)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// GetGarageClientParams provides a mock function with given fields: _a0
|
||
|
func (_m *MockNetwork) GetGarageClientParams(_a0 context.Context) (GarageClientParams, error) {
|
||
|
ret := _m.Called(_a0)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for GetGarageClientParams")
|
||
|
}
|
||
|
|
||
|
var r0 GarageClientParams
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) (GarageClientParams, error)); ok {
|
||
|
return rf(_a0)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) GarageClientParams); ok {
|
||
|
r0 = rf(_a0)
|
||
|
} else {
|
||
|
r0 = ret.Get(0).(GarageClientParams)
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||
|
r1 = rf(_a0)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// GetHosts provides a mock function with given fields: _a0
|
||
|
func (_m *MockNetwork) GetHosts(_a0 context.Context) ([]bootstrap.Host, error) {
|
||
|
ret := _m.Called(_a0)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for GetHosts")
|
||
|
}
|
||
|
|
||
|
var r0 []bootstrap.Host
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) ([]bootstrap.Host, error)); ok {
|
||
|
return rf(_a0)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) []bootstrap.Host); ok {
|
||
|
r0 = rf(_a0)
|
||
|
} else {
|
||
|
if ret.Get(0) != nil {
|
||
|
r0 = ret.Get(0).([]bootstrap.Host)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||
|
r1 = rf(_a0)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// GetNebulaCAPublicCredentials provides a mock function with given fields: _a0
|
||
|
func (_m *MockNetwork) GetNebulaCAPublicCredentials(_a0 context.Context) (nebula.CAPublicCredentials, error) {
|
||
|
ret := _m.Called(_a0)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for GetNebulaCAPublicCredentials")
|
||
|
}
|
||
|
|
||
|
var r0 nebula.CAPublicCredentials
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) (nebula.CAPublicCredentials, error)); ok {
|
||
|
return rf(_a0)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) nebula.CAPublicCredentials); ok {
|
||
|
r0 = rf(_a0)
|
||
|
} else {
|
||
|
r0 = ret.Get(0).(nebula.CAPublicCredentials)
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||
|
r1 = rf(_a0)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// GetNetworkCreationParams provides a mock function with given fields: _a0
|
||
|
func (_m *MockNetwork) GetNetworkCreationParams(_a0 context.Context) (bootstrap.CreationParams, error) {
|
||
|
ret := _m.Called(_a0)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for GetNetworkCreationParams")
|
||
|
}
|
||
|
|
||
|
var r0 bootstrap.CreationParams
|
||
|
var r1 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) (bootstrap.CreationParams, error)); ok {
|
||
|
return rf(_a0)
|
||
|
}
|
||
|
if rf, ok := ret.Get(0).(func(context.Context) bootstrap.CreationParams); ok {
|
||
|
r0 = rf(_a0)
|
||
|
} else {
|
||
|
r0 = ret.Get(0).(bootstrap.CreationParams)
|
||
|
}
|
||
|
|
||
|
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||
|
r1 = rf(_a0)
|
||
|
} else {
|
||
|
r1 = ret.Error(1)
|
||
|
}
|
||
|
|
||
|
return r0, r1
|
||
|
}
|
||
|
|
||
|
// RemoveHost provides a mock function with given fields: ctx, hostName
|
||
|
func (_m *MockNetwork) RemoveHost(ctx context.Context, hostName nebula.HostName) error {
|
||
|
ret := _m.Called(ctx, hostName)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for RemoveHost")
|
||
|
}
|
||
|
|
||
|
var r0 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, nebula.HostName) error); ok {
|
||
|
r0 = rf(ctx, hostName)
|
||
|
} else {
|
||
|
r0 = ret.Error(0)
|
||
|
}
|
||
|
|
||
|
return r0
|
||
|
}
|
||
|
|
||
|
// SetConfig provides a mock function with given fields: _a0, _a1
|
||
|
func (_m *MockNetwork) SetConfig(_a0 context.Context, _a1 daecommon.NetworkConfig) error {
|
||
|
ret := _m.Called(_a0, _a1)
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for SetConfig")
|
||
|
}
|
||
|
|
||
|
var r0 error
|
||
|
if rf, ok := ret.Get(0).(func(context.Context, daecommon.NetworkConfig) error); ok {
|
||
|
r0 = rf(_a0, _a1)
|
||
|
} else {
|
||
|
r0 = ret.Error(0)
|
||
|
}
|
||
|
|
||
|
return r0
|
||
|
}
|
||
|
|
||
|
// Shutdown provides a mock function with given fields:
|
||
|
func (_m *MockNetwork) Shutdown() error {
|
||
|
ret := _m.Called()
|
||
|
|
||
|
if len(ret) == 0 {
|
||
|
panic("no return value specified for Shutdown")
|
||
|
}
|
||
|
|
||
|
var r0 error
|
||
|
if rf, ok := ret.Get(0).(func() error); ok {
|
||
|
r0 = rf()
|
||
|
} else {
|
||
|
r0 = ret.Error(0)
|
||
|
}
|
||
|
|
||
|
return r0
|
||
|
}
|
||
|
|
||
|
// NewMockNetwork creates a new instance of MockNetwork. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||
|
// The first argument is typically a *testing.T value.
|
||
|
func NewMockNetwork(t interface {
|
||
|
mock.TestingT
|
||
|
Cleanup(func())
|
||
|
}) *MockNetwork {
|
||
|
mock := &MockNetwork{}
|
||
|
mock.Mock.Test(t)
|
||
|
|
||
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||
|
|
||
|
return mock
|
||
|
}
|