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