Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BuildCmd = &cobra.Command{ Use: "build [directory]", Short: "Build a function to WASM using TinyGo", Long: `Compiles function.go in the given directory (or current directory) to a WASM binary. Requires TinyGo to be installed (https://tinygo.org/getting-started/install/).`, Args: cobra.MaximumNArgs(1), RunE: runBuild, }
BuildCmd compiles a function to WASM using TinyGo.
var DeleteCmd = &cobra.Command{ Use: "delete <name>", Short: "Delete a deployed function", Long: "Deletes a function from the Orama Network. This action cannot be undone.", Args: cobra.ExactArgs(1), RunE: runDelete, }
DeleteCmd deletes a deployed function.
var DeployCmd = &cobra.Command{ Use: "deploy [directory]", Short: "Deploy a function to the Orama Network", Long: `Deploys the function in the given directory (or current directory). If no .wasm file exists, it will be built automatically using TinyGo. Reads configuration from function.yaml.`, Args: cobra.MaximumNArgs(1), RunE: runDeploy, }
DeployCmd deploys a function to the Orama Network.
var GetCmd = &cobra.Command{ Use: "get <name>", Short: "Get details of a deployed function", Long: "Retrieves and displays detailed information about a specific function.", Args: cobra.ExactArgs(1), RunE: runGet, }
GetCmd shows details of a deployed function.
var InitCmd = &cobra.Command{ Use: "init <name>", Short: "Create a new serverless function project", Long: "Scaffolds a new directory with function.go and function.yaml templates.", Args: cobra.ExactArgs(1), RunE: runInit, }
InitCmd scaffolds a new function project.
var InvokeCmd = &cobra.Command{ Use: "invoke <name>", Short: "Invoke a deployed function", Long: "Sends a request to invoke the named function with optional JSON payload.", Args: cobra.ExactArgs(1), RunE: runInvoke, }
InvokeCmd invokes a deployed function.
var ListCmd = &cobra.Command{ Use: "list", Short: "List deployed functions", Long: "Lists all functions deployed in the current namespace.", Args: cobra.NoArgs, RunE: runList, }
ListCmd lists all deployed functions.
var LogsCmd = &cobra.Command{ Use: "logs <name>", Short: "Get execution logs for a function", Long: "Retrieves the most recent execution logs for a deployed function.", Args: cobra.ExactArgs(1), RunE: runLogs, }
LogsCmd retrieves function execution logs.
var SecretsCmd = &cobra.Command{
Use: "secrets",
Short: "Manage function secrets",
Long: `Set, list, and delete encrypted secrets for your serverless functions.
Functions access secrets at runtime via the get_secret() host function.
Secrets are scoped to your namespace and encrypted at rest with AES-256-GCM.
Examples:
orama function secrets set API_KEY "sk-abc123"
orama function secrets set CERT_PEM --from-file ./cert.pem
orama function secrets list
orama function secrets delete API_KEY`,
}
SecretsCmd is the parent command for secrets management.
var SecretsDeleteCmd = &cobra.Command{ Use: "delete <name>", Short: "Delete a secret", Long: "Permanently deletes a secret. Functions will no longer be able to access it.", Args: cobra.ExactArgs(1), RunE: runSecretsDelete, }
SecretsDeleteCmd deletes a secret.
var SecretsListCmd = &cobra.Command{ Use: "list", Short: "List secret names", Long: "Lists all secret names in the current namespace. Values are never shown.", Args: cobra.NoArgs, RunE: runSecretsList, }
SecretsListCmd lists secret names.
var SecretsSetCmd = &cobra.Command{ Use: "set <name> [value]", Short: "Set a secret", Long: `Stores an encrypted secret. Functions access it via get_secret("name"). If --from-file is used, value is read from the file instead.`, Args: cobra.RangeArgs(1, 2), RunE: runSecretsSet, }
SecretsSetCmd stores an encrypted secret.
var TriggersAddCmd = &cobra.Command{ Use: "add <function-name>", Short: "Add a PubSub trigger", Long: "Registers a PubSub trigger so the function is invoked when a message is published to the topic.", Args: cobra.ExactArgs(1), RunE: runTriggersAdd, }
TriggersAddCmd adds a PubSub trigger to a function.
var TriggersCmd = &cobra.Command{
Use: "triggers",
Short: "Manage function PubSub triggers",
Long: `Add, list, and delete PubSub triggers for your serverless functions.
When a message is published to a topic, all functions with a trigger on
that topic are automatically invoked with the message as input.
Examples:
orama function triggers add my-function --topic calls:invite
orama function triggers list my-function
orama function triggers delete my-function <trigger-id>`,
}
TriggersCmd is the parent command for trigger management.
var TriggersDeleteCmd = &cobra.Command{ Use: "delete <function-name> <trigger-id>", Short: "Delete a trigger", Args: cobra.ExactArgs(2), RunE: runTriggersDelete, }
TriggersDeleteCmd deletes a trigger.
var TriggersListCmd = &cobra.Command{ Use: "list <function-name>", Short: "List triggers for a function", Args: cobra.ExactArgs(1), RunE: runTriggersList, }
TriggersListCmd lists triggers for a function.
var VersionsCmd = &cobra.Command{ Use: "versions <name>", Short: "List all versions of a function", Long: "Shows all deployed versions of a specific function.", Args: cobra.ExactArgs(1), RunE: runVersions, }
VersionsCmd lists all versions of a function.
Functions ¶
func ResolveFunctionDir ¶
ResolveFunctionDir resolves and validates a function directory. If dir is empty, uses the current working directory.
func ValidateWASM ¶
ValidateWASM checks that the given bytes are a valid WASM binary (magic number check).
func ValidateWASMFile ¶
ValidateWASMFile checks that the file at the given path is a valid WASM binary.
Types ¶
type FunctionConfig ¶
type FunctionConfig struct {
Name string `yaml:"name"`
Public bool `yaml:"public"`
Memory int `yaml:"memory"`
Timeout int `yaml:"timeout"`
Retry RetryConfig `yaml:"retry"`
Env map[string]string `yaml:"env"`
}
FunctionConfig represents the function.yaml configuration.
func LoadConfig ¶
func LoadConfig(dir string) (*FunctionConfig, error)
LoadConfig reads and parses a function.yaml from the given directory.
type RetryConfig ¶
RetryConfig holds retry settings.