<functions_root>/<functionPackage>functionPackage paths
How an empty value and a relative value map to generated function files in every target language.
When to use
Use this page when choosing package fields or locating generated types and functions.
Behavior
- Empty or whitespace means no additional subdirectory: the function is emitted directly in the selected functions root.
- Private functions are owned by the service and use its internal functions root.
- For Go public functions, the root changes to
pkg/functionsin the service Module or selectedfunctionModule. - The generator derives filenames from
functionName;functionPackagecontrols only the containing placement.
Empty value
An empty functionPackage uses the default root below. <service_dir> is derived from the service name; <python_package> is the normalized Python service package.
Relative value
For functionPackage: folder/sub-folder, resolution starts at the same root shown below. TypeScript normalizes each path segment independently. Go appends the configured relative path. Other current backends flatten the full value to one normalized segment.
Private function roots properties
publicFunction = false or omitted.
Go<service_dir>/internal/functionsfolder/sub-folder is appended relative to this directory.
C++ userver<service_dir>/internal/functionsThe current normalizer turns the complete value into one snake_case directory.
C++ Boost<service_dir>/internal/functionsThe current normalizer turns the complete value into one snake_case directory.
Python<service_dir>/src/<python_package>/internal/functionsThe current normalizer turns the complete value into one Python identifier; tests mirror it below <service_dir>/tests/functions.
Rust<service_dir>/src/internal/functionsThe current normalizer turns the complete value into one Rust identifier.
TypeScript<service_dir>/src/internal/functionsEach segment is normalized to kebab-case and preserved; tests mirror it below <service_dir>/test/functions.
Public function roots properties
Public placement is generated from ownership, not from an absolute path.
Go service-owned<service_dir>/pkg/functionsUsed when publicFunction = true and functionModule is empty.
Go Module-owned<function_module_dir>/pkg/functionsUsed when publicFunction = true and functionModule selects a user-defined Module.
Other targetstarget-specific internal rootThe current non-Go backends keep generated function implementations in their service-internal function trees; do not assume Go pkg/functions layout.
Concrete paths from a service root properties
Assume the generated service root is /workspace/orderservice, the Python package is order_service, and the generated function filename represents ValidateOrder.
Go"" / domain/ordersEmpty: /workspace/orderservice/internal/functions/validateorder.go. Non-empty: /workspace/orderservice/internal/functions/domain/orders/validateorder.go.
C++ userver"" / domain/ordersEmpty: /workspace/orderservice/internal/functions/validate_order.hpp. Non-empty: /workspace/orderservice/internal/functions/domain_orders/validate_order.hpp; the current generator flattens the slash.
C++ Boost"" / domain/ordersEmpty: /workspace/orderservice/internal/functions/validate_order.hpp. Non-empty: /workspace/orderservice/internal/functions/domain_orders/validate_order.hpp; the current generator flattens the slash.
Python"" / domain/ordersEmpty: /workspace/orderservice/src/order_service/internal/functions/validate_order.py. Non-empty: /workspace/orderservice/src/order_service/internal/functions/domain_orders/validate_order.py; the current generator flattens the slash.
Rust"" / domain/ordersEmpty: /workspace/orderservice/src/internal/functions/validate_order.rs. Non-empty: /workspace/orderservice/src/internal/functions/domain_orders/validate_order.rs; the current generator flattens the slash.
TypeScript"" / domain/ordersEmpty: /workspace/orderservice/src/internal/functions/validate-order.ts. Non-empty: /workspace/orderservice/src/internal/functions/domain/orders/validate-order.ts.
Configuration example
# Hypothetical service root: /workspace/orderservice
# Empty: use the language functions root
functionPackage: ""
# Go -> /workspace/orderservice/internal/functions/validateorder.go
# TypeScript -> /workspace/orderservice/src/internal/functions/validate-order.ts
# Non-empty: resolve from that same root
functionPackage: domain/orders
# Go -> /workspace/orderservice/internal/functions/domain/orders/validateorder.go
# TypeScript -> /workspace/orderservice/src/internal/functions/domain/orders/validate-order.ts
# Python/C++/Rust currently flatten domain/orders to domain_orders