lifecycle

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package lifecycle moves a document through its statuses and rewrites the file. Nothing here prompts, prints or commits.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendRationale

func AppendRationale(source []byte) []byte

AppendRationale adds the rejection rationale section to a document, as rejecting one does. `archdoc new --status=rejected` creates a document that is already rejected, so it needs the same section and the same prompt in it; this is exported so that there is one of each rather than a second copy in the templates.

func Apply

func Apply(d *repo.Document, to repo.Status, now time.Time) ([]byte, error)

Apply moves a document to a new status and returns the rewritten file. The document on disk is not touched; writing it is the caller's business.

func Permitted

func Permitted(from repo.Status, strict bool) []repo.Status

Permitted lists the statuses a document may move to from this one, in the order a chooser should offer them. A terminal status has none: to change what an accepted document says, write a new one that updates or obsoletes it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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