Documentation ¶
Index ¶
- Variables
- type FleetDB
- type MockFleetDB
- func (_m *MockFleetDB) AddServer(ctx context.Context, serverID uuid.UUID, facilityCode string, bmcAddr string, ...) (func() error, error)
- func (_m *MockFleetDB) DeleteServer(ctx context.Context, serverID uuid.UUID) error
- func (_m *MockFleetDB) EXPECT() *MockFleetDB_Expecter
- func (_m *MockFleetDB) FirmwareSetByID(ctx context.Context, setID uuid.UUID) (*fleetdbapi.ComponentFirmwareSet, error)
- func (_m *MockFleetDB) GetServer(ctx context.Context, serverID uuid.UUID) (*model.Server, error)
- func (_m *MockFleetDB) WriteEventHistory(ctx context.Context, cond *condition.Condition) error
- type MockFleetDB_AddServer_Call
- type MockFleetDB_DeleteServer_Call
- func (_c *MockFleetDB_DeleteServer_Call) Return(_a0 error) *MockFleetDB_DeleteServer_Call
- func (_c *MockFleetDB_DeleteServer_Call) Run(run func(ctx context.Context, serverID uuid.UUID)) *MockFleetDB_DeleteServer_Call
- func (_c *MockFleetDB_DeleteServer_Call) RunAndReturn(run func(context.Context, uuid.UUID) error) *MockFleetDB_DeleteServer_Call
- type MockFleetDB_Expecter
- func (_e *MockFleetDB_Expecter) AddServer(ctx interface{}, serverID interface{}, facilityCode interface{}, ...) *MockFleetDB_AddServer_Call
- func (_e *MockFleetDB_Expecter) DeleteServer(ctx interface{}, serverID interface{}) *MockFleetDB_DeleteServer_Call
- func (_e *MockFleetDB_Expecter) FirmwareSetByID(ctx interface{}, setID interface{}) *MockFleetDB_FirmwareSetByID_Call
- func (_e *MockFleetDB_Expecter) GetServer(ctx interface{}, serverID interface{}) *MockFleetDB_GetServer_Call
- func (_e *MockFleetDB_Expecter) WriteEventHistory(ctx interface{}, cond interface{}) *MockFleetDB_WriteEventHistory_Call
- type MockFleetDB_FirmwareSetByID_Call
- func (_c *MockFleetDB_FirmwareSetByID_Call) Return(_a0 *fleetdbapi.ComponentFirmwareSet, _a1 error) *MockFleetDB_FirmwareSetByID_Call
- func (_c *MockFleetDB_FirmwareSetByID_Call) Run(run func(ctx context.Context, setID uuid.UUID)) *MockFleetDB_FirmwareSetByID_Call
- func (_c *MockFleetDB_FirmwareSetByID_Call) RunAndReturn(run func(context.Context, uuid.UUID) (*fleetdbapi.ComponentFirmwareSet, error)) *MockFleetDB_FirmwareSetByID_Call
- type MockFleetDB_GetServer_Call
- func (_c *MockFleetDB_GetServer_Call) Return(_a0 *model.Server, _a1 error) *MockFleetDB_GetServer_Call
- func (_c *MockFleetDB_GetServer_Call) Run(run func(ctx context.Context, serverID uuid.UUID)) *MockFleetDB_GetServer_Call
- func (_c *MockFleetDB_GetServer_Call) RunAndReturn(run func(context.Context, uuid.UUID) (*model.Server, error)) *MockFleetDB_GetServer_Call
- type MockFleetDB_WriteEventHistory_Call
- func (_c *MockFleetDB_WriteEventHistory_Call) Return(_a0 error) *MockFleetDB_WriteEventHistory_Call
- func (_c *MockFleetDB_WriteEventHistory_Call) Run(run func(ctx context.Context, cond *condition.Condition)) *MockFleetDB_WriteEventHistory_Call
- func (_c *MockFleetDB_WriteEventHistory_Call) RunAndReturn(run func(context.Context, *condition.Condition) error) *MockFleetDB_WriteEventHistory_Call
Constants ¶
This section is empty.
Variables ¶
var ( ErrServerNotFound = errors.New("server not found") ErrFirmwareSetNotFound = errors.New("firmware set not found") )
var (
ErrBMCCredentials = errors.New("invalid bmc credentials. missing user or password")
)
Functions ¶
This section is empty.
Types ¶
type FleetDB ¶
type FleetDB interface { // AddServer creates a server in fleet db. AddServer(ctx context.Context, serverID uuid.UUID, facilityCode, bmcAddr, bmcUser, bmcPass string) (func() error, error) // Get Server attributes. // @serverID: required GetServer(ctx context.Context, serverID uuid.UUID) (*model.Server, error) // DeleteServer DeleteServer(ctx context.Context, serverID uuid.UUID) error // WriteEventHistory commits the final state of this Condition to FleetDB WriteEventHistory(ctx context.Context, cond *rctypes.Condition) error // FirmwareSetByID returns the firmware set matched by its identifier FirmwareSetByID(ctx context.Context, setID uuid.UUID) (*fleetdbapi.ComponentFirmwareSet, error) }
FleetDB handles traffics between conditionorc and fleet db. NOTE: when updating this interface, run make gen-store-mock to make sure the mocks are updated.
func NewFleetDBClient ¶
type MockFleetDB ¶
MockFleetDB is an autogenerated mock type for the FleetDB type
func NewMockFleetDB ¶
func NewMockFleetDB(t interface { mock.TestingT Cleanup(func()) }) *MockFleetDB
NewMockFleetDB creates a new instance of MockFleetDB. 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 (*MockFleetDB) AddServer ¶
func (_m *MockFleetDB) AddServer(ctx context.Context, serverID uuid.UUID, facilityCode string, bmcAddr string, bmcUser string, bmcPass string) (func() error, error)
AddServer provides a mock function with given fields: ctx, serverID, facilityCode, bmcAddr, bmcUser, bmcPass
func (*MockFleetDB) DeleteServer ¶ added in v1.0.1
DeleteServer provides a mock function with given fields: ctx, serverID
func (*MockFleetDB) EXPECT ¶
func (_m *MockFleetDB) EXPECT() *MockFleetDB_Expecter
func (*MockFleetDB) FirmwareSetByID ¶ added in v1.1.3
func (_m *MockFleetDB) FirmwareSetByID(ctx context.Context, setID uuid.UUID) (*fleetdbapi.ComponentFirmwareSet, error)
FirmwareSetByID provides a mock function with given fields: ctx, setID
func (*MockFleetDB) WriteEventHistory ¶ added in v1.0.9
WriteEventHistory provides a mock function with given fields: ctx, cond
type MockFleetDB_AddServer_Call ¶ added in v1.0.9
MockFleetDB_AddServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddServer'
func (*MockFleetDB_AddServer_Call) Return ¶ added in v1.0.9
func (_c *MockFleetDB_AddServer_Call) Return(_a0 func() error, _a1 error) *MockFleetDB_AddServer_Call
func (*MockFleetDB_AddServer_Call) Run ¶ added in v1.0.9
func (_c *MockFleetDB_AddServer_Call) Run(run func(ctx context.Context, serverID uuid.UUID, facilityCode string, bmcAddr string, bmcUser string, bmcPass string)) *MockFleetDB_AddServer_Call
func (*MockFleetDB_AddServer_Call) RunAndReturn ¶ added in v1.0.9
type MockFleetDB_DeleteServer_Call ¶ added in v1.0.9
MockFleetDB_DeleteServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServer'
func (*MockFleetDB_DeleteServer_Call) Return ¶ added in v1.0.9
func (_c *MockFleetDB_DeleteServer_Call) Return(_a0 error) *MockFleetDB_DeleteServer_Call
func (*MockFleetDB_DeleteServer_Call) Run ¶ added in v1.0.9
func (_c *MockFleetDB_DeleteServer_Call) Run(run func(ctx context.Context, serverID uuid.UUID)) *MockFleetDB_DeleteServer_Call
func (*MockFleetDB_DeleteServer_Call) RunAndReturn ¶ added in v1.0.9
func (_c *MockFleetDB_DeleteServer_Call) RunAndReturn(run func(context.Context, uuid.UUID) error) *MockFleetDB_DeleteServer_Call
type MockFleetDB_Expecter ¶ added in v1.0.9
type MockFleetDB_Expecter struct {
// contains filtered or unexported fields
}
func (*MockFleetDB_Expecter) AddServer ¶ added in v1.0.9
func (_e *MockFleetDB_Expecter) AddServer(ctx interface{}, serverID interface{}, facilityCode interface{}, bmcAddr interface{}, bmcUser interface{}, bmcPass interface{}) *MockFleetDB_AddServer_Call
AddServer is a helper method to define mock.On call
- ctx context.Context
- serverID uuid.UUID
- facilityCode string
- bmcAddr string
- bmcUser string
- bmcPass string
func (*MockFleetDB_Expecter) DeleteServer ¶ added in v1.0.9
func (_e *MockFleetDB_Expecter) DeleteServer(ctx interface{}, serverID interface{}) *MockFleetDB_DeleteServer_Call
DeleteServer is a helper method to define mock.On call
- ctx context.Context
- serverID uuid.UUID
func (*MockFleetDB_Expecter) FirmwareSetByID ¶ added in v1.1.3
func (_e *MockFleetDB_Expecter) FirmwareSetByID(ctx interface{}, setID interface{}) *MockFleetDB_FirmwareSetByID_Call
FirmwareSetByID is a helper method to define mock.On call
- ctx context.Context
- setID uuid.UUID
func (*MockFleetDB_Expecter) GetServer ¶ added in v1.0.9
func (_e *MockFleetDB_Expecter) GetServer(ctx interface{}, serverID interface{}) *MockFleetDB_GetServer_Call
GetServer is a helper method to define mock.On call
- ctx context.Context
- serverID uuid.UUID
func (*MockFleetDB_Expecter) WriteEventHistory ¶ added in v1.0.9
func (_e *MockFleetDB_Expecter) WriteEventHistory(ctx interface{}, cond interface{}) *MockFleetDB_WriteEventHistory_Call
WriteEventHistory is a helper method to define mock.On call
- ctx context.Context
- cond *condition.Condition
type MockFleetDB_FirmwareSetByID_Call ¶ added in v1.1.3
MockFleetDB_FirmwareSetByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FirmwareSetByID'
func (*MockFleetDB_FirmwareSetByID_Call) Return ¶ added in v1.1.3
func (_c *MockFleetDB_FirmwareSetByID_Call) Return(_a0 *fleetdbapi.ComponentFirmwareSet, _a1 error) *MockFleetDB_FirmwareSetByID_Call
func (*MockFleetDB_FirmwareSetByID_Call) Run ¶ added in v1.1.3
func (_c *MockFleetDB_FirmwareSetByID_Call) Run(run func(ctx context.Context, setID uuid.UUID)) *MockFleetDB_FirmwareSetByID_Call
func (*MockFleetDB_FirmwareSetByID_Call) RunAndReturn ¶ added in v1.1.3
func (_c *MockFleetDB_FirmwareSetByID_Call) RunAndReturn(run func(context.Context, uuid.UUID) (*fleetdbapi.ComponentFirmwareSet, error)) *MockFleetDB_FirmwareSetByID_Call
type MockFleetDB_GetServer_Call ¶ added in v1.0.9
MockFleetDB_GetServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetServer'
func (*MockFleetDB_GetServer_Call) Return ¶ added in v1.0.9
func (_c *MockFleetDB_GetServer_Call) Return(_a0 *model.Server, _a1 error) *MockFleetDB_GetServer_Call
func (*MockFleetDB_GetServer_Call) Run ¶ added in v1.0.9
func (_c *MockFleetDB_GetServer_Call) Run(run func(ctx context.Context, serverID uuid.UUID)) *MockFleetDB_GetServer_Call
func (*MockFleetDB_GetServer_Call) RunAndReturn ¶ added in v1.0.9
func (_c *MockFleetDB_GetServer_Call) RunAndReturn(run func(context.Context, uuid.UUID) (*model.Server, error)) *MockFleetDB_GetServer_Call
type MockFleetDB_WriteEventHistory_Call ¶ added in v1.0.9
MockFleetDB_WriteEventHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteEventHistory'
func (*MockFleetDB_WriteEventHistory_Call) Return ¶ added in v1.0.9
func (_c *MockFleetDB_WriteEventHistory_Call) Return(_a0 error) *MockFleetDB_WriteEventHistory_Call
func (*MockFleetDB_WriteEventHistory_Call) Run ¶ added in v1.0.9
func (_c *MockFleetDB_WriteEventHistory_Call) Run(run func(ctx context.Context, cond *condition.Condition)) *MockFleetDB_WriteEventHistory_Call
func (*MockFleetDB_WriteEventHistory_Call) RunAndReturn ¶ added in v1.0.9
func (_c *MockFleetDB_WriteEventHistory_Call) RunAndReturn(run func(context.Context, *condition.Condition) error) *MockFleetDB_WriteEventHistory_Call