// Code generated by ndpgen. DO NOT EDIT. // // This file contains mock implementations for non-WASM builds. // These mocks allow IDE support, compilation, and unit testing on non-WASM platforms. // Plugin authors can use the exported mock instances to set expectations in tests. // //go:build !wasip1 package host import "github.com/stretchr/testify/mock" // mockSchedulerService is the mock implementation for testing. type mockSchedulerService struct { mock.Mock } // SchedulerMock is the auto-instantiated mock instance for testing. // Use this to set expectations: host.SchedulerMock.On("MethodName", args...).Return(values...) var SchedulerMock = &mockSchedulerService{} // ScheduleOneTime is the mock method for SchedulerScheduleOneTime. func (m *mockSchedulerService) ScheduleOneTime(delaySeconds int32, payload string, scheduleID string) (string, error) { args := m.Called(delaySeconds, payload, scheduleID) return args.String(0), args.Error(1) } // SchedulerScheduleOneTime delegates to the mock instance. // ScheduleOneTime schedules a one-time event to be triggered after the specified delay. // Plugins that use this function must also implement the SchedulerCallback capability // // Parameters: // - delaySeconds: Number of seconds to wait before triggering the event // - payload: Data to be passed to the scheduled event handler // - scheduleID: Optional unique identifier for the scheduled job. If empty, one will be generated // // Returns the schedule ID that can be used to cancel the job, or an error if scheduling fails. func SchedulerScheduleOneTime(delaySeconds int32, payload string, scheduleID string) (string, error) { return SchedulerMock.ScheduleOneTime(delaySeconds, payload, scheduleID) } // ScheduleRecurring is the mock method for SchedulerScheduleRecurring. func (m *mockSchedulerService) ScheduleRecurring(cronExpression string, payload string, scheduleID string) (string, error) { args := m.Called(cronExpression, payload, scheduleID) return args.String(0), args.Error(1) } // SchedulerScheduleRecurring delegates to the mock instance. // ScheduleRecurring schedules a recurring event using a cron expression. // Plugins that use this function must also implement the SchedulerCallback capability // // Parameters: // - cronExpression: Standard cron format expression (e.g., "0 0 * * *" for daily at midnight) // - payload: Data to be passed to each scheduled event handler invocation // - scheduleID: Optional unique identifier for the scheduled job. If empty, one will be generated // // Returns the schedule ID that can be used to cancel the job, or an error if scheduling fails. func SchedulerScheduleRecurring(cronExpression string, payload string, scheduleID string) (string, error) { return SchedulerMock.ScheduleRecurring(cronExpression, payload, scheduleID) } // CancelSchedule is the mock method for SchedulerCancelSchedule. func (m *mockSchedulerService) CancelSchedule(scheduleID string) error { args := m.Called(scheduleID) return args.Error(0) } // SchedulerCancelSchedule delegates to the mock instance. // CancelSchedule cancels a scheduled job identified by its schedule ID. // // This works for both one-time and recurring schedules. Once cancelled, the job will not trigger // any future events. // // Returns an error if the schedule ID is not found or if cancellation fails. func SchedulerCancelSchedule(scheduleID string) error { return SchedulerMock.CancelSchedule(scheduleID) }