1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Project: hyperi-rustlib
// File: src/deployment/generate/common.rs
// Purpose: Shared template helpers (camel-case, go-ident, file write)
// Language: Rust
//
// License: BUSL-1.1
// Copyright: (c) 2026 HYPERI PTY LIMITED
use Path;
use crateDeploymentError;
// ============================================================================
// Helpers
// ============================================================================
/// Convert a group name to camelCase suffix (e.g., "kafka" -> "kafka", "click_house" -> "clickHouse").
pub
/// True if `s` is a valid Go-template identifier (matches
/// `[A-Za-z_][A-Za-z0-9_]*`). Go templates accept the dot-walked
/// `.foo.bar` syntax only for keys matching this shape; any other
/// key (hyphens, dots, digit-leading, etc.) must use the
/// `(index .foo "key")` form or `helm lint` fails with
/// `bad character U+002D '-'` (and similar).
pub
/// Render a Go-template lookup expression that's safe for any key.
///
/// `base` must be a dot-prefixed path that itself only contains
/// Go-safe identifiers (e.g. `.Values.auth.secretKeys`). `key` may
/// contain anything; the function picks the dot-walked form when
/// it's safe and the `(index ... "key")` form otherwise.
///
/// Examples:
/// - `safe_template_lookup(".Values.auth", "username")`
/// → `.Values.auth.username`
/// - `safe_template_lookup(".Values.auth", "bearer-tokens")`
/// → `(index .Values.auth "bearer-tokens")`
pub
pub