productpromise

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package productpromise holds the product's name and promise as the areas session states them and as init's record keeps them, so the walk, recovery and consolidation sessions and the written map read one form.

Index

Constants

View Source
const NoPromise = "Not yet stated."

NoPromise is what stands for a promise the areas session did not state.

Variables

This section is empty.

Functions

func Block

func Block(promise string) string

Block returns the text a session's message carries for the promise: a line naming it, then the promise in a fence.

func Lead

func Lead(ctx context.Context, st AreasStore) string

Lead returns Block of the stored promise and a blank line, or the empty string when none is stated or the record cannot be read.

Types

type AreasStore

type AreasStore interface {
	Areas(ctx context.Context) (initrecord.Areas, bool, error)
}

AreasStore is what Stored reads the areas from.

type Product

type Product struct {
	Name    string `json:"name"`
	Promise string `json:"promise"`
}

Product is the product's name and promise.

func Clean

func Clean(p Product) Product

Clean returns p with a name that is not a plain name emptied (longer than 80 runes, a line break or a backtick in it, or a leading #), and each field made one trimmed line.

func Stored

func Stored(ctx context.Context, st AreasStore) (Product, bool, error)

Stored returns the cleaned product of the stored areas and whether a promise is stated. No areas, no product or an empty promise give an empty product and false. A body that is not JSON is an error that does not quote it.

func (Product) PromiseOr

func (p Product) PromiseOr() string

PromiseOr returns the promise, or NoPromise when none is stated.

Jump to

Keyboard shortcuts

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