utils

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ContainerEnvTagPrefix = "Container-Env-"

ContainerEnvTagPrefix defines the tag naming convention for passing container environment variables.

Format:

  • Tag Name: "Container-Env-" + <ENV_KEY>
  • Tag Value: <ENV_VALUE>

Example:

  • Container-Env-RUNTIME_TYPE = openclaw
  • Container-Env-OPENCLAW_GATEWAY_URL = http://127.0.0.1:18789
  • Container-Env-OPENCLAW_GATEWAY_TOKEN = openclaw-test-token

Parsing rule:

  • For each tag with Name prefix "Container-Env-", ENV_KEY = strings.TrimPrefix(Name, prefix)
  • Emit env entry as ENV_KEY + "=" + Value

Variables

This section is empty.

Functions

func BuildProcessTags

func BuildProcessTags(process hySchema.Process, nodeAddr string, tags []goarSchema.Tag) (hySchema.Process, error)

todo: this function for test env, should remove when real data is ok

func CheckModuleFormat

func CheckModuleFormat(moduleFormat string, tags []goarSchema.Tag) error

CheckModuleFormat validates the module configuration for the selected runtime backend.

func CompressDirectory

func CompressDirectory(srcPath string) (string, error)

CompressDirectory compresses the specified directory into a tar.gz format string. It preserves the directory structure and file permissions. srcPath: the absolute path of the directory to be compressed Returns the compressed data as a string and any error encountered

func ContainerEnvFromTags added in v0.0.3

func ContainerEnvFromTags(tags []goarSchema.Tag) []string

ContainerEnvFromTags extracts container environment variables from tags using ContainerEnvTagPrefix.

It returns a deterministic (sorted) env list in the form "KEY=VALUE". If the same KEY appears multiple times, the last occurrence wins.

func DecompressToDirectory

func DecompressToDirectory(data string, destPath string) error

DecompressToDirectory extracts a tar.gz format string to the specified directory. It recreates the original directory structure and preserves file permissions. data: the compressed data string destPath: the absolute path where the data should be extracted to Returns any error encountered during the extraction process

func RuntimeSpecFromModuleAndSpawnTags added in v0.0.3

func RuntimeSpecFromModuleAndSpawnTags(moduleFormat string, moduleTags, spawnTags []goarSchema.Tag) (schema.RuntimeSpec, error)

func RuntimeSpecFromTags added in v0.0.3

func RuntimeSpecFromTags(moduleFormat string, tags []goarSchema.Tag) (schema.RuntimeSpec, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL