Documentation
¶
Overview ¶
Package workflowrender contains helpers for matching platform workflow rows to registries in the tenant context and rendering them as a table. It is shared by the workflow list and get commands.
The list API returns workflowSource as either the raw registry id (e.g. "private"), a "contract:<chainSelector>:<0x…>" tuple for on-chain rows, or a "grpc:<…>" string for off-chain rows — so direct equality with the context registry id only works in the first case.
Index ¶
- func AvailableRegistryIDs(registries []*tenantctx.Registry) string
- func FindRegistry(registries []*tenantctx.Registry, id string) *tenantctx.Registry
- func ParseContractWorkflowSource(workflowSource string) (selector, addr string, ok bool)
- func PrintWorkflowTable(rows []Workflow, registries []*tenantctx.Registry, opts TableOptions)
- func PrintWorkflowsJSON(rows []Workflow, registries []*tenantctx.Registry) error
- func RegistryEligibleForContractRows(reg *tenantctx.Registry) bool
- func RegistryIDOrSource(workflowSource string, matched *tenantctx.Registry) string
- func ResolveWorkflowRegistry(workflowSource string, registries []*tenantctx.Registry) *tenantctx.Registry
- type TableOptions
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableRegistryIDs ¶
AvailableRegistryIDs returns a comma-separated list of registry IDs for use in error messages.
func FindRegistry ¶
FindRegistry returns the registry entry with the matching ID, or nil.
func ParseContractWorkflowSource ¶
ParseContractWorkflowSource splits a "contract:<chainSelector>:<addr>" workflow source. ok is false when the prefix is not present.
func PrintWorkflowTable ¶
func PrintWorkflowTable(rows []Workflow, registries []*tenantctx.Registry, opts TableOptions)
PrintWorkflowTable renders the workflow rows as a bulleted table using the shared UI helpers.
func PrintWorkflowsJSON ¶
PrintWorkflowsJSON marshals workflows as an indented JSON array and writes it to stdout.
func RegistryEligibleForContractRows ¶
RegistryEligibleForContractRows reports whether a registry can legitimately own on-chain ("contract:…") workflow sources.
func RegistryIDOrSource ¶
RegistryIDOrSource returns the matched registry's ID, falling back to the raw workflowSource when no registry resolves cleanly.
Types ¶
type TableOptions ¶
type TableOptions struct {
// CountBeforeDeletedFilter is the number of rows after any registry/search
// filtering but before DELETED rows were removed. When it is > 0 and
// IncludeDeleted is false, the empty-state message hints at --include-deleted.
CountBeforeDeletedFilter int
// IncludeDeleted indicates whether the caller is already showing DELETED rows.
IncludeDeleted bool
}
TableOptions controls the empty-state hint printed by PrintWorkflowTable.
type Workflow ¶
type Workflow = workflowdataclient.Workflow
Workflow is a type alias so callers can refer to the row type without importing the data client directly.
func FilterRowsByRegistry ¶
func FilterRowsByRegistry(rows []Workflow, reg *tenantctx.Registry, all []*tenantctx.Registry) []Workflow
FilterRowsByRegistry returns only the rows that resolve to the given registry in the provided tenant context. A nil registry is treated as "no filter" and rows is returned unchanged.
func OmitDeleted ¶
OmitDeleted returns rows whose status is not "DELETED" (case-insensitive).