authoringop

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package authoringop owns semantic part resolution, complete candidate validation, confined source publication, and ordinary leased synchronization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePart

func ResolvePart(state *project.Session, cfg *config.Config, kind, name, part string) (project.AuthoringTarget, error)

ResolvePart delegates semantic kind, catalog/configured name, and capability resolution to the project and configuration authorities.

func ResolveSidecar

func ResolveSidecar(state *project.Session, cfg *config.Config, kind, name, field string) (project.AuthoringTarget, error)

Types

type LeaseAcquirer

type LeaseAcquirer func(context.Context, string) (*filesystem.Lease, func() error, error)

LeaseAcquirer is the narrow mechanism seam used by focused lease tests.

type Mode

type Mode string

Mode is one closed part-authoring operation.

const (
	Edit  Mode = "edit"
	Reset Mode = "reset"
)

type Outcome

type Outcome struct {
	Kind, Name, Part string
	SourcePath       string
	Source           SourceEffect
	CreatedParents   []string
	Publisher        publisher.Result
}

Outcome retains visible source and publication facts even when Run returns an error.

func Run

func Run(ctx context.Context, root string, request Request, loader *project.Loader, acquire LeaseAcquirer) (outcome Outcome, returnErr error)

Run validates and applies one authored source change while holding the complete project lease from the first mutable authority read through sync.

func (Outcome) Document

func (o Outcome) Document() (presentation.Document, error)

Document maps the observed semantic result to the common presentation tree.

type Request

type Request struct {
	Mode             Mode
	Kind, Name, Part string
	Content          []byte
	Sidecar          bool
	SidecarMode      string
	Value            any
}

Request identifies one semantic part. Content is meaningful only for Edit; its empty value is a valid explicit authored override.

type SourceEffect

type SourceEffect string

SourceEffect identifies the authored source effect that committed.

const (
	SourceNone      SourceEffect = "none"
	SourceCreated   SourceEffect = "created"
	SourceReplaced  SourceEffect = "replaced"
	SourceRemoved   SourceEffect = "removed"
	SourceLocalBody SourceEffect = "local-body-replaced"
)

Jump to

Keyboard shortcuts

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