Documentation
¶
Index ¶
- func ComputeSHA256(data []byte) string
- type ExecCall
- type MockCronJob
- type MockCronScheduler
- func (m *MockCronScheduler) AddFunc(spec string, cmd func()) (cron.EntryID, error)
- func (m *MockCronScheduler) Entries() []cron.Entry
- func (m *MockCronScheduler) GetJob(id cron.EntryID) *MockCronJob
- func (m *MockCronScheduler) GetJobBySpec(spec string) *MockCronJob
- func (m *MockCronScheduler) Remove(id cron.EntryID)
- func (m *MockCronScheduler) Reset()
- func (m *MockCronScheduler) Start()
- func (m *MockCronScheduler) Stop()
- func (m *MockCronScheduler) TriggerJob(id cron.EntryID)
- type MockHTTPServer
- type MockPaperAPI
- type MockPluginClient
- type MockPodExecutor
- type MockRegistryAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeSHA256 ¶
ComputeSHA256 computes the SHA256 hash of data.
Types ¶
type MockCronJob ¶
MockCronJob represents a cron job in the mock.
type MockCronScheduler ¶
type MockCronScheduler struct {
// Track added jobs
Jobs map[cron.EntryID]*MockCronJob
// Control behavior
AddFuncError error
Started bool
// contains filtered or unexported fields
}
MockCronScheduler is a mock cron scheduler for testing.
func NewMockCronScheduler ¶
func NewMockCronScheduler() *MockCronScheduler
NewMockCronScheduler creates a new mock cron scheduler.
func (*MockCronScheduler) AddFunc ¶
func (m *MockCronScheduler) AddFunc(spec string, cmd func()) (cron.EntryID, error)
AddFunc adds a cron job to the mock.
func (*MockCronScheduler) Entries ¶
func (m *MockCronScheduler) Entries() []cron.Entry
Entries returns all cron entries (mock implementation).
func (*MockCronScheduler) GetJob ¶
func (m *MockCronScheduler) GetJob(id cron.EntryID) *MockCronJob
GetJob returns a cron job by ID (for testing).
func (*MockCronScheduler) GetJobBySpec ¶
func (m *MockCronScheduler) GetJobBySpec(spec string) *MockCronJob
GetJobBySpec returns the first cron job matching the spec (for testing).
func (*MockCronScheduler) Remove ¶
func (m *MockCronScheduler) Remove(id cron.EntryID)
Remove removes a cron job from the mock.
func (*MockCronScheduler) Start ¶
func (m *MockCronScheduler) Start()
Start marks the scheduler as started.
func (*MockCronScheduler) Stop ¶
func (m *MockCronScheduler) Stop()
Stop marks the scheduler as stopped.
func (*MockCronScheduler) TriggerJob ¶
func (m *MockCronScheduler) TriggerJob(id cron.EntryID)
TriggerJob manually triggers a cron job by ID (for testing).
type MockHTTPServer ¶
type MockHTTPServer struct {
Server *httptest.Server
// Track download requests
Downloads []string
// Control behavior
FailOnPath map[string]bool
FileData map[string][]byte
// contains filtered or unexported fields
}
MockHTTPServer is a test HTTP server for simulating JAR downloads.
func NewMockHTTPServer ¶
func NewMockHTTPServer() *MockHTTPServer
NewMockHTTPServer creates a new mock HTTP server.
func (*MockHTTPServer) AddFile ¶
func (m *MockHTTPServer) AddFile(path string, data []byte)
AddFile adds a file to be served at the given path.
func (*MockHTTPServer) GetDownloads ¶
func (m *MockHTTPServer) GetDownloads() []string
GetDownloads returns a copy of recorded download paths.
func (*MockHTTPServer) SetFailOnPath ¶
func (m *MockHTTPServer) SetFailOnPath(path string, fail bool)
SetFailOnPath makes the server return an error for the given path.
func (*MockHTTPServer) URL ¶
func (m *MockHTTPServer) URL() string
URL returns the base URL of the mock server.
type MockPaperAPI ¶ added in v1.0.0
type MockPaperAPI struct {
// Configurable responses
Versions []string
VersionsErr error
BuildInfo *paper.BuildInfo
BuildInfoErr error
BuildNumbers []int
BuildsErr error
// Track calls
GetVersionsCalls int
GetBuildCalls []string
GetBuildsCalls []string
// contains filtered or unexported fields
}
MockPaperAPI is a mock implementation of controller.PaperAPI for testing.
func (*MockPaperAPI) GetBuilds ¶ added in v1.0.0
GetBuilds returns the configured build numbers or error.
func (*MockPaperAPI) GetPaperBuild ¶ added in v1.0.0
GetPaperBuild returns the configured build info or error.
func (*MockPaperAPI) GetPaperVersions ¶ added in v1.0.0
func (m *MockPaperAPI) GetPaperVersions(_ context.Context) ([]string, error)
GetPaperVersions returns the configured versions or error.
type MockPluginClient ¶ added in v1.0.0
type MockPluginClient struct {
// Responses
Versions []plugins.PluginVersion
VersionErr error
CompatInfo plugins.CompatibilityInfo
CompatErr error
// Call tracking
GetVersionsCalls int
GetVersionsProjects []string
GetCompatCalls int
GetCompatProjects []string
GetCompatVersions []string
// contains filtered or unexported fields
}
MockPluginClient implements plugins.PluginClient for controller testing.
func (*MockPluginClient) GetCompatibility ¶ added in v1.0.0
func (m *MockPluginClient) GetCompatibility( ctx context.Context, project, version string, ) (plugins.CompatibilityInfo, error)
GetCompatibility returns configured compatibility info or error.
func (*MockPluginClient) GetVersions ¶ added in v1.0.0
func (m *MockPluginClient) GetVersions(ctx context.Context, project string) ([]plugins.PluginVersion, error)
GetVersions returns configured versions or error.
type MockPodExecutor ¶ added in v1.0.0
type MockPodExecutor struct {
Calls []ExecCall
Output []byte
Err error
// contains filtered or unexported fields
}
MockPodExecutor records calls and returns configurable responses.
type MockRegistryAPI ¶ added in v1.0.0
type MockRegistryAPI struct {
// Configurable responses
Tags []string
TagsErr error
ImageExist bool
ImageErr error
// Per-tag existence for fine-grained control
TagExists map[string]bool
// Track calls
ListTagsCalls int
ImageExistCalls []string
// contains filtered or unexported fields
}
MockRegistryAPI is a mock implementation of controller.RegistryAPI for testing.
func (*MockRegistryAPI) ImageExists ¶ added in v1.0.0
ImageExists returns the configured existence or error.