Documentation
¶
Index ¶
- Constants
- func CapturePrettyPrint(v ...interface{}) []any
- func ExpandFilePaths(paths []string, recursive bool) ([]string, error)
- func ExtractLineMetadata(lineStr string) (string, string, string, string)
- func FileExists(path string) bool
- func GetYAMLFilesInDirectory(dirPath string, recursive bool) ([]string, error)
- func HasPlaceholders(s string) bool
- func IsDirectory(path string) bool
- func MapToPretty(v interface{}) string
- func ParseTimestamp(timestampStr string) (*time.Time, error)
- func PickFirstNonEmpty(values ...string) string
- func PreQuoteUnquotedPlaceholders(in string) string
- func PrettyPrint(v ...interface{})
- func ProtoStringToTimestamp(timestamp string) *time.Time
- func SafePath(baseDir, entryName string) (string, error)
- func SliceContains[T comparable](s []T, e T) bool
- func ToInt32NonNegative(n int) int32
- func ToInt32NonNegative64(n int64) int32
- func ToUint32NonNegative(n int) uint32
- func ToUint64NonNegative(n int) uint64
- func ToUintNonNegative(n int) uint
- func ValidateDNS1123Name(name string) error
- type InstanceLogInfo
- type MultiLogStreamer
- type Renderer
- func (r *Renderer) PreprocessValuesYAML(text string) (string, error)
- func (r *Renderer) RenderString(input string, depth int) (string, error)
- func (r *Renderer) RenderValuesMap(values map[string]interface{}) error
- func (r *Renderer) RenderValuesMapFixpoint(values map[string]interface{}, maxPasses int) error
Constants ¶
const ( // maxFileSize is the maximum size for any single file to prevent decompression bombs MAX_FILE_SIZE = 100 * 1024 * 1024 // 100MB )
Variables ¶
This section is empty.
Functions ¶
func CapturePrettyPrint ¶
func CapturePrettyPrint(v ...interface{}) []any
func ExpandFilePaths ¶
ExpandFilePaths expands file paths to include files in directories and glob patterns.
func ExtractLineMetadata ¶
ExtractLineMetadata extracts metadata and content from a line Returns metadata (instanceID, instanceName, timestamp) and the remaining content
func GetYAMLFilesInDirectory ¶
GetYAMLFilesInDirectory returns all YAML files (.yaml or .yml) in a directory.
func HasPlaceholders ¶
HasPlaceholders reports whether a string contains template delimiters.
func MapToPretty ¶
func MapToPretty(v interface{}) string
func ParseTimestamp ¶
ParseTimestamp parses a timestamp string into a time.Time.
func PickFirstNonEmpty ¶
PickFirstNonEmpty picks the first non-empty value from a list of strings. If all values are empty, returns the empty string.
func PreQuoteUnquotedPlaceholders ¶
PreQuoteUnquotedPlaceholders wraps bare {{ ... }} placeholders where a value consists solely of a placeholder (key: {{...}} or - {{...}}) to avoid YAML parse errors.
func PrettyPrint ¶
func PrettyPrint(v ...interface{})
func ProtoStringToTimestamp ¶
func SafePath ¶
SafePath safely constructs a target path within a base directory, preventing directory traversal
func SliceContains ¶
func SliceContains[T comparable](s []T, e T) bool
func ToInt32NonNegative ¶
Helper to safely convert non-negative ints to int32 with clamping
func ToInt32NonNegative64 ¶
func ToUint32NonNegative ¶
func ToUint64NonNegative ¶
func ToUintNonNegative ¶
func ValidateDNS1123Name ¶
ValidateDNS1123Name validates the a name according to DNS-1123 rules
Types ¶
type InstanceLogInfo ¶
type InstanceLogInfo struct {
InstanceID string
InstanceName string
Reader io.ReadCloser
}
InstanceLogInfo associates an instance ID with its log reader
type MultiLogStreamer ¶
type MultiLogStreamer struct {
// contains filtered or unexported fields
}
MultiLogStreamer combines log streams from multiple instances into a single stream
func NewMultiLogStreamer ¶
func NewMultiLogStreamer(instances []InstanceLogInfo, includeMetadata bool) *MultiLogStreamer
NewMultiLogStreamer creates a new MultiLogStreamer that combines log streams from multiple instances
func (*MultiLogStreamer) Close ¶
func (m *MultiLogStreamer) Close() error
Close implements the io.Closer interface
type Renderer ¶
type Renderer struct {
Root string
Values map[string]interface{}
Ctx map[string]interface{}
FileCache map[string]string
TemplateCache map[string]string
Stack []string // include stack for cycle detection (absolute paths)
MaxDepth int
PhRegex *regexp.Regexp
Filters map[string]func(current interface{}, args []interface{}, ok bool) (interface{}, bool, error)
}
Renderer provides cached, guarded rendering of runeset placeholders.
func NewRenderer ¶
NewRenderer creates a renderer with sane defaults.
func (*Renderer) PreprocessValuesYAML ¶
PreprocessValuesYAML pre-processes values YAML text to support unquoted placeholders by quoting bare placeholders and then rendering placeholders against the renderer state.
func (*Renderer) RenderString ¶
RenderString renders a YAML text with recursion/depth guards and caching.
func (*Renderer) RenderValuesMap ¶
RenderValuesMap walks a map and renders any string placeholders using this renderer. It mutates the provided map in place.