project

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDiagnosticsDelay = time.Second * 1

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateProjectRequest

type CreateProjectRequest struct {
	Repository   Repository           `json:"repository"`
	DevContainer *devcontainer.Config `json:"devcontainer,omitempty"`
}

type InMemoryStore

type InMemoryStore struct {
	// contains filtered or unexported fields
}

func NewInMemoryStore

func NewInMemoryStore(store map[string]*model.Project) *InMemoryStore

func (*InMemoryStore) CreateProject

func (s *InMemoryStore) CreateProject(project *model.Project) error

func (*InMemoryStore) DeleteProject

func (s *InMemoryStore) DeleteProject(id string) error

func (*InMemoryStore) GetProject

func (s *InMemoryStore) GetProject(id string) (*model.Project, error)

func (*InMemoryStore) GetProjects

func (s *InMemoryStore) GetProjects() ([]*model.Project, error)

func (*InMemoryStore) UpdateProject

func (s *InMemoryStore) UpdateProject(project *model.Project) error

type Manager

type Manager interface {
	ApplyPatch(ctx context.Context, projectId, path, patch string) (*model.File, error)
	Cleanup(ctx context.Context) error
	CreateFile(ctx context.Context, projectId, path, content string) (*model.File, error)
	CreateProject(ctx context.Context, request CreateProjectRequest) <-chan result.Result[model.Project]
	CreateTask(ctx context.Context, projectId model.ProjectId, command string) (TaskResult, error)
	DeleteFile(ctx context.Context, projectId, path string) error
	DeleteProject(ctx context.Context, projectId model.ProjectId) <-chan result.Empty
	GetProject(ctx context.Context, projectId model.ProjectId) (model.Project, error)
	GetProjects(ctx context.Context) ([]*model.Project, error)
	ListFiles(ctx context.Context, projectId string, opts ...files.ListFileOption) ([]*model.File, error)
	ReadFile(ctx context.Context, projectId, path string) (*model.File, error)
	ResolveTaskAlias(ctx context.Context, projectId model.ProjectId, alias string) (devcontainer.Task, error)
	SearchSymbols(ctx context.Context, projectId model.ProjectId, query string, symbolFilter lsp.SymbolFilter) ([]lsp.SymbolInfo, error)
	UpdateFile(ctx context.Context, projectId, path, content string) (*model.File, error)
	UpdateLines(ctx context.Context, projectId, path string, lineDiff files.LineDiffChunk) (*model.File, error)
}

func NewProjectManager

func NewProjectManager(
	devContainerRunner devcontainer.Runner,
	projectStore Store,
	projectsRoot string,
	fileManager files.FileManager,
	lspService lsp.Service,
	languageDetector lsp.LanguageDetector,
	randomString func(int) string,
) Manager

type ManagerImpl

type ManagerImpl struct {
	// contains filtered or unexported fields
}

func (ManagerImpl) ApplyPatch added in v0.3.0

func (pm ManagerImpl) ApplyPatch(ctx context.Context, projectId, path, patch string) (*model.File, error)

func (ManagerImpl) Cleanup

func (pm ManagerImpl) Cleanup(ctx context.Context) error

func (ManagerImpl) CreateFile added in v0.3.0

func (pm ManagerImpl) CreateFile(ctx context.Context, projectId, path, content string) (*model.File, error)

func (ManagerImpl) CreateProject

func (pm ManagerImpl) CreateProject(ctx context.Context, request CreateProjectRequest) <-chan result.Result[model.Project]

func (ManagerImpl) CreateTask

func (pm ManagerImpl) CreateTask(ctx context.Context, projectId string, command string) (TaskResult, error)

func (ManagerImpl) DeleteFile added in v0.3.0

func (pm ManagerImpl) DeleteFile(ctx context.Context, projectId, path string) error

func (ManagerImpl) DeleteProject

func (pm ManagerImpl) DeleteProject(ctx context.Context, projectId string) <-chan result.Empty

func (ManagerImpl) GetProject

func (pm ManagerImpl) GetProject(ctx context.Context, projectId string) (model.Project, error)

func (ManagerImpl) GetProjects

func (pm ManagerImpl) GetProjects(ctx context.Context) ([]*model.Project, error)

func (ManagerImpl) ListFiles added in v0.3.0

func (pm ManagerImpl) ListFiles(ctx context.Context, projectId string, opts ...files.ListFileOption) ([]*model.File, error)

func (ManagerImpl) ReadFile added in v0.3.0

func (pm ManagerImpl) ReadFile(ctx context.Context, projectId, path string) (*model.File, error)

func (ManagerImpl) ResolveTaskAlias

func (pm ManagerImpl) ResolveTaskAlias(ctx context.Context, projectId string, alias string) (devcontainer.Task, error)

func (ManagerImpl) SearchSymbols added in v0.4.0

func (pm ManagerImpl) SearchSymbols(ctx context.Context, projectId model.ProjectId, query string, symbolFilter lsp.SymbolFilter) ([]lsp.SymbolInfo, error)

func (ManagerImpl) UpdateFile added in v0.3.0

func (pm ManagerImpl) UpdateFile(ctx context.Context, projectId, path, content string) (*model.File, error)

func (ManagerImpl) UpdateLines added in v0.3.0

func (pm ManagerImpl) UpdateLines(ctx context.Context, projectId, path string, lineDiff files.LineDiffChunk) (*model.File, error)

type ProjectAlreadyExistsError added in v0.3.0

type ProjectAlreadyExistsError struct {
	// contains filtered or unexported fields
}

func NewProjectAlreadyExistsError added in v0.3.0

func NewProjectAlreadyExistsError(projectId string) *ProjectAlreadyExistsError

func (ProjectAlreadyExistsError) Error added in v0.3.0

type ProjectNotFoundError added in v0.3.0

type ProjectNotFoundError struct {
	// contains filtered or unexported fields
}

func NewProjectNotFoundError added in v0.3.0

func NewProjectNotFoundError(projectId string) *ProjectNotFoundError

func (ProjectNotFoundError) Error added in v0.3.0

func (e ProjectNotFoundError) Error() string

type Repository

type Repository struct {
	Url    string  `json:"url"`
	Commit *string `json:"commit,omitempty"`
}

type Store

type Store interface {
	GetProject(id string) (*model.Project, error)
	GetProjects() ([]*model.Project, error)
	CreateProject(project *model.Project) error
	UpdateProject(project *model.Project) error
	DeleteProject(id string) error
}

type TaskResult

type TaskResult struct {
	StdOut   string `json:"stdout"`
	StdErr   string `json:"stderr"`
	ExitCode int    `json:"exitCode"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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