project

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 16 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" validate:"required"`
	DevContainer *devcontainer.Config `json:"devcontainer,omitempty"`
	Languages    []lsp.LanguageId     `json:"languages,omitempty" validate:"dive,oneof=Go JavaScript Python TypeScript"`
}

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) (*model.Project, error)
	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) error
	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.Files, 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)
	DocumentOutline(ctx context.Context, projectId, path string) (lsp.DocumentOutline, 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,
	git git.Client,
) Manager

type ManagerImpl

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

func (ManagerImpl) ApplyPatch

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

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) (*model.Project, error)

func (ManagerImpl) CreateTask

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

func (ManagerImpl) DeleteFile

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

func (ManagerImpl) DeleteProject

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

func (ManagerImpl) DocumentOutline added in v0.5.0

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

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

func (pm ManagerImpl) ListFiles(ctx context.Context, projectId string, opts ...files.ListFileOption) (model.Files, error)

func (ManagerImpl) ReadFile

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

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

func (ManagerImpl) UpdateFile

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

func (ManagerImpl) UpdateLines

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

type ProjectAlreadyExistsError

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

func NewProjectAlreadyExistsError

func NewProjectAlreadyExistsError(projectId string) *ProjectAlreadyExistsError

func (ProjectAlreadyExistsError) Error

type ProjectNotFoundError

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

func NewProjectNotFoundError

func NewProjectNotFoundError(projectId string) *ProjectNotFoundError

func (ProjectNotFoundError) Error

func (e ProjectNotFoundError) Error() string

type Repository

type Repository struct {
	Url    string  `json:"url" validate:"required,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