SAService Architect Back to designer
SAService ArchitectDocumentation
Code generation reference <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/functions in the service Module or selected functionModule.
  • The generator derives filenames from functionName; functionPackage controls 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.

TargetEmpty-value rootDescription
Go<service_dir>/internal/functions

folder/sub-folder is appended relative to this directory.

C++ userver<service_dir>/internal/functions

The current normalizer turns the complete value into one snake_case directory.

C++ Boost<service_dir>/internal/functions

The current normalizer turns the complete value into one snake_case directory.

Python<service_dir>/src/<python_package>/internal/functions

The current normalizer turns the complete value into one Python identifier; tests mirror it below <service_dir>/tests/functions.

Rust<service_dir>/src/internal/functions

The current normalizer turns the complete value into one Rust identifier.

TypeScript<service_dir>/src/internal/functions

Each 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.

PropertyTypeDescription
Go service-owned<service_dir>/pkg/functions

Used when publicFunction = true and functionModule is empty.

Go Module-owned<function_module_dir>/pkg/functions

Used when publicFunction = true and functionModule selects a user-defined Module.

Other targetstarget-specific internal root

The 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.

TargetEmpty / non-emptyDescription
Go"" / domain/orders

Empty: /workspace/orderservice/internal/functions/validateorder.go. Non-empty: /workspace/orderservice/internal/functions/domain/orders/validateorder.go.

C++ userver"" / domain/orders

Empty: /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/orders

Empty: /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/orders

Empty: /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/orders

Empty: /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/orders

Empty: /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