repository

package
v0.0.0-...-4402e7d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Execute(task *entity.Task) error
}

Executor represents an executor to run tasks

type Filesystemer

type Filesystemer interface {
	// MkdirAll creates a directory
	MkdirAll(path string, perm os.FileMode) error
	// RemoveAll removes a directory
	RemoveAll(path string) error
	// Stat returns the file information
	Stat(path string) (os.FileInfo, error)
	// TempDir creates a temporary directory
	TempDir(dir, prefix string) (name string, err error)
}

Filesystemer interface to manage a filesystem

type Logger

type Logger interface {
	Info(msg string, fields ...interface{})
	Error(msg string, fields ...interface{})
	Debug(msg string, fields ...interface{})
	Warn(msg string, fields ...interface{})
}

Logger represents a logger

type MockBuilder

type MockBuilder struct {
	Workspace *MockWorkspace
}

MockBuilder represents a mock builder

func (*MockBuilder) Build

func (m *MockBuilder) Build() service.Workspacer

Build creates a new mock workspace

func (*MockBuilder) WithTask

func (m *MockBuilder) WithTask(task *entity.Task) service.WorkspaceBuilder

WithTask sets the task of the mock builder

type MockFilesystemer

type MockFilesystemer struct {
	mock.Mock
}

MockFilesystemer represents a mock filesystemer

func NewMockFilesystemer

func NewMockFilesystemer() *MockFilesystemer

NewMockFilesystemer creates a new mock filesystemer

func (*MockFilesystemer) MkdirAll

func (m *MockFilesystemer) MkdirAll(path string, perm os.FileMode) error

MkdirAll creates a directory

func (*MockFilesystemer) RemoveAll

func (m *MockFilesystemer) RemoveAll(path string) error

RemoveAll removes a directory

func (*MockFilesystemer) Stat

func (m *MockFilesystemer) Stat(path string) (os.FileInfo, error)

Stat returns the file information

func (*MockFilesystemer) TempDir

func (m *MockFilesystemer) TempDir(dir, prefix string) (string, error)

TempDir creates a temporary directory

type MockProjectRepository

type MockProjectRepository struct {
	mock.Mock
}

MockProjectRepository represents a mock object of the project repository

func NewMockProjectRepository

func NewMockProjectRepository() *MockProjectRepository

NewMockProjectRepository creates a new mock project repository

func (*MockProjectRepository) Find

Find mock method to find a project by ID

func (*MockProjectRepository) FindAll

func (m *MockProjectRepository) FindAll() ([]*entity.Project, error)

FindAll mock method to find all projects

type MockProjectSourceCodeFetchFactory

type MockProjectSourceCodeFetchFactory struct {
	mock.Mock
}

MockProjectSourceCodeFetchFactory is a mock type for the SourceCodeFetchFactory

func (*MockProjectSourceCodeFetchFactory) Get

Get provides a mock function with given fields: projectType

type MockProjectSourceCodeFetcher

type MockProjectSourceCodeFetcher struct {
	mock.Mock
}

MockProjectSourceCodeFetcher is a mock type for the SourceCodeFetcher

func (*MockProjectSourceCodeFetcher) Fetch

func (m *MockProjectSourceCodeFetcher) Fetch(project *entity.Project, destination string) error

Fetch provides a mock function with given fields: project, destination

type MockProjectSourceCodeUnpackFactory

type MockProjectSourceCodeUnpackFactory struct {
	mock.Mock
}

MockProjectSourceCodeUnpackFactory is a mock type for the SouceCodeUnpackFactory

func (*MockProjectSourceCodeUnpackFactory) Get

Get provides a mock function with given fields: projectType

type MockProjectSourceCodeUnpacker

type MockProjectSourceCodeUnpacker struct {
	mock.Mock
}

MockProjectSourceCodeUnpacker is a mock type for the SourceCodeUnpacker

func (*MockProjectSourceCodeUnpacker) Unpack

func (m *MockProjectSourceCodeUnpacker) Unpack(project *entity.Project, destination string) error

Unpack provides a mock function with given fields: project, destination

type MockProjectUnpacker

type MockProjectUnpacker struct {
	mock.Mock
}

MockProjectUnpacker is a mock type for the Unpacker

func (*MockProjectUnpacker) Unpack

func (m *MockProjectUnpacker) Unpack(project *entity.Project, workingDir string) error

Unpack provides a mock function with given fields: project, workingDir

type MockTaskExecutor

type MockTaskExecutor struct {
	mock.Mock
}

MockTaskExecutor struct for mocking executor

func NewMockTaskExecutor

func NewMockTaskExecutor() *MockTaskExecutor

NewMockTaskExecutor returns a new MockTaskExecutor

func (*MockTaskExecutor) Execute

func (m *MockTaskExecutor) Execute(task *entity.Task) error

Execute mocks the Execute method

type MockTaskRepository

type MockTaskRepository struct {
	mock.Mock
}

MockTaskRepository struct for mocking task repository

func NewMockTaskRepository

func NewMockTaskRepository() *MockTaskRepository

NewMockTaskRepository returns a new MockTaskRepository

func (*MockTaskRepository) Find

func (m *MockTaskRepository) Find(id string) (*entity.Task, error)

Find mocks the Find method

func (*MockTaskRepository) FindAll

func (m *MockTaskRepository) FindAll() ([]*entity.Task, error)

FindAll mocks the FindAll method

func (*MockTaskRepository) Remove

func (m *MockTaskRepository) Remove(id string) error

Remove mocks the Remove method

func (*MockTaskRepository) SafeStore

func (m *MockTaskRepository) SafeStore(id string, task *entity.Task) error

SafeStore mocks the SafeStore method

func (*MockTaskRepository) Store

func (m *MockTaskRepository) Store(id string, task *entity.Task) error

Store mocks the Store method

func (*MockTaskRepository) Update

func (m *MockTaskRepository) Update(id string, task *entity.Task) error

Update mocks the Update method

type MockWorkspace

type MockWorkspace struct {
	mock.Mock
}

MockWorkspace represents a mock workspace

func (*MockWorkspace) Cleanup

func (m *MockWorkspace) Cleanup() error

Cleanup cleans up the mock workspace

func (*MockWorkspace) GetWorkingDir

func (m *MockWorkspace) GetWorkingDir() (string, error)

GetWorkingDir gets the working directory of the mock workspace

func (*MockWorkspace) Prepare

func (m *MockWorkspace) Prepare() error

Prepare prepares the mock workspace

type ProjectRepository

type ProjectRepository interface {
	Find(id string) (*entity.Project, error)
	FindAll() ([]*entity.Project, error)
}

ProjectRepository represents a repository to manage projects

type SourceCodeFetchFactory

type SourceCodeFetchFactory interface {
	Get(projectType string) SourceCodeFetcher
}

SourceCodeFetchFactory represents the component to create a SourceCodeFetcher

type SourceCodeFetcher

type SourceCodeFetcher interface {
	Fetch(project *entity.Project, destination string) error
}

SourceCodeFetcher represents the component to fetch a project from a repository

type SourceCodeUnpackFactory

type SourceCodeUnpackFactory interface {
	Get(projectType string) SourceCodeUnpacker
}

SourceCodeUnpackFactory represents the component to create a SourceCodeUnpacker

type SourceCodeUnpacker

type SourceCodeUnpacker interface {
	Unpack(project *entity.Project, destination string) error
}

SourceCodeUnpacker represents the component to unpack a project

type TaskRepository

type TaskRepository interface {
	Find(id string) (*entity.Task, error)
	FindAll() ([]*entity.Task, error)
	Remove(id string) error
	SafeStore(id string, task *entity.Task) error
	Store(id string, task *entity.Task) error
	Update(id string, task *entity.Task) error
}

TaskRepository represents a repository to manage tasks

type Unpacker

type Unpacker interface {
	Unpack(project *entity.Project, workingDir string) error
}

Unpacker represents the component to archive and unarchive projects before executing tasks

type Workspacer

type Workspacer interface {
	// Prepare prepares the workspace
	Prepare() error
	// GetWorkingDir returns the working directory
	GetWorkingDir() (string, error)
	// Cleanup cleans up the workspace
	Cleanup() error
}

Workspacer interface to manage a workspace

Jump to

Keyboard shortcuts

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