testutil

package
v0.1.61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockScheduler

type MockScheduler struct {
	mock.Mock
}

MockScheduler implements the scheduler.Scheduler / orchestrator.Scheduler interface for testing.

func (*MockScheduler) AddTask

func (m *MockScheduler) AddTask(ctx context.Context, task *db.ScheduledTask) (int64, error)

func (*MockScheduler) EditTask

func (m *MockScheduler) EditTask(ctx context.Context, taskID int64, schedule, taskType, prompt *string, autoDeleteSec *int) error

func (*MockScheduler) GetTask added in v0.1.59

func (m *MockScheduler) GetTask(ctx context.Context, taskID int64) (*db.ScheduledTask, error)

func (*MockScheduler) ListTasks

func (m *MockScheduler) ListTasks(ctx context.Context, channelID string) ([]*db.ScheduledTask, error)

func (*MockScheduler) RemoveTask

func (m *MockScheduler) RemoveTask(ctx context.Context, taskID int64) error

func (*MockScheduler) SetTaskEnabled

func (m *MockScheduler) SetTaskEnabled(ctx context.Context, taskID int64, enabled bool) error

func (*MockScheduler) Start

func (m *MockScheduler) Start(ctx context.Context) error

func (*MockScheduler) Stop

func (m *MockScheduler) Stop() error

func (*MockScheduler) ToggleTask

func (m *MockScheduler) ToggleTask(ctx context.Context, taskID int64) (bool, error)

type MockStore

type MockStore struct {
	mock.Mock
}

MockStore implements the db.Store interface for testing.

func (*MockStore) Close

func (m *MockStore) Close() error

func (*MockStore) CreateScheduledTask

func (m *MockStore) CreateScheduledTask(ctx context.Context, task *db.ScheduledTask) (int64, error)

func (*MockStore) DeleteChannel

func (m *MockStore) DeleteChannel(ctx context.Context, channelID string) error

func (*MockStore) DeleteChannelsByParentID

func (m *MockStore) DeleteChannelsByParentID(ctx context.Context, parentID string) error

func (*MockStore) DeleteMemoryFile

func (m *MockStore) DeleteMemoryFile(ctx context.Context, filePath, dirPath string) error

func (*MockStore) DeleteScheduledTask

func (m *MockStore) DeleteScheduledTask(ctx context.Context, id int64) error

func (*MockStore) GetChannel

func (m *MockStore) GetChannel(ctx context.Context, channelID string) (*db.Channel, error)

func (*MockStore) GetChannelByDirPath

func (m *MockStore) GetChannelByDirPath(ctx context.Context, dirPath string, platform types.Platform) (*db.Channel, error)

func (*MockStore) GetDueTasks

func (m *MockStore) GetDueTasks(ctx context.Context, now time.Time) ([]*db.ScheduledTask, error)

func (*MockStore) GetMemoryFileHash

func (m *MockStore) GetMemoryFileHash(ctx context.Context, filePath, dirPath string) (string, error)

func (*MockStore) GetMemoryFilesByDirPath

func (m *MockStore) GetMemoryFilesByDirPath(ctx context.Context, dirPath string) ([]*db.MemoryFile, error)

func (*MockStore) GetRecentMessages

func (m *MockStore) GetRecentMessages(ctx context.Context, channelID string, limit int) ([]*db.Message, error)

func (*MockStore) GetScheduledTask

func (m *MockStore) GetScheduledTask(ctx context.Context, id int64) (*db.ScheduledTask, error)

func (*MockStore) GetScheduledTaskByTemplateName

func (m *MockStore) GetScheduledTaskByTemplateName(ctx context.Context, channelID, templateName string) (*db.ScheduledTask, error)

func (*MockStore) InsertMessage

func (m *MockStore) InsertMessage(ctx context.Context, msg *db.Message) error

func (*MockStore) InsertTaskRunLog

func (m *MockStore) InsertTaskRunLog(ctx context.Context, trl *db.TaskRunLog) (int64, error)

func (*MockStore) IsChannelActive

func (m *MockStore) IsChannelActive(ctx context.Context, channelID string) (bool, error)

func (*MockStore) ListChannels

func (m *MockStore) ListChannels(ctx context.Context) ([]*db.Channel, error)

func (*MockStore) ListScheduledTasks

func (m *MockStore) ListScheduledTasks(ctx context.Context, channelID string) ([]*db.ScheduledTask, error)

func (*MockStore) MarkMessagesProcessed

func (m *MockStore) MarkMessagesProcessed(ctx context.Context, ids []int64) error

func (*MockStore) UpdateChannelPermissions

func (m *MockStore) UpdateChannelPermissions(ctx context.Context, channelID string, perms types.Permissions) error

func (*MockStore) UpdateScheduledTask

func (m *MockStore) UpdateScheduledTask(ctx context.Context, task *db.ScheduledTask) error

func (*MockStore) UpdateScheduledTaskEnabled

func (m *MockStore) UpdateScheduledTaskEnabled(ctx context.Context, id int64, enabled bool) error

func (*MockStore) UpdateSessionID

func (m *MockStore) UpdateSessionID(ctx context.Context, channelID string, sessionID string) error

func (*MockStore) UpdateTaskRunLog

func (m *MockStore) UpdateTaskRunLog(ctx context.Context, trl *db.TaskRunLog) error

func (*MockStore) UpsertChannel

func (m *MockStore) UpsertChannel(ctx context.Context, ch *db.Channel) error

func (*MockStore) UpsertMemoryFile

func (m *MockStore) UpsertMemoryFile(ctx context.Context, file *db.MemoryFile) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL