transferwords

package
v1.135.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package transferwords is what an owner transfer says about the files a script's runs created (#1588): which of them a transfer is about, how many there are, and the sentence that tells an administrator whether they moved with the script or stayed where they were.

It reads the producer relation's rows and addresses and nothing else, so the wording can be read and tested without the handler that answers the transfer and cannot import it back.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(created []producedview.Item) string

Count renders "2 assets and 1 collection" for a set of outputs.

func Counts

func Counts(assets, collections int) string

Counts renders the two counts as prose, naming only the kinds that are present.

func Created

func Created(items []producedview.Item) []producedview.Item

Created narrows what a script wrote to what a transfer is about: the live assets and collections its runs CREATED. A file the script only wrote a version over is somebody else's and is not the script's to move; a resource is filed by library rather than by address and has no owner to change; a deleted file is gone either way.

func KeptWith

func KeptWith(created []producedview.Item, scriptOwner string) string

KeptWith names who the outputs stay with when they are not moved, for the refusal that asks the caller to choose: the script's owner when every row names them, and the plain fact otherwise.

func SameAddress

func SameAddress(rowOwner, owner string) bool

SameAddress reports whether a row's address names the person at owner. The comparison is case-insensitive, as every address comparison in the platform is, and an unattributed row names nobody.

func Sentence

func Sentence(a Account, owner string) string

Sentence states, after the sentence about the script, what became of its outputs. It is the answer to the question the ticket found nobody was asked (#1588): a transfer moves the automation, and whether the files it refreshes went with it is the part an administrator is most likely to be wrong about.

Types

type Account

type Account struct {
	Moved       bool
	Assets      int
	Collections int
	KeptWith    []string
}

Account is what a transfer did with a script's outputs, in the terms its sentence needs: whether they moved, how many of each kind, and, for ones that stayed, the address each stayed with.

Jump to

Keyboard shortcuts

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