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 ¶
const ProviderVersion = "0.1.2-dev.7"
ProviderVersion is the pinned tofu-provider-xyops release.
Variables ¶
var Credentials = []string{"XYOPS_ENDPOINT", "XYOPS_API_KEY"}
Credentials are the environment variables the provider reads.
Functions ¶
Types ¶
type Event ¶
type Event struct {
Props EventProps
Resource *core.Resource
}
Event is a managed xyOps event.
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.
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.