project

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

////////////////////////////////////////////////////////////////////////////// //////// Maintains a list of projects visited by the user. /////////////////// //////// Author: drellem Date: 2022-10-15 /////////////////// //////////////////////////////////////////////////////////////////////////////

Index

Constants

This section is empty.

Variables

View Source
var ProjectFileName string

Functions

func Add

func Add(p *Project)

func AddAll

func AddAll(ps []Project)

func GetProject

func GetProject(id int) *search.IndexedProject

func IndexAll

func IndexAll()

IndexAll processes all loaded projects through plugins in the background. Call this after Init() and after the HTTP server is listening.

func Init

func Init()

func NotifyProjectAdded

func NotifyProjectAdded(projectPath string)

NotifyProjectAdded tells the scanner to watch the parent of a newly added project.

func Remove added in v0.1.1

func Remove(path string) bool

Remove removes a project by path and persists the change. Returns true if the project was found and removed.

func RemoveSaveFile

func RemoveSaveFile()

func SaveProjects

func SaveProjects()

func StartScanner

func StartScanner() error

StartScanner creates and starts the background repo scanner. Call after Init() so existing projects seed the watch list.

func StopScanner

func StopScanner()

StopScanner shuts down the background scanner.

func Visit

If the path is within an existing project, returns the project. Otherwise traverses parent directories and creates a project if one is found.

Types

type ErrorResponse

type ErrorResponse struct {
	Code    int
	Message string `json:"errorString"`
}

type Project

type Project struct {
	Id   int    `json:"id"`
	Path string `json:"path"`
}

func GetProjectByPath

func GetProjectByPath(path string) *Project

func Projects

func Projects() []Project

type ProjectStatusResponse

type ProjectStatusResponse struct {
	Id        int                   `json:"id"`
	Path      string                `json:"path"`
	Status    search.IndexingStatus `json:"indexing_status"`
	FileCount int                   `json:"file_count"`
}

func GetProjectStatuses

func GetProjectStatuses() []ProjectStatusResponse

type ProjectsSave

type ProjectsSave struct {
	Projects []Project `json:"projects"`
}

type Scanner

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

Scanner watches parent directories of known projects for new sibling repos. When a project at ~/src/foo is registered, Scanner watches ~/src/. If ~/src/bar appears with a .git directory, it gets auto-registered.

type VisitRequest

type VisitRequest struct {
	Path string `json:"path"`
}

type VisitResponse

type VisitResponse struct {
	ParentProject Project `json:"project"`
}

Jump to

Keyboard shortcuts

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