localprojects

package
v0.140.0 Latest Latest
Warning

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

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

Documentation

Overview

Package localprojects manages projects inside an operator-selected creation root. HTTP callers supply project identities, never filesystem locations.

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = errors.New("local project operation conflicts with an existing project or operation")
View Source
var ErrInvalid = errors.New("invalid local project request")
View Source
var ErrRootRequired = errors.New("start the agent with --projects-root and --allow-writes to create local projects")

Functions

func ReadArchivedFromRoot added in v0.137.0

func ReadArchivedFromRoot(root *os.Root) (bool, error)

ReadArchivedFromRoot reads only the opened project's parent lifecycle flag. It conveys no owner inventory or read/write authority. Supported absence uses the same active default as readState; malformed/unreadable state is an error.

Types

type Archive

type Archive struct {
	Storage     string `json:"storage"`
	Project     string `json:"project"`
	Archived    bool   `json:"archived"`
	OperationID string `json:"operationId"`
}

type ArchiveResult

type ArchiveResult struct {
	OperationID string  `json:"operationId"`
	Project     Project `json:"project"`
}

type Create

type Create struct {
	Store       string `json:"store"`
	ID          string `json:"id"`
	Title       string `json:"title"`
	OperationID string `json:"operationId"`
}

type Project

type Project struct {
	datatug.ProjectSummary
	Archived bool `json:"archived"`
}

func (Project) MarshalJSON

func (p Project) MarshalJSON() ([]byte, error)

func (*Project) UnmarshalJSON

func (p *Project) UnmarshalJSON(body []byte) error

type Registry

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

func Open

func Open(root string, configured map[string]string) (*Registry, error)

Open loads only exact configured projects and immediate child projects of the operator-approved root. It does not modify user-wide CLI configuration.

func (*Registry) CanCreate

func (r *Registry) CanCreate() bool

func (*Registry) Create

func (r *Registry) Create(ctx context.Context, request Create, authorize ...func() error) (Project, error)

func (*Registry) List

func (r *Registry) List() ([]Project, error)

func (*Registry) Paths

func (r *Registry) Paths() map[string]string

func (*Registry) SetArchived

func (r *Registry) SetArchived(ctx context.Context, request Archive, authorize ...func() error) (ArchiveResult, error)

Jump to

Keyboard shortcuts

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