xyops

package
v0.3.0-dev.22 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package xyops declares xyOps objects (events and secrets) with john/tofu-provider-xyops, a fork of the community provider published as registry.yawn.dev/john/xyops from Forgejo releases.

Credentials come from the environment only: XYOPS_ENDPOINT and XYOPS_API_KEY (an admin key, since secrets and their grants need admin). Secret VALUES are never written: Secret manages a record's title, notes and grants; values are entered in the xyOps UI and live only in xyOps.

Event fields that hold structured data (params, fields, triggers, limits, actions) are JSON strings in the provider, as xyOps stores them; the constructs encode Go values with the same key order the provider reads back so an imported event plans without changes.

Index

Constants

View Source
const ProviderVersion = "0.1.2-dev.8"

ProviderVersion is the pinned tofu-provider-xyops release.

Variables

View Source
var Credentials = []string{"XYOPS_ENDPOINT", "XYOPS_API_KEY"}

Credentials are the environment variables the provider reads.

Functions

func Provider

func Provider() core.Provider

Provider returns the pinned provider, published on registry.yawn.dev (GPG-signed SHA256SUMS; OpenTofu verifies the signature on a plain tofu init). The zip pins (SHA-256 and h1) go into the generated lock file and let `yawn providers` fill an offline mirror from the same release.

Types

type Event

type Event struct {
	Props    EventProps
	Resource *core.Resource
}

Event is a managed xyOps event.

func NewEvent

func NewEvent(stack *core.Stack, name string, p EventProps) *Event

NewEvent adds a shell event. OpenTofu refuses to destroy it.

type EventProps

type EventProps struct {
	ID       string
	Title    string
	Enabled  bool
	Category string
	// Targets are xyOps server IDs.
	Targets []string
	Notes   string
	// Script is the shell script run by the shellplug plugin.
	Script  string
	Fields  []Field
	Trigger Trigger
	// Concurrency is the maximum number of jobs at once (default 1).
	Concurrency int
	// Queue, if > 0, queues up to this many jobs for QueueSeconds.
	Queue        int
	QueueSeconds int
	// TimeoutSeconds bounds a job.
	TimeoutSeconds int
	// AlertWebHook, if set, is called when a job fails.
	AlertWebHook string
	// Import adopts the existing event with this ID.
	Import bool
}

EventProps configures a shell event that runs one reviewed script.

type Field

type Field struct {
	ID       string
	Title    string
	Type     string // "text" or "textarea"
	Required bool
	// Regex must match the whole value; xyOps rejects other input.
	Regex   string
	Caption string
}

Field is a user parameter of an event (shown when it is run manually, accepted from a magic link). Only declared fields reach the job.

type Secret

type Secret struct {
	Props    SecretProps
	Resource *core.Resource
}

Secret is a managed xyOps secret record.

func NewSecret

func NewSecret(stack *core.Stack, name string, p SecretProps) *Secret

NewSecret adds a secret record. Only the listed events are granted; no category, plugin or web hook grants. OpenTofu refuses to destroy it.

type SecretProps

type SecretProps struct {
	// ID is the secret's xyOps id (generated ids from the UI are fine).
	ID    string
	Title string
	// Notes, if empty, are left unmanaged (edited in the UI).
	Notes string
	// Events that receive the secret's variables in their jobs' environment.
	Events []*Event
	// Import adopts the existing secret with this ID.
	Import bool
}

SecretProps manages an xyOps secret record and its grants, never its values.

type Trigger

type Trigger struct {
	// Manual allows starting it from the UI/API.
	Manual bool
	// MagicTokenHash enables a magic link: sha256(key + event id) as hex.
	// The key itself is never written anywhere in code.
	MagicTokenHash string
}

Trigger starts an event.

Jump to

Keyboard shortcuts

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