ExtractFunctionName
Extracts the function name from a task name. If an environment is set, it strips the "environment." prefix from the task name; otherwise, it falls back to taking the last segment after splitting on ".."
def ExtractFunctionName(
ctx: context.Context,
taskName: string,
environment: string
) - > string
Extracts the function name from a task name. If an environment is provided, it attempts to strip the "environment." prefix; otherwise, it falls back to taking the last segment after splitting on ".".
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, used for logging. |
| taskName | string | The full task name from which to extract the function name. |
| environment | string | The environment name. If not empty, the function will attempt to remove this prefix from the task name. |
Returns
| Type | Description |
|---|---|
string | The extracted function name. |