v1

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package v1 defines the honey.plugins/v1 JSON contract between the host and WASM plugins.

Index

Constants

View Source
const APIVersion = "honey.plugins/v1"

APIVersion is the JSON api_version field for honey.plugins/v1.

Variables

This section is empty.

Functions

This section is empty.

Types

type CueTransformInput

type CueTransformInput struct {
	APIVersion string `json:"api_version"`
	Cue        string `json:"cue"` // base64-encoded CUE bytes
	HostsCount int    `json:"hosts_count"`
}

CueTransformInput is passed to the cue_transform export.

type CueTransformOutput

type CueTransformOutput struct {
	Cue string `json:"cue"` // base64-encoded CUE bytes
}

CueTransformOutput is returned from cue_transform.

type ExecuteStepInput

type ExecuteStepInput struct {
	APIVersion string            `json:"api_version"`
	StepIndex  int               `json:"step_index"`
	Host       []byte            `json:"host"` // JSON host record
	Env        map[string]string `json:"env,omitempty"`
	PluginID   string            `json:"plugin_id"`
	Action     string            `json:"action"`
	Config     []byte            `json:"config,omitempty"` // JSON object
	Execute    bool              `json:"execute"`
	SecretsDry bool              `json:"secrets_dry_run"`
}

ExecuteStepInput is passed to execute_step.

type ExecuteStepOutput

type ExecuteStepOutput struct {
	Success  bool   `json:"success"`
	Changed  bool   `json:"changed,omitempty"`
	Skipped  bool   `json:"skipped,omitempty"`
	ExitCode int    `json:"exit_code,omitempty"`
	Stdout   string `json:"stdout,omitempty"`
	Stderr   string `json:"stderr,omitempty"`
	Err      string `json:"err,omitempty"`
}

ExecuteStepOutput is returned from execute_step.

type HostExecInput

type HostExecInput struct {
	Argv      []string `json:"argv"`
	Cwd       string   `json:"cwd,omitempty"`
	TimeoutMS int      `json:"timeout_ms,omitempty"`
}

HostExecInput is passed to the host_exec host function (argv-only, no shell).

type HostExecOutput

type HostExecOutput struct {
	ExitCode int    `json:"exit_code"`
	Stdout   string `json:"stdout,omitempty"`
	Stderr   string `json:"stderr,omitempty"`
	Error    string `json:"error,omitempty"`
}

HostExecOutput is returned from host_exec.

type K8sHTTPInput added in v0.3.4

type K8sHTTPInput struct {
	Method  string            `json:"method"`
	Path    string            `json:"path"`
	Body    []byte            `json:"body,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
	// MaxResponseBytes caps the response body (0 = default 4 MB).
	MaxResponseBytes int64 `json:"max_response_bytes,omitempty"`
}

K8sHTTPInput is passed to the k8s_http host function. Path is the API path (e.g. "/apis/apps/v1/namespaces/default/deployments"). The host function resolves the API server URL and credentials from HostRunContext.

type K8sHTTPOutput added in v0.3.4

type K8sHTTPOutput struct {
	StatusCode int               `json:"status_code"`
	Body       []byte            `json:"body,omitempty"`
	Headers    map[string]string `json:"headers,omitempty"`
	Error      string            `json:"error,omitempty"`
}

K8sHTTPOutput is returned from the k8s_http host function.

type KVInput

type KVInput struct {
	Op    string `json:"op"` // get, put, delete
	Key   string `json:"key"`
	Value string `json:"value,omitempty"`
}

KVInput is passed to the kv host function.

type KVOutput

type KVOutput struct {
	Found bool   `json:"found,omitempty"`
	Value string `json:"value,omitempty"`
	Error string `json:"error,omitempty"`
}

KVOutput is returned from kv.

type OnStepResultInput

type OnStepResultInput struct {
	APIVersion string            `json:"api_version"`
	RecipeName string            `json:"recipe_name"`
	StepIndex  int               `json:"step_index"`
	Phase      string            `json:"phase"`
	Host       []byte            `json:"host"`
	Result     []byte            `json:"result"` // JSON HostExecResult-like map
	PluginID   string            `json:"plugin_id"`
	Action     string            `json:"action"`
	Config     []byte            `json:"config,omitempty"`
	Env        map[string]string `json:"env,omitempty"`
}

OnStepResultInput is passed to on_step_result (local hooks).

type OnStepResultOutput

type OnStepResultOutput struct {
	Output string `json:"output,omitempty"`
	Err    string `json:"err,omitempty"`
}

OnStepResultOutput is returned from on_step_result.

type PluginError

type PluginError struct {
	Error string `json:"error"`
}

PluginError is returned when a plugin sets an error string (non-empty means failure).

type PostgresMigrateInput added in v0.3.0

type PostgresMigrateInput struct {
	DSNSecret     string            `json:"dsn_secret"`
	MigrationsDir string            `json:"migrations_dir,omitempty"`
	Files         []string          `json:"files,omitempty"`
	TimeoutMS     int               `json:"timeout_ms"`
	Readonly      *bool             `json:"readonly,omitempty"`
	KVKey         string            `json:"kv_key,omitempty"`
	KVKeyPerHost  bool              `json:"kv_key_per_host,omitempty"`
	Extract       map[string]string `json:"extract,omitempty"`
}

PostgresMigrateInput is passed to the postgres_migrate host function.

type PostgresOutput added in v0.3.0

type PostgresOutput struct {
	Changed      bool             `json:"changed,omitempty"`
	Failed       bool             `json:"failed,omitempty"`
	Rows         []map[string]any `json:"rows,omitempty"`
	RowsAffected int64            `json:"rows_affected,omitempty"`
	Stdout       string           `json:"stdout,omitempty"`
	Error        string           `json:"error,omitempty"`
}

PostgresOutput is returned from postgres_query, postgres_exec, and postgres_migrate.

type PostgresSQLInput added in v0.3.0

type PostgresSQLInput struct {
	DSNSecret    string            `json:"dsn_secret"`
	SQL          string            `json:"sql"`
	Params       json.RawMessage   `json:"params,omitempty"`
	TimeoutMS    int               `json:"timeout_ms"`
	Readonly     *bool             `json:"readonly,omitempty"`
	KVKey        string            `json:"kv_key,omitempty"`
	KVKeyPerHost bool              `json:"kv_key_per_host,omitempty"`
	Extract      map[string]string `json:"extract,omitempty"`
	Host         string            `json:"host,omitempty"`
	Port         string            `json:"port,omitempty"`
	TunnelStep   string            `json:"tunnel_step,omitempty"`
}

PostgresSQLInput is shared by postgres_query and postgres_exec host functions.

type RemoteDownloadInput added in v0.3.0

type RemoteDownloadInput struct {
	RemotePath string `json:"remote_path"`
	LocalPath  string `json:"local_path,omitempty"`
	MaxBytes   int64  `json:"max_bytes,omitempty"`
}

RemoteDownloadInput is passed to the remote_download host function.

type RemoteDownloadOutput added in v0.3.0

type RemoteDownloadOutput struct {
	Content string `json:"content,omitempty"`
	Size    int64  `json:"size,omitempty"`
	Changed bool   `json:"changed,omitempty"`
	Failed  bool   `json:"failed,omitempty"`
	Error   string `json:"error,omitempty"`
}

RemoteDownloadOutput is returned from remote_download.

type RemoteExecInput added in v0.3.0

type RemoteExecInput struct {
	Shell     string `json:"shell,omitempty"`
	Script    string `json:"script,omitempty"`
	RunAs     string `json:"run_as,omitempty"`
	TimeoutMS int    `json:"timeout_ms,omitempty"`
}

RemoteExecInput is passed to the remote_exec host function.

type RemoteExecOutput added in v0.3.0

type RemoteExecOutput struct {
	ExitCode int    `json:"exit_code,omitempty"`
	Stdout   string `json:"stdout,omitempty"`
	Stderr   string `json:"stderr,omitempty"`
	Changed  bool   `json:"changed,omitempty"`
	Failed   bool   `json:"failed,omitempty"`
	Error    string `json:"error,omitempty"`
}

RemoteExecOutput is returned from remote_exec.

type RemoteStatInput added in v0.3.0

type RemoteStatInput struct {
	Path string `json:"path"`
}

RemoteStatInput is passed to the remote_stat host function.

type RemoteStatOutput added in v0.3.0

type RemoteStatOutput struct {
	Exists  bool   `json:"exists,omitempty"`
	IsDir   bool   `json:"is_dir,omitempty"`
	Mode    string `json:"mode,omitempty"`
	Size    int64  `json:"size,omitempty"`
	MTime   string `json:"mtime,omitempty"`
	Changed bool   `json:"changed,omitempty"`
	Failed  bool   `json:"failed,omitempty"`
	Error   string `json:"error,omitempty"`
}

RemoteStatOutput is returned from remote_stat.

type RemoteUploadInput added in v0.3.0

type RemoteUploadInput struct {
	LocalPath  string `json:"local_path,omitempty"`
	RemotePath string `json:"remote_path"`
	Mode       string `json:"mode,omitempty"`
	Content    string `json:"content,omitempty"`
}

RemoteUploadInput is passed to the remote_upload host function.

type RemoteUploadOutput added in v0.3.0

type RemoteUploadOutput struct {
	Changed bool   `json:"changed,omitempty"`
	Failed  bool   `json:"failed,omitempty"`
	Error   string `json:"error,omitempty"`
}

RemoteUploadOutput is returned from remote_upload.

type ResolveSecretInput

type ResolveSecretInput struct {
	APIVersion string `json:"api_version"`
	Ref        string `json:"ref"`
	Label      string `json:"label,omitempty"`
	PluginID   string `json:"plugin_id"`
}

ResolveSecretInput is passed to resolve_secret.

type ResolveSecretOutput

type ResolveSecretOutput struct {
	Value string `json:"value"`
}

ResolveSecretOutput is returned from resolve_secret.

type TemplateRenderInput added in v0.3.0

type TemplateRenderInput struct {
	Template string         `json:"template"`
	Data     map[string]any `json:"data,omitempty"`
}

TemplateRenderInput is passed to the template_render host function.

type TemplateRenderOutput added in v0.3.0

type TemplateRenderOutput struct {
	Content string `json:"content,omitempty"`
	Failed  bool   `json:"failed,omitempty"`
	Error   string `json:"error,omitempty"`
}

TemplateRenderOutput is returned from template_render.

type UnwrapStackKeyInput

type UnwrapStackKeyInput struct {
	APIVersion      string `json:"api_version"`
	SecretsProvider string `json:"secrets_provider"`
	EncryptedKey    string `json:"encrypted_key"`
	PluginID        string `json:"plugin_id"`
}

UnwrapStackKeyInput is passed to unwrap_stack_key.

type UnwrapStackKeyOutput

type UnwrapStackKeyOutput struct {
	DataKeyHex string `json:"data_key_hex"`
}

UnwrapStackKeyOutput is returned from unwrap_stack_key (hex-encoded 32-byte key).

Jump to

Keyboard shortcuts

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