{"modulePath":"github.com/smartcontractkit/cre-cli","version":"v1.23.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package workflowrender\n\nPackage 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.\n\nThe list API returns workflowSource as either the raw registry id (e.g. \"private\"), a \"contract:\\\u003cchainSelector\u003e:\\\u003c0x…\u003e\" tuple for on-chain rows, or a \"grpc:\\\u003c…\u003e\" string for off-chain rows — so direct equality with the context registry id only works in the first case.\n\n## Functions\n\n```go\nfunc AvailableRegistryIDs(registries []*tenantctx.Registry) string\n```\nAvailableRegistryIDs returns a comma-separated list of registry IDs for use in error messages.\n\n```go\nfunc FindRegistry(registries []*tenantctx.Registry, id string) *tenantctx.Registry\n```\nFindRegistry returns the registry entry with the matching ID, or nil.\n\n```go\nfunc ParseContractWorkflowSource(workflowSource string) (selector, addr string, ok bool)\n```\nParseContractWorkflowSource splits a \"contract:\\\u003cchainSelector\u003e:\\\u003caddr\u003e\" workflow source. ok is false when the prefix is not present.\n\n```go\nfunc PrintWorkflowTable(rows []Workflow, registries []*tenantctx.Registry, opts TableOptions)\n```\nPrintWorkflowTable renders the workflow rows as a bulleted table using the shared UI helpers.\n\n```go\nfunc PrintWorkflowsJSON(rows []Workflow, registries []*tenantctx.Registry) error\n```\nPrintWorkflowsJSON marshals workflows as an indented JSON array and writes it to stdout.\n\n```go\nfunc RegistryEligibleForContractRows(reg *tenantctx.Registry) bool\n```\nRegistryEligibleForContractRows reports whether a registry can legitimately own on-chain (\"contract:…\") workflow sources.\n\n```go\nfunc RegistryIDOrSource(workflowSource string, matched *tenantctx.Registry) string\n```\nRegistryIDOrSource returns the matched registry's ID, falling back to the raw workflowSource when no registry resolves cleanly.\n\n```go\nfunc ResolveWorkflowRegistry(workflowSource string, registries []*tenantctx.Registry) *tenantctx.Registry\n```\nResolveWorkflowRegistry returns the registry in the tenant context that best matches the given workflowSource, or nil if none match.\n\n## Types\n\n```go\ntype TableOptions struct {\n\t// CountBeforeDeletedFilter is the number of rows after any registry/search\n\t// filtering but before DELETED rows were removed. When it is \u003e 0 and\n\t// IncludeDeleted is false, the empty-state message hints at --include-deleted.\n\tCountBeforeDeletedFilter int\n\t// IncludeDeleted indicates whether the caller is already showing DELETED rows.\n\tIncludeDeleted bool\n}\n```\nTableOptions controls the empty-state hint printed by PrintWorkflowTable.\n\n```go\ntype Workflow = workflowdataclient.Workflow\n```\nWorkflow is a type alias so callers can refer to the row type without importing the data client directly.\n\n```go\nfunc FilterRowsByRegistry(rows []Workflow, reg *tenantctx.Registry, all []*tenantctx.Registry) []Workflow\n```\nFilterRowsByRegistry 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.\n\n```go\nfunc OmitDeleted(rows []Workflow) []Workflow\n```\nOmitDeleted returns rows whose status is not \"DELETED\" (case-insensitive).\n\n","path":"github.com/smartcontractkit/cre-cli/internal/workflowrender","name":"workflowrender","synopsis":"Package workflowrender contains helpers for matching platform workflow rows to registries in the tenant context and rendering them as a table.","isRedistributable":true}
